3

I am currently having an issue with OpenGL as I am trying to load some vector information into a 3D texture. Currently, I am developing in OpenGL 4.6 which should support Image bindings.

this my code to bind the texture to an image:

glGenTextures(1, &field_sbo);
glBindTexture(GL_TEXTURE_3D, field_sbo);
glTextureStorage3D(field_sbo, 1, GL_RGB32F, 10,10,10);
glTextureSubImage3D(field_sbo, 0, 0, 0, 0, 10, 10, 10, GL_RGB, GL_FLOAT, vector_data);
glBindImageTexture(0, field_sbo, 0, GL_TRUE, 0, GL_READ_ONLY, GL_RGB32F);

Additionally, this is the declaration in the compute shader:

layout(binding = 0, RGB32F) uniform image3D field;

From my understanding, the glTextureStorage3D should make the texture immutable, however I keep getting an INVALID_VALUE at the glBindImageTexture stage. I have looked at the documentation for the errors however I cannot seem to fix the issue.

1 Answers1

3

Outside of GL_R11F_G11F_B10F, 3-channel formats are not allowed for image load/store. And you'll note that rgb32f is not in the list of valid format qualifiers for GLSL variables, nor are any other 3-channel formats (except r11f_g11f_b10f).

Nicol Bolas
  • 9,762
  • 18
  • 25