UBO not working in vertex shaders

Started by
6 comments, last by Helo7777 11 years, 4 months ago
Hi all,

Iv'e got a little issue, on osx and ogl 3.2 ubo data doesn't seem to be sending correctly to the vertex shader only. Some data is sending which makes me think the buffer is offset or something. The strange thing is though ubos work fine on the fragment shader, and on windows this problem does't appear at all. If I swap the ubo out for individual uniforms then that works, but It's not really an option...oh the ubos are defined as std140, and the data I'm passing from the app is in multiples of vec4s so there shouldn't be an issue there. Maybe a mac driver issue? Anyways, any help appreciated.
Advertisement
Have you checked if you hit a driver limitation ? Check if your ubos exceed the max allowed blocks (GL_MAX_VERTEX_UNIFORM_BLOCKS?) or if the block size is too large (GL_MAX_UNIFORM_BLOCK_SIZE).
Yeah checked them both and I'm not hitting any limit there
Are you using the Intel HD3000/HD4000 graphics?

I have an application using UBOs. It works perfectly for AMD and NVIDIA, but the UBO stops working for Intel. I am using Windows, so it may not be the same problem.

I did make it work sporadically. Replacing the UBO at one place with standard Uniforms made the UBO work at another shader. It was all very confusing, and I gave it up. Needless to say, I am also very interested in any clues.
[size=2]Current project: Ephenation.
[size=2]Sharing OpenGL experiences: http://ephenationopengl.blogspot.com/
I am using Intel HD3000. My windows machine is AMD and has no issues.
So I think I found the cause of this issue, vertex shaders on the mac, maybe on Intel HD3000 in particular, packs uniform buffers tightly. It doesn't pay any attention to setting the std140 flag.

So I think I found the cause of this issue, vertex shaders on the mac, maybe on Intel HD3000 in particular, packs uniform buffers tightly. It doesn't pay any attention to setting the std140 flag.

Interesting!

Have you been able to verify this, using glGetUniformIndices/glGetActiveUniformsiv (I think it is)?
[size=2]Current project: Ephenation.
[size=2]Sharing OpenGL experiences: http://ephenationopengl.blogspot.com/
Alright so I just updated my mac to 10.7.5 from 10.7.2 and it seems to have fixed a lot of the issues so I suggest giving that ago. Theres still some graphical errors but uniform buffers in the vertex shader seem more stable

This topic is closed to new replies.

Advertisement