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] 0.0 / 0.0 should not be allowed #2313

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

[wgsl-in] 0.0 / 0.0 should not be allowed #2313

Wumpf opened this issue Apr 24, 2023 · 1 comment · Fixed by #2309
Labels
area: front-end Input formats for conversion kind: bug Something isn't working lang: WGSL WebGPU shading language

Comments

@Wumpf
Copy link
Member

Wumpf commented Apr 24, 2023

Spec says that NaN is generally not defined. I think Tint is right here and Naga should catch this as well as Tint does:

Tint WGSL reader failure: :80:17 error: '0.0 / 0.0' cannot be represented as 'abstract-float'
    let a = 0.0 / 0.0;
@ErichDonGubler
Copy link
Member

ErichDonGubler commented Apr 24, 2023

For reference, this violates the WGSL spec for abstract numeric types:

An evaluation of an expression in one of these types must not overflow or produce infinite, NaN, undefined, or indeterminate results.

Kudos to @ben-clayton for pointing this out in Matrix.

@teoxoy teoxoy added kind: bug Something isn't working lang: WGSL WebGPU shading language area: front-end Input formats for conversion 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: front-end Input formats for conversion kind: bug Something isn't working lang: WGSL WebGPU shading language
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants