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

[wgsl-in] Missing integer type validation for contants #2311

Closed
Wumpf opened this issue Apr 24, 2023 · 1 comment · Fixed by #2266
Closed

[wgsl-in] Missing integer type validation for contants #2311

Wumpf opened this issue Apr 24, 2023 · 1 comment · Fixed by #2266
Labels
area: validation Validation of the IR kind: bug Something isn't working

Comments

@Wumpf
Copy link
Member

Wumpf commented Apr 24, 2023

As of 0.12.0 this compiles:

var<private> TEXTURE_SIZE: u32 = 2048;

When it should actually be

var<private> TEXTURE_SIZE: u32 = 2048u;

For me, this caused an invalid glsl shader down the line whereas the msl variant was happy. Glsl failed (correctly) with Internal error in ShaderStages(NONE | VERTEX) shader: ERROR: 0:63: '=' : cannot convert from 'const int' to 'highp uint'

(yes, const TEXTURE_SIZE: u32 = 2048u; would be more appropriate!)

@Wumpf Wumpf changed the title Missing integer type validation for contants [wgsl-in] Missing integer type validation for contants Apr 24, 2023
@teoxoy
Copy link
Member

teoxoy commented Apr 24, 2023

Thanks for the report! I recently fixed this in #2266.

@teoxoy teoxoy added kind: bug Something isn't working area: validation Validation of the IR labels Apr 24, 2023
@teoxoy teoxoy added this to the WGSL Specification V1 milestone Apr 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: validation Validation of the IR kind: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants