Make ShapeColorBuffer not pixel/voxel-specific - #469
Merged
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The refactor is cohesive and the shader/host layout invariants are guarded by dedicated layout/size tests in both pixel and voxel paths.
Pull request overview
This PR refactors ShapeColorBuffers so a single buffer instance can be reused across both pixel and voxel color evaluation paths by standardizing the size of the “config header” region that precedes the tape data.
Changes:
- Move
ShapeColorBuffersconstruction from pixel/voxel effects contexts to a new top-levelGpu::color_buffersAPI. - Remove the
ShapeColorBuffers<C>generic parameter and standardize the config-header size used when packing config + tape data. - Update the pixel color config padding (Rust + WGSL) and add tests to ensure pixel/voxel config header sizes match.
File summaries
| File | Description |
|---|---|
| fidget-wgpu/src/voxel/mod.rs | Update tests to construct ShapeColorBuffers via Gpu. |
| fidget-wgpu/src/voxel/effects/mod.rs | Remove context-local color_buffers, switch APIs to &ShapeColorBuffers, and add config-size test. |
| fidget-wgpu/src/pixel/mod.rs | Update tests to construct ShapeColorBuffers via Gpu. |
| fidget-wgpu/src/pixel/effects/shaders/color.wgsl | Adjust config padding in WGSL to keep tape-data offset consistent with shared buffer layout. |
| fidget-wgpu/src/pixel/effects/mod.rs | Remove context-local color_buffers, switch APIs to &ShapeColorBuffers, update ColorConfig padding, and add config-size/layout tests. |
| fidget-wgpu/src/lib.rs | Add Gpu::color_buffers, make ShapeColorBuffers non-generic, and centralize expected config-header sizing. |
| CHANGELOG.md | Document the API move for ShapeColorBuffers construction. |
Review details
- Files reviewed: 7/7 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
mkeeter
force-pushed
the
less-specific-shape-color-buffer
branch
from
September 1, 2026 17:39
9a06399 to
5d1daca
Compare
mkeeter
force-pushed
the
less-specific-shape-color-buffer
branch
from
September 1, 2026 17:39
5d1daca to
047ffdc
Compare
mkeeter
enabled auto-merge (squash)
September 1, 2026 17:39
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.
It's convenient to construct a single
ShapeColorBuffersobject and use it for both pixel and voxel evaluation; we'll just make sure the config region at the start is large enough for both.