Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

precise modifier in HLSL function return type crashes parser #433

Open
new-cassellito opened this issue Jul 23, 2024 · 0 comments
Open

precise modifier in HLSL function return type crashes parser #433

new-cassellito opened this issue Jul 23, 2024 · 0 comments

Comments

@new-cassellito
Copy link
Contributor

Minimal example HLSL compute shader:

RWTexture2D<float4> res;

precise float MakePrecise(in precise float v) {
    precise float pv = v;
    return pv;
}

[numthreads(8, 8, 4)]
void Main (uint3 dtid : SV_DispatchThreadID)
{
    res[dtid.xy] = float4(MakePrecise(1), 0, 0, 1);
}

Crashes with the error

precise float MakePrecise(in precise float v) {
        ^
Expecting: Type qualifier or ';'

Removing the precise modifier from the return type causes the shader to parse correctly e.g. this works as expected

RWTexture2D<float4> res;

float MakePrecise(in precise float v) {
    precise float pv = v;
    return pv;
}

[numthreads(8, 8, 4)]
void Main (uint3 dtid : SV_DispatchThreadID)
{
    res[dtid.xy] = float4(MakePrecise(1), 0, 0, 1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant