Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


image layouts in openGL compute shader


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 Wh0p   Members   -  Reputation: 340

Like
0Likes
Like

Posted 02 May 2014 - 03:49 AM

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.



Sponsor:

#2 michalferko   Members   -  Reputation: 644

Like
3Likes
Like

Posted 02 May 2014 - 09:17 AM

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



#3 Wh0p   Members   -  Reputation: 340

Like
0Likes
Like

Posted 02 May 2014 - 07:15 PM

Thanks a lot,

I guess I wasn't searching thoroughly enough.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS