Advertisement Jump to content
Sign in to follow this  

Weird constant names in HLSL?

This topic is 4915 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
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!