Closed chaoticbob closed 2 months ago
It seems that the swizzling on vector types work fine already. But the swizzling on a scalar value is not working.
0.xxxx;
0.12f.xxx;
I am not sure if Slang should support it. @csyonghe for help.
I take it back.
The swizzling syntax on a scalar value seems to be working.
Only problem is that integer type is recognized as a floating point type when the expression is like 0.xxx
, and slang errors it out as an invalid floating type value.
It works when the expression is (0).xxxx
.
I will see if I can fix this from the parser.
This feature request is for on-ramping. HLSL has a swizzle syntax that allow constants, temporaries, and, variables to swizzle to match the type of the expression. The swizzled expression can only use components up to their highest dimension.
This swizzling is commonly used. It would be helpful to have these operations supported for on-ramping.
Shader: non-exhaustive list of swizzled expressions: