[英]Vertex Shader Input Order
Does input order for a SM 4.0 vertex shader matter? SM 4.0顶点着色器的输入顺序是否重要?
eg is 例如是
struct App2VS
{
float3 position : POSITION;
float4 color : COLOR0;
float3 normal : NORMAL;
...
};
equivalent to 相当于
struct App2VS
{
float4 color : COLOR0;
float3 position : POSITION;
float3 normal : NORMAL;
...
};
No it shouldn't matter. 不,不应该。 The mapping information is performed by the Input Layout. 映射信息由输入布局执行。
Essentially the input layout maps a given struct element to a specific input "register". 本质上,输入布局将给定的struct元素映射到特定的输入“寄存器”。 These input registers are then used to load the struct used by HLSL. 然后使用这些输入寄存器加载HLSL使用的结构。 The HLSL struct is not a real memory mapping as those input register (ie POSITION or COLOR0) are not actual memory locations. HLSL结构不是真正的内存映射,因为那些输入寄存器(即POSITION或COLOR0)不是实际的内存位置。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.