Skip to content

Make ShapeColorBuffer not pixel/voxel-specific - #469

Merged
mkeeter merged 1 commit into
mainfrom
less-specific-shape-color-buffer
Sep 1, 2026
Merged

Make ShapeColorBuffer not pixel/voxel-specific#469
mkeeter merged 1 commit into
mainfrom
less-specific-shape-color-buffer

Conversation

@mkeeter

@mkeeter mkeeter commented Sep 1, 2026

Copy link
Copy Markdown
Owner

It's convenient to construct a single ShapeColorBuffers object 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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 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 ShapeColorBuffers construction from pixel/voxel effects contexts to a new top-level Gpu::color_buffers API.
  • 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.

Comment thread fidget-wgpu/src/lib.rs Outdated
@mkeeter
mkeeter force-pushed the less-specific-shape-color-buffer branch from 9a06399 to 5d1daca Compare September 1, 2026 17:39
@mkeeter
mkeeter force-pushed the less-specific-shape-color-buffer branch from 5d1daca to 047ffdc Compare September 1, 2026 17:39
@mkeeter
mkeeter enabled auto-merge (squash) September 1, 2026 17:39
@mkeeter
mkeeter merged commit cc84727 into main Sep 1, 2026
14 checks passed
@mkeeter
mkeeter deleted the less-specific-shape-color-buffer branch September 1, 2026 17:43
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