Skip to content

Conversation

@Vipitis
Copy link

@Vipitis Vipitis commented Dec 27, 2025

I'mConnections
fixes #6208

Description
Adds a Sequence expression kind so side effect of comma separated expressions aren't lost.
draft because I am not happy with this approach - but it seems to be working on the surface. Comments welcome this is my first time trying to fix rust code.

Testing
Adds naga glsl test case, sanity checked against shadertoy, now both are visually grey.

Squash or Rebase?
squash

Checklist

  • Run cargo fmt.
  • Run taplo format.
  • Run cargo clippy --tests. If applicable, add:
    • --target wasm32-unknown-unknown
  • Run cargo xtask test to run tests.
  • If this contains user-facing changes, add a CHANGELOG.md entry.

@Vipitis Vipitis changed the title Glsl for [glsl-in] fix missing side effects from multi part expressions Dec 27, 2025
@@ -0,0 +1,19 @@
// issue #6208 https://github.com/gfx-rs/wgpu/issues/6208
# version 460
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Vipitis Vipitis marked this pull request as ready for review January 7, 2026 08:16
@Vipitis Vipitis changed the title [glsl-in] fix missing side effects from multi part expressions [glsl-in] fix missing side effects from sequence expressions Jan 7, 2026
@inner-daemons inner-daemons self-requested a review January 7, 2026 16:31
@inner-daemons inner-daemons self-assigned this Jan 7, 2026
Copy link
Collaborator

@inner-daemons inner-daemons left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this PR, its very useful I believe! One little nit in the comments plus one question:

Whats with all of these weirdly formatted comments? Are they taken from a spec somewhere? Just meant to guide you? I don't know if we should keep them or not

Comment on lines +538 to +540
for &e in &exprs[1..] {
meta.subsume(stmt.hir_exprs[e].meta);
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for handling the spans correctly

Comment on lines +1357 to +1360
return Err(Error {
kind: ErrorKind::SemanticError("Empty expression sequence".into()),
meta,
})
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this can't be produced by the parser its more clear to say unreachable!()

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lots of non-functional changes here, see overall review comment

@Vipitis
Copy link
Author

Vipitis commented Jan 8, 2026

I will address the review later (1-2 days hopefully).

Whats with all of these weirdly formatted comments? Are they taken from a spec somewhere? Just meant to guide you? I don't know if we should keep them or not

It's from the GLSL spec, chapter 9 shader grammar. to help me read the code initially. As the functions don't exactly match the productions and tokens there I added in the places I looked at to better understand what's happening. Sadly the grammar doesn't appear to be any kind of normalized CFG.
Similar comments already exist in declarations.rs, so would it be best to remove all, remove mine, add more (and agree on a format/prefix).

@inner-daemons
Copy link
Collaborator

@Vipitis With that in mind I'll do another pass on the comments. I definitely think many of them are misplaced at least.

@inner-daemons inner-daemons self-requested a review January 8, 2026 08:51
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

Successfully merging this pull request may close these issues.

[glsl-in] lost statement of multi part loop-expression

3 participants