Jump to content
  • Advertisement
Sign in to follow this  

Shader constant size.

This topic is 3984 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

I've been looking around google and gamedev, and I can't seem to find out an exact value as to how many floats can be pushed to the graphics card as constant uniform data. (and the gl equiv for uniform) Just a list will do comparing each version of the shaders will do. Thanks a bunch guys! (hows that for a quick question? :grin:)

Share this post


Link to post
Share on other sites
Advertisement
The DirectX documentation is the best place to look: Vertex Shader Registers and Pixel Shader Registers

Basically it breaks down like this (remember each constant holds 4 floats):

SM1:
Pixel Shader - 8 Constant registers
Vertex Shader - 96

SM2:
PS - 32
VS - 256

SM3:
PS - 224
VS - 256

DirectX 10 works a bit differently. You no longer have constant registers but constant buffers. Each constant buffer can hold up to 4096 constants and you can have up to 16 constant buffers set at a time. DirectX 10 has unified shaders so the limit is the same for vertex, pixel and geometry shaders.

Share this post


Link to post
Share on other sites
u can query this in opengl with a glGet... ( ) command see the back of the gl spec for a list

eg
glGetIntergerv( MAX FRAGMENT UNIFORM COMPONENTS, num );

Share this post


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

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!