Sign in to follow this  
monkeyboi

Parameter Shadowing

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
shadowing.
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)[/color]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this