Setting global variable in shader

Started by
2 comments, last by MJP 14 years, 1 month ago
When making the calls to set global variables in your shader code, is it a correct assumption that these values are held by DirectX and then set to the video card when making the "beginPass" call? I was originally under the assumption that the video card was being set when these calls are made but the more I think about it, it can't work that way especially when there's more then one shader loaded.
Advertisement
Since you said "BeginPass" I assume you're using Effects. Effects will indeed cache values of shader constants and will set them onto the device when you call BeginPass. If you'd like you can use PIX to capture a frame, and you can expand your BeginPass call to see all of the actual D3D calls being made under the hood.
Quote:Original post by MJP
Since you said "BeginPass" I assume you're using Effects.
Yep.

Quote:Original post by MJP
If you'd like you can use PIX to capture a frame, and you can expand your BeginPass call to see all of the actual D3D calls being made under the hood.
What is PIX?
PIX is pure awesomeness. There's a quick rundown of the features on my blog. There's also plenty of documentation on MSDN.

This topic is closed to new replies.

Advertisement