Cg Core Runtime API cgSetParameterSettingMode(3)
NAME
cgSetParameterSettingode - set the parameter setting mode
for a context
SYNOPSIS
#include
void cgSetParameterSettingMode( CGcontext context,
CGenum parameterSettingMode );
PARAMETERS
context The context in which to set the parameter setting
mode.
parameterSettingMode
The mode to which context will be set. Must be one
of the following :
]o CGIMEDIATEPARAMETERSETING
]o CGDEFEREDPARAMETERSETING
RETURN VALUES
None.
DESCRIPTION
cgSetParameterSettingode controls the behavior of the
context when setting parameters. With deferred parameter
setting, the corresponding 3D API parameter is not
immediately updated by cgSetParameter commands. If the
application does not need to access these 3D API parameter
values, then this mode allows improved performance by
avoiding unnecessary 3D API calls.
Parameters of variability CGVARYING are never deferred.
When the parameter setting mode is
CGDEFEREDPARAMETERSETING, non-erroneous cgSetParameter
commands record the updated parameter value but do not
immediately update the corresponding 3D API parameter.
Instead the parameter is marked internally as update
deferred. The 3D API commands required to update any
program parameters marked update deferred are performed as
part of the next program bind (see cgGLBindProgram,
cgD3D9BindProgram, or cgD3D8BindProgram).
If a context's parameter setting mode was
CGDEFEREDPARAMETERSETING and one or more parameters are
marked update deferred, changing the parameter setting mode
to CGIMEDIATEPARAMETERSETING does not cause parameters
marked update deferred to be updated. The application can
use cgUpdateProgramParameters or cgUpdatePassParameters to
Cg Toolkit 2.1 Last change: 1
Cg Core Runtime API cgSetParameterSettingMode(3)
force the updating of parameters marked update deferred.
parameterSettingode must be one of the following enumerants
:
]o CGIMEDIATEPARAMETERSETING
Non-erroneous cgSetParameter commands immediately update
the corresponding 3D API parameter. This is the default
mode.
]o CGDEFEREDPARAMETERSETING
Non-erroneous cgSetParameter commands record the updated
parameter value but do not immediately update the
corresponding 3D API parameter. These updates will
happen during the next program bind. The updates can be
explicitly forced to occur by using
cgUpdateProgramParameters or cgUpdatePassParameters.
EXAMPLES
Change context to use deferred parameter updates:
cgSetParameterSettingMode(myCgContext, CGDEFEREDPARAMETERSETING);
Change context to its initial behavior of performing
parameter updates immediately:
cgSetParameterSettingMode(myCgContext, CGIMEDIATEPARAMETERSETING);
ERORS
CGINVALIDCONTEXTHANDLEROR is generated if context is
not a valid context.
CGINVALIDENUMERANTEROR is generated if
parameterSettingode is not CGIMEDIATEPARAMETERSETING
or CGDEFEREDPARAMETERSETING.
HISTORY
cgSetParameterSettingode was introduced in Cg 2.0.
SEE ALSO
cgGetParameterSettingMode, cgUpdateProgramParameters,
cgUpdatePassParameters, cgSetParameter,
cgSetParameterVariability, cgGetParameterVariability,
cgGLBindProgram, cgD3D9BindProgram, cgD3D8BindProgram
Cg Toolkit 2.1 Last change: 2
|