Jump to content
  • Advertisement
Sign in to follow this  
Ardor

Weird constant names in HLSL?

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

Hi, I stumbled upon something weird when using HLSL shaders. I compile them with the D3DX compiler, and get a constant table (among other stuff). Now, I can get a handle for the constant "worldviewprojection", for example. There is one slight problem though: If the constant is outside a function, like
float4x4 worldviewprojection; void main( ......
Then the constant is called "worldviewprojection" in the table. So far so good. However, if the constant is in a function's parameter list, like
void main( ... uniform float4x4 wvp; ...)
Then the constant in the table is called "$worldviewprojection" instead of just "worldviewprojection", which is really annoying. Any way how I can get rid of the "$"? I mean, I can easily remove it, but I don't know if this is a good idea (other special characters could appear, more than one $ etc., thus I would have to hack around and try to catch up with the table's weirdness).

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!