Result: The shader will see the def'd value in c4 (set by def in shader 1) In Direct3D 8.x Set***ShaderConstant takes effect immediately. Result: The shader will see the value in c4 from Set***ShaderConstant This behavior is different in Direct3D 8.x. In Direct3D 9, calling Get***ShaderConstant* will only retrieve constant values set via Set***ShaderConstant*. Result: The shader will see the value last set in c4 by Result: The shader will see the def'd value in c4Ĭreate shader2 (which references c4 but does not use the def instruction Here's an example using Direct3D 9: Given:Ĭreate shader1 which references c4 and defines it with the def instruction Defined constants in Direct3D 9 have no side effects outside of the shader. In Direct3D 9 the lifetime of defined constants in a given shader is confined to the execution of that shader only (and is non-overridable). Use one of the Set***ShaderConstant* API methods. Declare a shader constant in assembly code using one of the def* instructions.There are two ways to set constant registers in an assembly shader: Behavior of Constant Registers in Assembly Shaders The Shader Model 4 Assembly and Shader Model 5 Assembly sections describe the instructions that shader model 4 and 5 support. Pixel Shader Differences summarizes the differences between pixel shader versions. Vertex Shader Differences summarizes the differences between vertex shader versions. Shaders drive the programmable graphics pipeline.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |