I'm trying to go through all of the new OpenGL 4.3 additions. I have looking at shader storage buffers and compute shaders. I gotten a lot to work. However I would like to use the atomic_uint with a shader storage buffer. I was trying to use the example from Mike Bailey: http://web.engr.oregonstate.edu/~mjb...shader.1pp.pdf. But I'm getting a compile error in my compute shader at this line:

layout( std140, binding=7 ) buffer { atomic_uint bounceCount };

It seems the compiler really wants a name after the buffer keyword. If I put one there it then gives me a new error about specifying a layout for the atomic_uint.

Any thoughts would be appreciated. The basic idea is that I should be able to bind an atomic to a GL_ATOMIC_COUNTER_BUFFER to set value and then read them using:


glBindBuffer( GL_SHADER_STORAGE_BUFFER, countBuffer );
GLuint *ptr = (GLuint *) glMapBuffer( GL_SHADER_STORAGE_BUFFER, GL_READ_ONLY );

But since I can't compile the compute shader I'm stuck.

If anyone has and idea please let me know.

Thank you,

Craig