shader-slang / slang

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

Unexpected error: unable to parse target intrinsic snippet: `CheckAccessFullyMapped` #4438

Closed chaoticbob closed 4 hours ago

chaoticbob commented 1 week ago

I see that CheckAccessFullyMapped was added to stdlib in #1712, but I'm getting this when attempting to use it in the shader below:

hlsl.meta.slang(6600): error 29000: unable to parse target intrinsic snippet: CheckAccessFullyMapped
hlsl.meta.slang(6600): error 29000: unable to parse target intrinsic snippet: CheckAccessFullyMapped
hlsl.meta.slang(6600): error 29000: unable to parse target intrinsic snippet: CheckAccessFullyMapped

This syntax is accepted by DXC and seems like it should work. I looked at hlsl.meta.slang and all the types seem to line up.

Shader

SamplerState      gSampler  : register(s5);
Texture2D<float4> t         : register(t1);

float4 main(int2 offset: A) : SV_Target {
    uint status;
    float clamp;
    float4 val = t.Sample(gSampler, float2(0.1, 0.2), 1, clamp, status);

    bool success = CheckAccessFullyMapped(status);
    return success ? (float4)1 : (float4)0;
}
jkwak-work commented 16 hours ago

HLSL spec can be found from the following URL, https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/checkaccessfullymapped

bool CheckAccessFullyMapped(
  in uint_only status
);