-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
area: naga front-endlang: WGSLWebGPU Shading LanguageWebGPU Shading LanguagenagaShader TranslatorShader Translatortype: bugSomething isn't workingSomething isn't working
Milestone
Description
The following isn't accepted right now (note that this is how the spec defines the minimum integer https://www.w3.org/TR/WGSL/#integer-types)
const i32min = i32(-0x80000000);
Instead this is accepted and probably shouldn't:
const i32min = -0x80000000i
In fact, Tint will fail this with:
Tint WGSL reader failure: :24:17 error: value cannot be represented as 'i32'
const i32min = -0x80000000i; // Tint can't handle this being represented as `-0x80000000i`
I thought originally that this is the actual error, but I think the reasoning over at the chrome bug I opened is correct and above should be rejected, see https://bugs.chromium.org/p/chromium/issues/detail?id=1439274
For anyone else running into this, note that const i32min = -2147483648;
is accepted by both compilers.
Metadata
Metadata
Assignees
Labels
area: naga front-endlang: WGSLWebGPU Shading LanguageWebGPU Shading LanguagenagaShader TranslatorShader Translatortype: bugSomething isn't workingSomething isn't working