Jump to content

  • Log In with Google      Sign In   
  • Create Account


UBO not working in vertex shaders


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
7 replies to this topic

#1 Nyssa   Members   -  Reputation: 426

Like
0Likes
Like

Posted 09 November 2012 - 01:37 AM

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, 09 November 2012 - 01:43 AM.


Sponsor:

#2 Ashaman73   Crossbones+   -  Reputation: 6684

Like
0Likes
Like

Posted 09 November 2012 - 02:03 AM

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).

#3 Nyssa   Members   -  Reputation: 426

Like
0Likes
Like

Posted 09 November 2012 - 03:23 AM

Yeah checked them both and I'm not hitting any limit there

#4 larspensjo   Members   -  Reputation: 1526

Like
0Likes
Like

Posted 09 November 2012 - 10:05 AM

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.
Current project: Ephenation.
Sharing OpenGL experiences: http://ephenationopengl.blogspot.com/

#5 Nyssa   Members   -  Reputation: 426

Like
0Likes
Like

Posted 09 November 2012 - 06:47 PM

I am using Intel HD3000. My windows machine is AMD and has no issues.

#6 Nyssa   Members   -  Reputation: 426

Like
1Likes
Like

Posted 20 November 2012 - 06:08 AM

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.

#7 larspensjo   Members   -  Reputation: 1526

Like
0Likes
Like

Posted 20 November 2012 - 07:24 AM

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)?
Current project: Ephenation.
Sharing OpenGL experiences: http://ephenationopengl.blogspot.com/

#8 Nyssa   Members   -  Reputation: 426

Like
0Likes
Like

Posted 21 November 2012 - 05:11 AM

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




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