image layouts in openGL compute shader

Started by
1 comment, last by Wh0p 9 years, 11 months ago

Hi, in short I am trying to access an integer texture (GL_RGBA32I) within a compute shader.

This is how I declare the uniform:


layout (rgba32i) uniform image1D some_texture;

and my glsl compiler tells me the following error for this line of code:

error C1318: can't apply layout(rgba32i) to image type "image1D"

since the shader doesnt even compile I have no clue what to do to fix this (apparently all the int and uint formats won't compile). I do have a context set up with OpenGL 4.4

floating point formats work just fine (I've been working with them for quite a while now, but i'd like to store cluster information in 32 bit ints now), the *i and *ui formats are troublesome.

Is it, that I missed something in the specs, but that would be a huge drawback, if there are no integer formats in computeshader?

I appreciate your help,

Wh0p.

Advertisement

For int and uint layouts, you have to use the corresponding types, prefixed "i" and "u": https://www.opengl.org/registry/specs/EXT/shader_image_load_store.txt

So, if you use iimage1D, it will work.

rgba32ui -> uimage*D

rgba32f -> image*D

Thanks a lot,

I guess I wasn't searching thoroughly enough.

This topic is closed to new replies.

Advertisement