Repository navigation
Add @interpolate(flat) to integer varyings in test shaders - #841
Merged
Merged
Conversation
<details><summary>Claude's draft</summary> The WGSL spec requires user-defined vertex outputs and fragment inputs of integer type to have @interpolate(flat). Naga accepts them without it, but Tint (Dawn, Chrome) rejects the shader: integral user-defined vertex outputs must have a '@interpolate(flat)' attribute Add the attribute to the shaders in test_set_override.py, test_wgpu_native_query_set.py, test_set_immediates.py and test_wgpu_vertex_instance.py. This does not change behaviour with wgpu-native: integer varyings are never interpolated anyway. Found by recording all WGSL that the test suite passes to create_shader_module() and compiling it with Dawn. The other shaders that Tint rejects are intentionally invalid (test_wgpu_native_errors.py), or use a wgpu-native specific feature (arrays in the immediate address space in test_bad_set_immediates). Resume this Claude session: ``` cd /home/mark/git/feedstock/staged-recipes claude --resume 2cab6db9-a6ea-4976-a0e6-f4153fe5a651 ``` </details> Claude-Session: https://claude.ai/code/session_01QMLpZTQYYCu2K7EaWNnkEG
This was referenced Oct 1, 2026
almarklein
approved these changes
Oct 1, 2026
Member
|
@hmaarrfk this is still marked as draft, do you plan to add more? |
Contributor
Author
|
I haven't really read any of this. But in general. No I think the point was to improve the state of the art toward best syntax. |
hmaarrfk
marked this pull request as ready for review
October 1, 2026 10:14
Contributor
Author
|
LGTM now |
Contributor
Author
|
thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
LGTM
Adds a few small things to help make the WGSL valid
claude
Some test shaders are accepted by naga but are invalid WGSL: user-defined vertex outputs (and the matching fragment inputs) of integer type must be
@interpolate(flat)(spec). Tint (Dawn's and Chrome's WGSL compiler) rejects them when the shader module is created:This adds
@interpolate(flat)to the integer varyings in:tests/test_set_override.py(values: vec4u)tests/test_wgpu_native_query_set.py(index: u32)tests/test_set_immediates.py(index: u32,value: u32)tests/test_wgpu_vertex_instance.py(info: vec2u)Integer varyings are never interpolated, so this only makes it explicit; it does not change behaviour with wgpu-native. Test results with wgpu-native for these four files are the same before and after this change.
How these were found: all WGSL that the test suite passes to
create_shader_module()(with wgpu-native) was recorded and compiled with Dawn. The remaining shaders that Tint rejects are intentionally invalid (test_wgpu_native_errors.py), or use a wgpu-native specific feature (an array in theimmediateaddress space intest_bad_set_immediates), so they are left as is.Same kind of fix as pygfx/pygfx#1329. Related: #839 (a Dawn backend), which runs these tests against Dawn.
https://claude.ai/code/session_01QMLpZTQYYCu2K7EaWNnkEG