| 47 | |
| 48 | |
| 49 | void initialize() |
| 50 | { |
| 51 | g_texture = globjects::Texture::createDefault(GL_TEXTURE_2D); |
| 52 | g_texture->image2D(0, GL_R32F, 512, 512, 0, GL_RED, GL_FLOAT, nullptr); |
| 53 | g_texture->bindImageTexture(0, 0, GL_FALSE, 0, GL_WRITE_ONLY, GL_R32F); |
| 54 | g_texture->setParameter(GL_TEXTURE_MIN_FILTER, GL_NEAREST); |
| 55 | g_texture->setParameter(GL_TEXTURE_MAG_FILTER, GL_NEAREST); |
| 56 | g_texture->ref(); |
| 57 | |
| 58 | g_computeProgram = new globjects::Program(); |
| 59 | |
| 60 | const auto dataPath = common::retrieveDataPath("globjects", "dataPath"); |
| 61 | g_computeProgram->attach(globjects::Shader::fromFile(GL_COMPUTE_SHADER, dataPath + "computeshader/cstest.comp")); |
| 62 | g_computeProgram->setUniform("destTex", 0); |
| 63 | g_computeProgram->ref(); |
| 64 | |
| 65 | g_quad = new ScreenAlignedQuad(g_texture); |
| 66 | g_quad->setSamplerUniform(0); |
| 67 | g_quad->ref(); |
| 68 | } |
| 69 | |
| 70 | void deinitialize() |
| 71 | { |
no test coverage detected