title | description | ms.assetid | ms.topic | ms.date | topic_type | api_name | api_type | api_location | |
---|---|---|---|---|---|---|---|---|---|
def - vs |
Defines vertex shader constants. |
13274e16-990f-4de8-9c99-6c268c7c06ef |
reference |
05/31/2018 |
|
Defines vertex shader constants.
def dst, float1, float2, float3, float4 |
---|
where
- dst is the destination register.
- float1, float2, float3, float4 are four floating point numbers.
Vertex shader versions | 1_1 | 2_0 | 2_x | 2_sw | 3_0 | 3_sw |
---|---|---|---|---|---|---|
def | x | x | x | x | x | x |
The def instruction defines a shader constant whose value is loaded anytime a shader is set to a device. These are called immediate constants. Immediate constants take precedence over constants set by API methods SetVertexShaderConstantF.
There are two ways to set a constant in a shader.
-
Use def - vs to define the constant directly inside a shader.
def - vs can only define floating-point constants.
-
Use the API methods to set a constant.
- Use SetVertexShaderConstantF to set a floating-point constant.