Jump to content
  • Advertisement
Sign in to follow this  
malyskolacek

Address register performance

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

Hello! I'm currently working on a lighting/shadowing shader system. I've opted for runtime linking of HLSL fragments (my target is SM 3.0) and I've run across an issue with shader constants. As each shader might be processing several different lights (1-8 usually) there would be quite heavy constant changing traffic. Therefore I thought of this scheme: I would assign a range of constants (c128-c255 for example) for lights constants and each visible light would have fixed constants block (e.g. light1 would occupy c128-c131, light2 c132-c135 and so on) that would be filled with some caching (most lights are static). In the rendering pass I would only set a constant with offsets into the light constants range and the shader would get the lights parameters with the help of the a0 address register. My question is, whether this would be faster and more efficient than the brute force approach of refilling all the constants per Draw* call. Thanks for your responses

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!