Access Static Variable in Shader

Started by
4 comments, last by fs1 10 years, 3 months ago

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!

Advertisement

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

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

Thanks. Can they change over time? And can it be accessed from outisde the shader?

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

I restore Nintendo 64 video-game OST’s into HD! https://www.youtube.com/channel/UCCtX_wedtZ5BoyQBXEhnVZw/playlists?view=1&sort=lad&flow=grid

Ok thanks both for your insights!

This topic is closed to new replies.

Advertisement