The select intrinsic has a matrix variant that operates like the vector version of select but looks like this:
T select(S cond, T a, T b);
T is a matrix of supported arithmetic type
S is a bool matrix
Currently, Slang produces errors like this when compiling the shader below:
shader.hlsl(56): error 30019: expected an expression of type 'bool', got 'matrix<bool,2,2>'
float2x2 c2x2 = select(cond2x2, a2x2, b2x2);
^~~~~~~
shader.hlsl(61): error 30019: expected an expression of type 'bool', got 'matrix<bool,2,3>'
float2x3 c2x3 = select(cond2x3, a2x3, b2x3);
^~~~~~~
shader.hlsl(66): error 30019: expected an expression of type 'bool', got 'matrix<bool,2,4>'
float2x4 c2x4 = select(cond2x4, a2x4, b2x4);
^~~~~~~
I couldn't find any documentation for this variant of the intrinsic. The shader below compiles and appears to generate valid DXIL and SPIR-V. Input matrices are row_major because DXC complains that column_major of bool matrices aren't supported.
This may rely on #4395 being completed first.
The
select
intrinsic has a matrix variant that operates like the vector version ofselect
but looks like this:T is a matrix of supported arithmetic type S is a bool matrix
Currently, Slang produces errors like this when compiling the shader below:
I couldn't find any documentation for this variant of the intrinsic. The shader below compiles and appears to generate valid DXIL and SPIR-V. Input matrices are
row_major
because DXC complains thatcolumn_major
of bool matrices aren't supported.Shader