refactor(lit): align WGSL and GLSL clustered-light chunks#8740
Merged
Conversation
Follow-up to #8733. Brings the GLSL clustered-light chunk in line with the WGSL refactor, applies the Samsung-precision workaround to WGSL that was previously only in GLSL, and tightens decoder helper signatures. WGSL changes: - ClusterLightData slimmed: flags / anglesData / colorBFlagsData moved to module-scope temporaries (Samsung precision issue, #7800). - ClusterLightData members reordered so each vec3f packs with an adjacent 4-byte field into a 16-byte slot. - decodeClusterLightProjectionMatrixData returns mat4x4f instead of mutating a module global as a side effect. - decode helpers tightened to take only what they need (lightIndex: i32 / biasesData: f32 / no args). - One-line comments on ClusterLightSpotData / AreaData / ShadowData. - Removed four obsolete dev comments from the original WGSL port. GLSL changes: - Same struct slim-down, member reorder, and three new sub-structs. - decode helpers changed from inout-mutating to value-returning, taking int lightIndex / float biasesData / no args. - decodeClusterLightCore returns ClusterLightData by value. - sampleLightTextureF takes (int lightIndex, int index) for symmetry with WGSL. No public API changes. The two backends now have near line-for-line equivalent structures, easing cross-backend maintenance.
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.
Follow-up to #8733. Brings the GLSL clustered-light chunk in line with the WGSL refactor, applies the Samsung-precision workaround to WGSL that was previously only in GLSL, and tightens decoder helper signatures.
WGSL changes (`src/scene/shader-lib/wgsl/chunks/lit/frag/clusteredLight.js`):
GLSL changes (`src/scene/shader-lib/glsl/chunks/lit/frag/clusteredLight.js`):
No public API changes. All changes are internal to the lit clustered-light shader chunks. The two backends now have near line-for-line equivalent structures, which makes cross-backend maintenance easier going forward.