They change nothing about how OpenGL stores the data. The last three parameters only describe the arrangement of the pixel data you're giving OpenGL.
If you want to use an image you have stored to as a texture later, there must be an explicit glMemoryBarrier call after the rendering command that writes to it, but before the rendering command that samples from it as a texture. They require explicit user synchronization before they become visible. Remember: writes to images via Image Load/Store are not memory coherent. I don't see a call to glMemoryBarrier, so there's no guarantee that your code actually works. The vertex array object (vao) has one buffer with 6 2D vertices: The last commented line in fragment shader produces this output: Render output Gl_Position = vec4(position.x, position.y, 0.0f, 1.0f)
#extension GL_ARB_explicit_attrib_location : require GlUniform1i(drawProgram->GetUniformLocation("sampler"), 0) Īnd the drawProgram consists of: #version 430 This is how I display the texture: // This comes right after the previous block of code
Opengl 4.3 free download full#
Then a full screen quad is rendered with that texture but currently it only shows some random old data from video memory. GlUniform1i(program->GetUniformLocation("image"), 0) GlBindImageTexture(0, tex, 0, GL_FALSE, 0, GL_WRITE_ONLY, GL_RGBA32F) GlTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, WIDTH, HEIGHT, 0, GL_RGBA, GL_FLOAT, 0) ImageStore(image, ivec2(gl_GlobalInvocationID.xy), vec4(0.0f, 1.0f, 1.0f, 1.0f)) Īnd the application code is here: GLuint tex Layout (local_size_x = 1, local_size_y = 1) in I'm trying to output some data from compute shader to a texture, but imageStore() seems to do nothing.