Skip to content

Add clip distances validation for maxInterStageShaderVariables#8762

Merged
ErichDonGubler merged 4 commits intogfx-rs:trunkfrom
erichdongubler-mozilla:max_inter_stage_shader_variables-clip_distances
Mar 20, 2026
Merged

Add clip distances validation for maxInterStageShaderVariables#8762
ErichDonGubler merged 4 commits intogfx-rs:trunkfrom
erichdongubler-mozilla:max_inter_stage_shader_variables-clip_distances

Conversation

@ErichDonGubler
Copy link
Copy Markdown
Member

Connections

Testing

New CTS tests have been enabled that cover this functionality, which were previously failing.

Squash or Rebase?

Rebase.

@ErichDonGubler ErichDonGubler force-pushed the max_inter_stage_shader_variables-clip_distances branch 3 times, most recently from 2004d9a to f70488b Compare December 19, 2025 22:22
@ErichDonGubler ErichDonGubler force-pushed the max_inter_stage_shader_variables-clip_distances branch 2 times, most recently from 9a8ea87 to 152fedd Compare December 19, 2025 23:34
@ErichDonGubler ErichDonGubler force-pushed the max_inter_stage_shader_variables-clip_distances branch 7 times, most recently from 6454d73 to 4a816bf Compare December 22, 2025 22:33
ViewIndex,
BaseInstance,
BaseVertex,
ClipDistance { array_size: u32 },
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thoughts on putting array_size: Option<u32> in the naga type rather then duplicating the whole thing?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The Naga type seems like its usage starts for classifying attributes, which only really makes sense as a flat set of unit variants. Naga might want to grow another representation for attributes and all relevant information, but it doesn't currently have that, and that would be strictly more general than what this is trying to accomplish.

CC @jimblandy and/or @teoxoy for thoughts on this, non-blockingly.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It doesn't seem most of the variants are used. There is also quite a bit of overlap with InterStageBuiltIn, which despite the name is used for fragment inputs.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'm going to merge this, but I'm open to taking on a follow-up issue to fix this, if it bothers folks. I wish I felt like I had the bandwidth to make this better. ☹️

@ErichDonGubler ErichDonGubler force-pushed the max_inter_stage_shader_variables-clip_distances branch 2 times, most recently from ca04a30 to 6a58c70 Compare December 23, 2025 21:10
@ErichDonGubler ErichDonGubler force-pushed the max_inter_stage_shader_variables-clip_distances branch 2 times, most recently from 5b49daf to 672262f Compare December 27, 2025 02:40
@ErichDonGubler ErichDonGubler force-pushed the max_inter_stage_shader_variables-clip_distances branch 2 times, most recently from 07c352f to e7966f5 Compare January 5, 2026 23:56
@ErichDonGubler ErichDonGubler marked this pull request as ready for review January 5, 2026 23:58
@ErichDonGubler
Copy link
Copy Markdown
Member Author

The last blocker for merging I haven't figured out yet is GL failures on Linux. CTS appears to believe that limits are wrong, for some reason that I haven't investigated yet.

@inner-daemons
Copy link
Copy Markdown
Collaborator

@ErichDonGubler Can you update this to mention that it closes #6236?

@ErichDonGubler
Copy link
Copy Markdown
Member Author

@inner-daemons: It's not clear to me that this exhausts the scope of shipping a fully spec.-compliant implementation of clip_distances. It's possible, but I haven't taken the time to determine, for instance, if valid operations actually behave the same as in other WebGPU environments.

@ErichDonGubler ErichDonGubler force-pushed the max_inter_stage_shader_variables-clip_distances branch 2 times, most recently from 78801a1 to 1b39f7f Compare February 2, 2026 21:13
@ErichDonGubler ErichDonGubler force-pushed the max_inter_stage_shader_variables-clip_distances branch from 1b39f7f to 20ae76f Compare February 10, 2026 15:05
@ErichDonGubler ErichDonGubler force-pushed the max_inter_stage_shader_variables-clip_distances branch 2 times, most recently from 63dca1e to 1fab12e Compare March 19, 2026 20:45
@ErichDonGubler ErichDonGubler force-pushed the max_inter_stage_shader_variables-clip_distances branch 3 times, most recently from bfa876f to aac68c8 Compare March 19, 2026 22:47
@ErichDonGubler ErichDonGubler force-pushed the max_inter_stage_shader_variables-clip_distances branch from aac68c8 to 05eb6cf Compare March 19, 2026 23:55
@ErichDonGubler ErichDonGubler enabled auto-merge (rebase) March 19, 2026 23:55
@ErichDonGubler ErichDonGubler merged commit 0ca8ba0 into gfx-rs:trunk Mar 20, 2026
59 checks passed
@ErichDonGubler ErichDonGubler deleted the max_inter_stage_shader_variables-clip_distances branch March 20, 2026 00:40
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.

4 participants