<p>Outside of <code>GL_R11F_G11F_B10F</code>, 3-channel formats are <a href="https://www.khronos.org/opengl/wiki/Image_Load_Store#Images_in_the_context" rel="nofollow noreferrer">not allowed for image load/store</a>. And you'll note that <code>rgb32f</code> is <a href="https://www.khronos.org/opengl/wiki/Image_Load_Store#Format_qualifiers" rel="nofollow noreferrer">not in the list of valid format qualifiers for GLSL variables</a>, nor are any other 3-channel formats (except <code>r11f_g11f_b10f</code>).</p>

CC BY-SA 4.0
2020-03-24T04:47:24.357Z
2020-03-24T04:47:24.357Z
Nicol Bolas
<p>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. </p>

<p>this my code to bind the texture to an image: </p>

<pre><code>glGenTextures(1, &amp;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);
</code></pre>

<p>Additionally, this is the declaration in the compute shader:</p>

<pre><code>layout(binding = 0, RGB32F) uniform image3D field;
</code></pre>

<p>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.</p>

<opengl><rendering><3d><c++>
glBindImageTexture returning INVALID_VALUE
Sachin Chopra
# glBindImageTexture returning INVALID_VALUE

(Asked by: username_0 on 2020-03-23)

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.

**Tags:** opengl, rendering, 3d, c++


---

## 1 answers

### Answer by username_1 on 2020-03-24. Score: 3

Outside of `GL_R11F_G11F_B10F`, 3-channel formats are [not allowed for image load/store](https://www.khronos.org/opengl/wiki/Image_Load_Store#Images_in_the_context). And you'll note that `rgb32f` is [not in the list of valid format qualifiers for GLSL variables](https://www.khronos.org/opengl/wiki/Image_Load_Store#Format_qualifiers), nor are any other 3-channel formats (except `r11f_g11f_b10f`).


---

