Sign in to follow this  
Helo7777

UBO not working in vertex shaders

Recommended Posts

Helo7777    693
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. Edited by Jaroy

Share this post


Link to post
Share on other sites
Ashaman73    13715
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).

Share this post


Link to post
Share on other sites
larspensjo    1561
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.

Share this post


Link to post
Share on other sites
Helo7777    693
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.

Share this post


Link to post
Share on other sites
larspensjo    1561
[quote name='Jaroy' timestamp='1353413284' post='5002643']
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.
[/quote]
Interesting!

Have you been able to verify this, using glGetUniformIndices/glGetActiveUniformsiv (I think it is)?

Share this post


Link to post
Share on other sites
Helo7777    693
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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this