Skip to content

UniformsGroup: Fix incorrect index in Vector4 dirty check#33276

Merged
Mugen87 merged 1 commit into
mrdoob:devfrom
Mridul012:fix-uniformsgroup-vector4-index
Mar 28, 2026
Merged

UniformsGroup: Fix incorrect index in Vector4 dirty check#33276
Mugen87 merged 1 commit into
mrdoob:devfrom
Mridul012:fix-uniformsgroup-vector4-index

Conversation

@Mridul012

Copy link
Copy Markdown

Summary

Fixes an incorrect index used in the dirty check of UniformsGroup.updateVector4.


Problem

The current implementation compares the w component using an incorrect offset:

a[ offset + 4 ] !== v.w

However, the corresponding write uses:

a[ offset + 3 ] = v.w

This mismatch causes the dirty check to read from the wrong position.


Impact

When only the w component changes:

  • The dirty check may incorrectly pass
  • The value is not updated
  • Results in stale data being used during rendering

Fix

Correct the index used in the comparison:

a[ offset + 3 ] !== v.w

Notes

  • Minimal fix (1 character change)
  • No impact on bundle size
  • Fixes a silent rendering issue

@github-actions

Copy link
Copy Markdown

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 360.01
85.46
360.01
85.46
+0 B
+0 B
WebGPU 633.38
175.63
633.38
175.63
+0 B
-1 B
WebGPU Nodes 631.5
175.34
631.5
175.33
+0 B
-1 B

🌳 Bundle size after tree-shaking

Minimal build including a renderer, camera, empty scene, and dependencies.

Before After Diff
WebGL 492.21
120.03
492.21
120.03
+0 B
+0 B
WebGPU 705.41
190.51
705.41
190.51
+0 B
-1 B
WebGPU Nodes 654.63
177.77
654.63
177.77
+0 B
-1 B

@Mugen87 Mugen87 merged commit 2baf31e into mrdoob:dev Mar 28, 2026
10 checks passed
@Mugen87 Mugen87 added this to the r184 milestone Mar 28, 2026
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