Skip to content

fix(mesh-layers): SimpleMeshLayer matrix constant - #10543

Merged
Pessimistress merged 1 commit into
masterfrom
x/constant-attribute
Aug 10, 2026
Merged

Pessimistress merged 1 commit into
masterfrom
x/constant-attribute

Conversation

@Pessimistress

Copy link
Copy Markdown
Collaborator

Background

In WebGPU, a single-instance SimpleMeshLayer could render nothing when its transform was constant. The attribute updater replaced the allocated CPU array with the constant transform, but the caching logic mistook that value for an already-uploaded GPU buffer and skipped the actual upload. Consequently, the mesh had no valid transform data. This affected the flat- and smooth-shaded mesh tests, TerrainLayer, and another lighting test using a single mesh instance. The fix clears the stale cached value before materializing the WebGPU buffer, with a regression test verifying the transform is uploaded.

Change List

  • Clear updater-populated attribute.value before calling setConstantValue
  • Tests

@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 84.084% (-0.006%) from 84.09% — x/constant-attribute into master

@ibgreen-openai ibgreen-openai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Does this mean WebGPU layers with constants may do a lot of unnecessary attribute updates?

@Pessimistress

Copy link
Copy Markdown
Collaborator Author

@ibgreen-openai This code path is only hit when a layer's updater function directly assigns attribute.value. Updater will not be triggered unless the attribute is invalidated.

@Pessimistress
Pessimistress merged commit bb0fa21 into master Aug 10, 2026
5 checks passed
@Pessimistress
Pessimistress deleted the x/constant-attribute branch August 10, 2026 23:24
@chrisgervang chrisgervang added this to the v9.4 milestone Aug 11, 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.

4 participants