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 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.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |