I have created a texture and filled it with some data:
glBindTexture(GL_TEXTURE_2D, head_pointer_image);
glTexImage2D(GL_TEXTURE_2D, 0, GL_R32UI, width, height, 0, GL_RED_INTEGER, GL_UNSIGNED_INT, data);
Then I bound it to 0:
glBindImageTexture(0, head_pointer_image, 0, GL_FALSE, 0, GL_READ_WRITE, GL_R32UI);
glUniform1ui(0, 0); // Not sure if necessary
If I check the data with glGetTexImage() I get correct values, but if I try to read it in my shader, I only get zeros.
layout(binding = 0, r32ui) coherent uniform uimage2D head_pointer_image;
uint value = imageLoad(head_pointer_image, ivec2(gl_FragCoord.xy)).r;
What am I doing wrong?