I'm using the OpenGL API (v 4.6) to do some image processing stuff, its basically OpenGL image load store operations in a shader, I load the Texture via glBindImageTexture and do some processing, then I want to use glGetTexImage to read the contents of my updated image but while the function itself works fine it returns an all black image, which isnt really the case when its loaded in other shaders.
TLDR: Image works fine when loaded inside a shader (I use it in many and renderdoc displays it all fine in the GPU side) but it is all-black software side.
this is what my output should have been like using glGetTexImage (viewed with renderdoc after rendering)
use_shader(&shader);
glBindBuffer (GL_ARRAY_BUFFER, quad_vbo);
setInt(shader, "screen_width", window_width);
setInt(shader, "screen_height", window_height);
glBindImageTexture(0, head_list, 0, FALSE, 0, GL_READ_WRITE, GL_R32UI); //head list is the opengl texture id
glDrawArrays(GL_TRIANGLES, 0, 24);
glBindVertexArray(0);
glMemoryBarrier(GL_ALL_BARRIER_BITS);
//the image is just a GL_RED so one component
GLint *image_head= (GLint*)malloc(sizeof(u32) *window_width *window_height);
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, head_list);
glGetTexImage(GL_TEXTURE_2D, 0, GL_RED, GL_UNSIGNED_INT, image_head);