shader-slang / slang

Making it easier to work with shaders
MIT License
1.78k stars 159 forks source link

Capability System: `__target_switch` never compares `case:` capabilities to the parent `[require(...)]` #4508

Closed ArielG-NV closed 16 hours ago

ArielG-NV commented 4 days ago

Problem: following code will compile but should at a minimum warn:

[require(glsl_hlsl)]
void myfunc()
{
    __target_switch
    {
    case hlsl:
    case spirv:
    }
}

Expected behavior: error since spirv is not listed by the parent [require(...)]