shader-slang / slang

Making it easier to work with shaders
MIT License
2.05k stars 175 forks source link

Missing SM 6.6 function: `IsHelperLane()` #4444

Closed chaoticbob closed 3 months ago

chaoticbob commented 3 months ago

Compiling the shader below results in this error message:

shader.hlsl(8): error 30015: undefined identifier 'IsHelperLane'.
    if (IsHelperLane()) ret = 2.0;
        ^~~~~~~~~~~~

CMD

slangc.exe -target spirv -lang slang -D__spirv__ -emit-spirv-directly -profile ps_6_6 -entry main

Would be useful to have this function to ease porting of advanced shaders.

Shader

float4 main() : SV_Target {
    float ret = 1.0;

    if (IsHelperLane()) ret = 2.0;

    return (float4)ret;
}
jkwak-work commented 3 months ago

This looks like a good first bug for @venkataram-nv . I am assigning it to him.

chaoticbob commented 3 months ago

Just FYI...for both DXC emulates this function starting in SM 6.0 and before SM 6.6.