Repository navigation
Validate mesh draws in render bundles against the multiview mask - #10496
Conversation
4d01ebe to
023c639
Compare
|
Can you clarify whether you wrote the code in the PR, wrote the description, gave the code a cursory glance, etc? |
|
Yep, the code and description are mine. I used Claude Code to sanity-check edge cases and tighten the writeup. Happy to walk through any part of the diff :) |
|
Do you also use Claude to write your GitHub comments? |
|
Yeah, fair question. I use it to draft a lot of my comments and to review the ones I write myself, including some here. The debugging and testing are mine, though, and I'm happy to go through any part of the diff so you can see where I'm at. If you'd prefer I write comments myself on this repo, I can do that. |
|
@apollo-2006 I feel like you would appear a lot more respectful and be received a lot better if you wrote your comments yourself. In open source we are currently being flooded with low effort contributions. If you submit code that could be seen as likely AI generated, and don't even go to the effort to write your own comments or github descriptions, there just isn't any indication that a human has put in any effort which feels crappy. I could pull up claude myself if thats what I wanted. |
|
That's honestly a fair point, and I agree. Will keep note of that going forward, appreciate you showing me that perspective. |
inner-daemons
left a comment
There was a problem hiding this comment.
LGTM as far as being an improvement. I haven't checked that all necessary multiview validation logic is being run on render bundles.
Render passes check mesh draws against the pass's multiview mask with validate_mesh_draw_multiview, but render bundles had no equivalent, since the function took the render pass State. Move the check to draw.rs, taking the device and the multiview mask, and call it from both render passes and render bundles. Fixes gfx-rs#9872
validate_mesh_draw_multiview compared the index of the highest view in
the multiview mask against max_mesh_multiview_view_count with `>`:
highest_bit > device.limits.max_mesh_multiview_view_count
The index is zero-based and the limit is a count, so a mask whose
highest view is equal to the limit (one view too many) was accepted.
Vulkan requires the highest bit to be less than
maxMeshMultiviewViewCount, and render pass creation already compares
the multiview mask against the attachment layer count with `>=`.
Use `>=`, and name the right limit in the error message.
023c639 to
5af5cc5
Compare
|
@Mergifyio queue |
Connections
Fixes #9872.
Description
Render passes check mesh draws against the multiview mask with
validate_mesh_draw_multiview, but render bundles don't, because the function took the render-passState, and bundles use a differentStatestruct (#8051). The first commit moves it todraw.rsso it takes the device and the mask, and calls it from passes and from bundles (draw_mesh_tasks, andmulti_draw_indirectfor the mesh family). Bundles can't record mesh draws yet, and the player doesn't replay traced bundles, so this part is groundwork without a test of its own.While testing I found an off-by-one: the check compared the zero-based index of the highest view against
max_mesh_multiview_view_countwith>, so with a limit of 2, the mask0b111(views 0 to 2) was accepted. The second commit switches to>=, which matchesVUID-VkGraphicsPipelineCreateInfo-renderPass-12325/12326and the attachment check wgpu already has inrender.rs. It also fixes the error message, which said<=and namedmax_multiview_view_count.Happy to adjust the helper's signature or move the tests if you'd prefer a different shape.
Testing
New validation tests in
tests/wgpu-validation/api/mesh_shader.rs, on the noop device:EXPERIMENTAL_MESH_SHADER_MULTIVIEW: rejectedcargo test -p wgpu-test --test wgpu-validationpasses at each commit (106, then 108), and clippy is clean.cargo xtask test meshpasses 45/45 on an RX 9070 XT (RADV).The full
cargo xtask testalso passes on the same machine (RADV and radeonsi GL), exceptclear_texture_uncompressedon GL, which is marked as expected to fail there but passes on this driver. Happy to open an issue for that if it's useful.Squash or Rebase?
Rebase: the two commits are separate changes, and each one passes on its own.
LLM Use?
Claude was used to review a final pass over the code and the PR body.
Checklist
CHANGELOG.mdentries for the user-facing effects of this change are present.wgpumay be affected behaviorally.