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

[naga wgsl-out] Include the i suffix on i32 literals. #4863

Merged
merged 2 commits into from
Dec 12, 2023

Conversation

jimblandy
Copy link
Member

@jimblandy jimblandy commented Dec 12, 2023

Without the suffix, Expression::Literal(Literal::I32) expressions get written without any suffix on the decimal number, meaning that they get re-parsed as AbstractInt values. In theory, this should always be fine, but since we don't actually support abstract types yet in all the places we should, having them appear in the output causes validation problems.

Checklist

  • Run cargo fmt.
  • Run cargo clippy.
  • Run cargo xtask test to run tests.
  • Add change to CHANGELOG.md. See simple instructions inside file.

@jimblandy jimblandy added area: naga back-end Outputs of naga shader conversion naga Shader Translator lang: WGSL WebGPU Shading Language labels Dec 12, 2023
@jimblandy jimblandy requested a review from a team as a code owner December 12, 2023 01:30
Without the suffix, `Expression::Literal(Literal::I32)` expressions
get written without any suffix on the decimal number, meaning that
they get re-parsed as AbstractInt values. In theory, this should
always be fine, but since we don't actually support abstract types yet
in all the places we should, having them appear in the output causes
validation problems.
@jimblandy jimblandy force-pushed the naga-wgsl-out-i32-literals-suffix branch from c1d1f6e to 955cc65 Compare December 12, 2023 01:32
@teoxoy teoxoy enabled auto-merge (squash) December 12, 2023 11:52
@teoxoy teoxoy merged commit 6dc9cca into gfx-rs:trunk Dec 12, 2023
27 checks passed
jimblandy added a commit to jimblandy/wgpu that referenced this pull request Dec 12, 2023
Without the suffix, `Expression::Literal(Literal::F32)` expressions
get written without any suffix on the number, meaning that they get
re-parsed as `AbstractFloat` values. In theory, this should always be
fine, but since we don't actually support abstract types yet in all
the places we should, having them appear in the output causes
validation problems.

See also: gfx-rs#4863, which did the same for `i32` literals.
jimblandy added a commit to jimblandy/wgpu that referenced this pull request Dec 12, 2023
Without the suffix, `Expression::Literal(Literal::F32)` expressions
get written without any suffix on the number, meaning that they get
re-parsed as `AbstractFloat` values. In theory, this should always be
fine, but since we don't actually support abstract types yet in all
the places we should, having them appear in the output causes
validation problems.

See also: gfx-rs#4863, which did the same for `i32` literals.
teoxoy pushed a commit that referenced this pull request Dec 13, 2023
Without the suffix, `Expression::Literal(Literal::F32)` expressions
get written without any suffix on the number, meaning that they get
re-parsed as `AbstractFloat` values. In theory, this should always be
fine, but since we don't actually support abstract types yet in all
the places we should, having them appear in the output causes
validation problems.

See also: #4863, which did the same for `i32` literals.
@jimblandy jimblandy deleted the naga-wgsl-out-i32-literals-suffix branch December 13, 2023 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: naga back-end Outputs of naga shader conversion lang: WGSL WebGPU Shading Language naga Shader Translator
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants