I create a texture as:
glTexStorage2D(GL_TEXTURE_2D, 1, GL_SRGB8_ALPHA8, 128, 128);
Then tried to bind it to a compute shader as:
glBindImageTexture
(
0,//unit
texture,
0,//level
GL_FALSE,//layered for volume/array textures
0, // layer
GL_WRITE_ONLY,
//GL_SRGB8_ALPHA8
GL_RGBA8
);
And I get an invalid operation error but the compute shader seemingly writes the data? I have tried a multitude of different formats for glBindImageTexture() but can't get past such errors. What is the correct way to write to an GL_SRGB8_ALPHA8 texture in a compute shader?