-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Gizmo joint rendering in webgpu #14721
Fix Gizmo joint rendering in webgpu #14721
Conversation
@alice-i-cecile looks like @irate-devil has no GitHub activity over the last month and change... Maybe choose a different reviewer? |
Yep, I'll ask another couple of folks :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Absolutely cannot figure out how to reproduce, but was able to trigger a crash while testing:
wgpu error: Validation Error
Caused by:
In a RenderPass
note: encoder = `<CommandBuffer-(34962, 1, Metal)>`
In a draw command, indexed:false indirect:false
note: render pipeline = `LineGizmo Pipeline`
Instance 16 extends beyond limit 15 imposed by the buffer in slot 3. Did you bind the correct `Instance` step-rate vertex buffer?
Was also able to trigger in the 2d example:
|
The examples work fine, still can't figure out how I produced those crashes. If no one else can repro I'll approve with the note that there might be some kind of racy bug we should keep an eye out for. |
I wonder why it's LineGizmo pipeline and not LineJointGizmo pipeline, but evidently triggered by enabling joints. |
The same underlying buffer is used as vertex buffer with the same offset but different sizes from two draw functions. TrackedRenderPass::set_vertex_buffer wrongly assumes vertex buffer need not be updated in this case. (#14841) I've added system ordering so that lines (draw function for lines uses larger size) are always drawn first to workaround vertex buffer not updated. This should fix the occasional validation error. Can you confirm? |
Thanks for tracking that down. I'm not able to reproduce here, but it sounds like we're more confident in the underlying issue, which can be a follow up. Approving. |
# Objective - Fixes #14841 ## Solution - Compute BufferSlice size manually and use it for comparison in `TrackedRenderPass` ## Testing - Gizmo example does not crash with #14721 (without system ordering), and `slice` computes correct size there --- ## Migration Guide - `TrackedRenderPass::set_vertex_buffer` function has been modified to update vertex buffers when the same buffer with the same offset is provided, but its size has changed. Some existing code may rely on the previous behavior, which did not update the vertex buffer in this scenario. --------- Co-authored-by: Zachary Harrold <zac@harrold.com.au>
# Objective - Gizmo rendering on WebGPU has been fixed by #14653, but gizmo joints still cause error (#14696 (comment)) when enabled. ## Solution - Applies the same fix as #14653 to Gizmo joints. I'm noob and just copied their solution, please correct me if I did something wrong. ## Testing - Tested 2d-gizmos and 3d-gizmos examples in WebGPU on Chrome. No rendering errors, and the gizmo joints are apparently rendered ok.
Objective
Solution
I'm noob and just copied their solution, please correct me if I did something wrong.
Testing