Closed chaoticbob closed 1 day ago
Slang currently does not support the variant of countbits that takes vector arguments:
countbits
shader.hlsl(15): error 30019: expected an expression of type 'uint', got 'vector<uint,2>' uint2 cb2 = countbits(var2); ^~~~ shader.hlsl(16): error 30019: expected an expression of type 'uint', got 'vector<uint,3>' uint3 cb3 = countbits(var3); ^~~~ shader.hlsl(17): error 30019: expected an expression of type 'uint', got 'vector<uint,4>' uint4 cb4 = countbits(var4);
Frequently used intrinsic, the vector argument variants should be supported.
Shader
cbuffer InputVars { uint1 var1; uint2 var2; uint3 var3; uint4 var4; }; float4 main() : SV_TARGET{ uint1 cb1 = countbits(var1); uint2 cb2 = countbits(var2); uint3 cb3 = countbits(var3); uint4 cb4 = countbits(var4); return float4((float)cb1.x, (float)cb2.x, (float)cb3.x, (float)cb4.x); }
Reference: https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/countbits
Slang currently does not support the variant of
countbits
that takes vector arguments:Frequently used intrinsic, the vector argument variants should be supported.
Shader
Reference: https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/countbits