Skip to content

WebGPU: Make the material buffer helpers ShadingModel methods - #936

Merged
gkjohnson merged 4 commits into
mainfrom
webgpu/material-helpers
Nov 5, 2026
Merged

gkjohnson merged 4 commits into
mainfrom
webgpu/material-helpers

Conversation

@gkjohnson

@gkjohnson gkjohnson commented Nov 5, 2026 •

Copy link
Copy Markdown
Owner

Moves the helpers used to write the materials buffer out of writeMaterialsBuffer and onto ShadingModel, so subclasses can reuse them when writing their own material structs:

  • getTextureDescriptor( material, key ): the packed "*Map" texture field, previously the local getTexture. It adds the texture to the shading model's textures list, which updateMaterials clears before writing the materials.
  • getField( material, key, default )
  • writeTextureMatrixToArray( material, textureKey, array, offset )

writeMaterialsBuffer now returns only { materialData }, since the textures are tracked on the shading model.

🤖 Generated with Claude Code

gkjohnson and others added 4 commits November 5, 2026 13:06
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… only the material and key

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gkjohnson
gkjohnson merged commit 7b6a171 into main Nov 5, 2026
4 checks passed
@gkjohnson
gkjohnson deleted the webgpu/material-helpers branch November 5, 2026 04:27
@gkjohnson gkjohnson added this to the v0.0.29 milestone Nov 5, 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.

1 participant