Jump to content
  • Advertisement
Sign in to follow this  
fs1

Access Static Variable in Shader

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

Dear All,

 

I did some shader reflection and got all bindable variables in a constant buffer.

 

The static variables were not retrive. How can I access a Static Variable from a constant buffer in the Shader with the DirectX 11 API (from the CPU)? How can I get its pointer/offset?

 

Thanks!

Edited by fs1

Share this post


Link to post
Share on other sites
Advertisement

I guess they don't change so I can grab the value from the shader? Correct me if I am wrong.

Share this post


Link to post
Share on other sites

Static variables are directly compiled into they resulting bytecode, since they're constant at compile time. They're not placed in constant buffers.

Share this post


Link to post
Share on other sites
Thanks. Can they change over time? And can it be accessed from outisde the shader?

Share this post


Link to post
Share on other sites

No and no.

“Constant” means “does not change,” and you can’t access something if it is not placed in a constant buffer.

 

 

L. Spiro

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.

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!