举例如下:
float4(a, b, c, d).xyz 等价于 float3(a, b, c)
float4(a, b, c, d).xyy 等价于 float3(a, b,...b)
float4(a, b, c, d).wzyx 等价于 float4(d, c, b, a)
float4(a, b, c, d).w 等价于 float d
值得注意的是...例如:
float a = 1.0;
float4 b = a.xxxx;
注意:swizzle操作符只能对结构体和向量使用,不能对数组使用,如果对数组使用swizzle操作符则会出现错误信息:error