Jump to content
  • Advertisement
Sign in to follow this  

Parameter Shadowing

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

Any one could give me more expanation of what parameter shadowing is? I was reading cg doc and saw this concept. But the explanation is really confusing.

Parameter Shadowing
When the value of a uniform parameter is set by some function of the
OpenGL Cg runtime, it is actually stored internally (or shadowed) by either
the Cg or the OpenGL runtime so that it does not need to be reset every time
the program is about to be executed. This behavior is referred to as parameter
If the Direct3D Cg runtime expanded interface (described in “Direct3D
Expanded Interface” on page 98) is used, parameter shadowing can be
turned on or off on a per?program basis. When parameter shadowing is
turned off for a given program and the value of any of its uniform
parameters is set by some function of the Direct3D Cg runtime, it is
immediately downloaded to the GPU constant memory (the memory
containing the values of all the uniform parameters). When parameter
shadowing is turned on, the value is shadowed instead and no Direct3D call
is made at the time it is set; only when the program is bound are all of its
parameters actually downloaded to the constant memory. This means that a
parameter value set after binding the program is not used during the
execution of the program until the next time the program is bound.
Parameter shadowing applies to all parameter settings including texture
state stage and texture mode.
[color=#ff0000]Disabling parameter shadowing allows the runtime to consume less
memory, but forces the application to do the work of making sure that the
constant memory contains all the right values every time it activates a
program.(why? my understanding is disabling parameter shadowing is suppose to increase memory comsuming on gpu and because all the paremeters are downloaded to gpu immediately after setting there is no point to check their correctness)

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!