Conversation
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Critical batched-encoding correctness issues and a compatibility-breaking API rename remain unresolved.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 7
Open (8)
Repeated merge encodes overwrite per-dispatch configuration · New Repeated color encodes overwrite reusable workspace data · New Workspace reuse causes batched dispatches to read final data · New Repeated merge encodes overwrite per-dispatch configuration · New Batched shade encodes overwrite per-dispatch configuration · New Batched SSAO encodes overwrite reusable configuration · New Repeated color encodes overwrite reusable workspace data · New Removing encode_with_vars breaks source compatibility · New
What changed in this PR
Adds caller-supplied wgpu::CommandEncoder APIs across pixel, voxel, and effects rendering paths.
Changes:
- Adds encoder-based rendering and post-processing methods.
- Refactors existing submit helpers to delegate to encoding APIs.
- Updates crate API documentation.
| File | Summary |
|---|---|
fidget-wgpu/src/voxel/mod.rs |
Adds voxel encoding support; workspace reuse can corrupt batched dispatches, and renaming encode_with_vars introduces an API break. |
fidget-wgpu/src/voxel/effects/mod.rs |
Adds encoder-based voxel effects; reusable workspace configuration is unsafe across batched encodes. |
fidget-wgpu/src/pixel/mod.rs |
Adds pixel encoding support; reused workspaces can cause earlier dispatches to read later data. |
fidget-wgpu/src/pixel/effects/mod.rs |
Adds encoder-based pixel effects; reusable workspace configuration and buffers are unsafe across batched encodes. |
fidget-wgpu/src/lib.rs |
Documents the expanded API layers. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+245
to
+250
| pub fn encode_merge( | ||
| &self, | ||
| image: &FlexBuffer<PixelBufferTag>, | ||
| remove_nans: bool, | ||
| buf: &mut MergeWorkspace, | ||
| encoder: &mut wgpu::CommandEncoder, |
Comment on lines
+401
to
+408
| pub fn encode_color( | ||
| &self, | ||
| merge: &mut MergeWorkspace, | ||
| settings: ColorSettings, | ||
| shape: &ShapeColorBuffers, | ||
| bufs: &mut ColorWorkspace, | ||
| vars: &ShapeVars<f32>, | ||
| encoder: &mut wgpu::CommandEncoder, |
Comment on lines
+1117
to
+1123
| pub fn encode( | ||
| &self, | ||
| shape: &RenderShape, | ||
| vars: &ShapeVars<f32>, | ||
| workspace: &mut Workspace, | ||
| settings: &RenderConfig, | ||
| encoder: &mut wgpu::CommandEncoder, |
Comment on lines
+578
to
+583
| pub fn encode_merge( | ||
| &self, | ||
| image: &FlexBuffer<GeomBufferTag>, | ||
| settings: MergeSettings, | ||
| buf: &mut MergeWorkspace, | ||
| encoder: &mut wgpu::CommandEncoder, |
Comment on lines
+677
to
+682
| pub fn encode_shade( | ||
| &self, | ||
| image: &MergeWorkspace, | ||
| ssao: Option<&SsaoWorkspace>, | ||
| buf: &mut ShadeWorkspace, | ||
| encoder: &mut wgpu::CommandEncoder, |
Comment on lines
+871
to
+875
| pub fn encode_ssao( | ||
| &self, | ||
| image: &MergeWorkspace, | ||
| buf: &mut SsaoWorkspace, | ||
| encoder: &mut wgpu::CommandEncoder, |
Comment on lines
+935
to
+943
| pub fn encode_color( | ||
| &self, | ||
| merge: &MergeWorkspace, | ||
| world_to_model: &nalgebra::Matrix4<f32>, | ||
| shape: &ShapeColorBuffers, | ||
| bufs: &mut ColorWorkspace, | ||
| vars: &ShapeVars<f32>, | ||
| out: &mut ShadeWorkspace, | ||
| encoder: &mut wgpu::CommandEncoder, |
| /// | ||
| /// See [`submit`](Self::submit) for additional details. | ||
| pub fn encode_with_vars( | ||
| pub fn encode( |
Owner
Author
|
The bot has got a point – this makes it hard to chain multiple operations (e.g. merges) which use the same config buffer, because all of the copies will be queued first, then all of the commands will be submitted (using the last data in the config buffer). |
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.


These are a helpful building block for
egui_wgpuintegration on the main thread.