Make downsample.wesl valid WESL - #25744
Merged
alice-i-cecile merged 5 commits intoSep 15, 2026
Merged
Conversation
stuartparmenter
force-pushed
the
mip-gen-alias-shader-def
branch
from
September 10, 2026 21:22
7e5aeab to
bc898eb
Compare
CodingDaniel1
suggested changes
Sep 11, 2026
CodingDaniel1
left a comment
Contributor
There was a problem hiding this comment.
I have also found discrepencies related to pipeline creation (light_probe) against other areas in bevy (clustering, binning). But thats outside the scope of this PR. Which could be follow up work.
Overall this pr is good imo. Except the weird naming pre-existed.
…tion.md Co-authored-by: Benjamin Brienen <benjamin.brienen@outlook.com>
JMS55
reviewed
Sep 13, 2026
JMS55
approved these changes
Sep 13, 2026
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.
Objective
Fixes #25733. We were doing a find-and-replace on
##TEXTURE_FORMAT##indownsample.weslat runtime, which meant the file was never valid WESL.Solution
@if(TEXTURE_FORMAT_*)block per supported format, andARRAY_TEXTUREpicks the 2D or array variant.DownsampleShaders::generalis now a singleHandle<Shader>, specialized lazily by the pipeline cache instead of 40 shader assets created at startup.DownsamplePipelineresource andSpecializedComputePipelines<DownsamplePipeline>, like the other compute pipelines. The light probe generator uses it instead of its own copy of the layouts and defs.FIRST_PASSandSECOND_PASSshader defs toSPLIT_BIND_GROUP_FIRSTandSPLIT_BIND_GROUP_SECOND, since exactly one of those andCOMBINE_BIND_GROUPis set.I don't love the boilerplate in this approach, but don't see a better solution. I did prototype a working
constants::version too, but rejected it since it seems like we're generally trying to move away from them.Testing
dynamic_mip_generationandreflection_probesrender correctly.Used Claude Code & Fable 5.1 to help explore various ways to do this, build tests to see what naga supports and what wesl supports (and what they disagree on) to try various approaches, then to build out multiple approaches, which I then reviewed, settled on this one, validated questions I had, cleaned up PR a bit, then wrote migration guide and here we are.