Skip to content

vello_sparse_shaders: Flatten fragment shader arguments#1620

Merged
LaurenzV merged 2 commits into
mainfrom
laurenz/flatten_shaders
May 20, 2026
Merged

vello_sparse_shaders: Flatten fragment shader arguments#1620
LaurenzV merged 2 commits into
mainfrom
laurenz/flatten_shaders

Conversation

@LaurenzV
Copy link
Copy Markdown
Collaborator

@LaurenzV LaurenzV commented May 4, 2026

This is a continuation to #1619 and builds on top of it. With this PR in place, Vello Hybrid runs on Google Pixel 5 and Redmi Note 11 without any problems!

@LaurenzV LaurenzV requested a review from grebmeg May 4, 2026 08:30
@laurenz-canva laurenz-canva force-pushed the laurenz/remove_structs branch from 743b8cd to 1cdb7c0 Compare May 5, 2026 13:39
@laurenz-canva laurenz-canva force-pushed the laurenz/flatten_shaders branch 2 times, most recently from 4552815 to bf7590f Compare May 5, 2026 13:42
@laurenz-canva laurenz-canva force-pushed the laurenz/remove_structs branch from 1cdb7c0 to d3413f8 Compare May 6, 2026 09:02
@laurenz-canva laurenz-canva force-pushed the laurenz/flatten_shaders branch from bf7590f to 07ef807 Compare May 6, 2026 09:14
Copy link
Copy Markdown
Collaborator

@grebmeg grebmeg left a comment

Choose a reason for hiding this comment

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

I guess this is also causing buggy behaviour in older Adreno drivers? Could you please share a bit more detail about the issue and include it in the file-level doc? Actually, I just realised that since we have two gwsl shaders, it might make more sense to create an additional README file with descriptions of those bugs.

Comment thread sparse_strips/vello_sparse_shaders/shaders/filters.wgsl
Base automatically changed from laurenz/remove_structs to main May 20, 2026 07:06
@laurenz-canva laurenz-canva force-pushed the laurenz/flatten_shaders branch from 07ef807 to 4c5c9ac Compare May 20, 2026 07:17
@LaurenzV LaurenzV added this pull request to the merge queue May 20, 2026
Merged via the queue into main with commit f1da2a2 May 20, 2026
33 of 34 checks passed
@LaurenzV LaurenzV deleted the laurenz/flatten_shaders branch May 20, 2026 11:46
LaurenzV pushed a commit to LaurenzV/vello that referenced this pull request May 22, 2026
…inebender#1659)

Drafted as a follow-up to [this
comment](linebender#1619 (comment)).

Some old Adreno GPU drivers silently downgrades the precision of struct
values in fragment shaders to 16 bits, regardless of the precision the
shader requested. The last few commits flattened the existing fragment
shaders to dodge the bug; this commit prevents the workaround from
silently regressing.

`assert_no_structs_in_fragment_shader` parses the WGSL with naga, walks
the call graph reachable from the `@fragment` entry point, and rejects
any function argument, return value, local variable, `Compose`, or
`ZeroValue` of struct type. Struct-typed uniform globals and vertex IO
structs are unaffected because their fields are only ever read as
scalars/vectors inside the fragment shader.

The lint runs both at build time (from `compile_wgsl_shader`, which the
build script invokes for every shipped WGSL) and as a unit test
(`every_shipped_shader_passes_the_lint`) that runs in CI.

See linebender#1604 linebender#1619 linebender#1620 for context.

Generated with AI assistance.
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.

2 participants