Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

Constant Boolean Register

This register is a collection of bits used in static flow control instructions (for example, if bool - vs - else - vs - endif - vs). There are 16 of them, therefore, a shader can have 16 independent branch conditions. They can be set using defb - vs or SetVertexShaderConstantB.

The behavior of shader constants has changed between Direct3D 8 and Direct3D 9.

  • For Direct3D 9, constants set with defx assign values to the shader constant space. The lifetime of a constant declared with defx is confined to the execution of that shader only. Conversely, constants set using the APIs SetXXXShaderConstantX initialize constants in global space. Constants in global space are not copied to local space (visible to the shader) until SetxxxShaderConstants is called.
  • For Direct3D 8, constants set with defx or the APIs both assign values to the shader constant space. Each time the shader is executed, the constants are used by the current shader regardless of the technique used to set them.



Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2014 Microsoft. All rights reserved.