Repository navigation
A scene's features as FEAT bits: vertex colours, grids, instance colours, unlit, background - #80
Merged
Merged
Conversation
…urs, unlit, background They were @if flags, each combination another kernel source. Now they are FEAT bits (the pipeline-overridable constant the other features use); their bindings and fields are always declared, OBJECT_STRIDE is an override from F_TINT. Only units still change the source (10 flags, was 15). Checks: cargo test --release guarded, 138 passed; render-identity against main (native, merged, uniform tables; guarded and not): 0 of 190 changed; web-hello passes; Bistro's trace the same natively and merged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
yujiaxu-ops
added a commit
that referenced
this pull request
Nov 14, 2026
scene.rs named `tinted_source`, removed by #80. The particle shaders said their objects never have instance colours; gpu.rs writes a stride of 4 into them for such scenes. Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
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.
Vertex colours, density grids, instance colours, unlit materials and the background used to be
@ifflags, so every combination of them produced a different kernel source. They are now bits ofFEAT, the pipeline-overridable constant that the other scene features already use.OBJECT_STRIDEis an override derived fromF_TINT. A test runs naga's override processing to check it.Checks
cargo test --releasewith the loop guard: 138 passed.render-identity against main, 190 outputs each:
web-hello in Chrome: pass.
Bistro trace time, alternating with main in both orders:
🤖 Generated with Claude Code
Note
Medium Risk
Changes how scene capability is compiled and how
FEAT/OBJECT_STRIDEare resolved at pipeline creation, but identity/render checks reported unchanged output; mistakes could still affect binding layout or stride for tinted scenes.Overview
Collapses five scene-specific WESL
@ifkernel variants into one source by representing vertex colours, density grids, instance colours, unlit materials, andscene.backgroundas newFEATbits (F_TINT,F_VCOLOR,F_GRID,F_UNLIT,F_BACKGROUND), matching how other optional features already work.The shader always declares the related bindings and struct fields (
grid_tex,Params.background,vcolor/vgrid/obj_tint, etc.) and gates behavior at runtime withhas(F_*)instead of stripping declarations per variant.OBJECT_STRIDEis now a pipeline override (select(3u, 4u, … F_TINT)); Rust no longer treats tint/vcolor/grid/unlit/background asKernelVariant::flagsorF_SOURCE—onlyunitsstill changes the compiled source (F_SOURCE=F_UNITS), cutting conditional-translation flags from 15 to 10.Tests and docs were updated:
scene_features_are_feat_bitsasserts identical WGSL for those feature bitmasks and validates naga override resolution forOBJECT_STRIDE;ROADMAP.md/RUNTIME.mddescribe the new model.Reviewed by Cursor Bugbot for commit 4cd5e2c. Bugbot is set up for automated code reviews on this repo. Configure here.