Jump to content
  • Advertisement
Sign in to follow this  
spek

OpenGL UBOs and looong shaders compiling times

This topic is 2336 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

A question about UBO's in combination with Cg. As usual, the nVidia forums remain silent, so I was hoping if someone here could help.

UBO's work fine, but increase the compiling time BIG time. I'm using quite big arrays of data, and it seems they get unwrapped completely. Is there a way to prevent this? The compiled code shows stuff like

#semantic shUBO_Lights._shUBO_Lights : BUFFER[0]

#var float4 _shUBO_Lights.csm[0].posRange : : buffer[0][0] : -1 : 0
#var float4 _shUBO_Lights.csm[0].dirFoV : : buffer[0][16] : -1 : 0
#var float4 _shUBO_Lights.csm[0].splits : : buffer[0][32] : -1 : 0


Instead of re-compiling, I tried to use pre-compiled shaders instead. That also works fine and speeds up loading quite a lot. One thing though... I can't find my UBO parameters anymore! Cg function "cgGetNamedProgramUniformBuffer( uboName )" doesn't find anything anymore. So how to get my handles?


Isn't it possible to workaround it by just binding an UBO (buffer[0], buffer[1], ...) with raw OpenGL commands, like you can bind a texture to a specific unit, without having to use Cg textures to pass a texture to a cg parameter?

Rick

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!