1
$\begingroup$

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.

$\endgroup$
2
$\begingroup$

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).

| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.