-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add multiview limits and tests #8206
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
base: trunk
Are you sure you want to change the base?
Add multiview limits and tests #8206
Conversation
@cwfitzgerald I left a comment about this in matrix but it got hidden by newer messages. Is it a bad idea to add another multi view related field to a render pass descriptor? This might be a topic worth bringing up in a meeting, I'm not sure. I'm just hesitant to assume that's fine because if I'm wrong then I will have refactored every use of render passes in this entire repo :) Not urgent of course EDIT: This has been answered |
…ue to bitmask limitation
…amples multiview fields
…ure gets 255 no matter what.
@cwfitzgerald Can you request a review from copilot? (lol) |
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.
Pull Request Overview
This PR adds comprehensive multiview support and testing to wgpu, enabling rendering to multiple views in a single render pass. The changes introduce a new multiview_mask
field to RenderPassDescriptor
, add support for additional backends (Metal, DX12), update limits validation, and add comprehensive testing.
Key changes:
- Added
multiview_mask
field toRenderPassDescriptor
for selecting view layers to render to - Implemented multiview support in Metal and DX12 backends
- Updated multiview limits structure and validation logic
- Changed
@builtin(view_index)
type requirement fromi32
tou32
in shader code
Reviewed Changes
Copilot reviewed 93 out of 100 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
wgpu/src/api/render_pass.rs | Added multiview_mask field to RenderPassDescriptor |
wgpu-types/src/lib.rs | Updated multiview-related limits fields and documentation |
wgpu-hal/src/*/mod.rs | Backend implementations for multiview support across Metal, Vulkan, DX12 |
wgpu-core/src/command/render.rs | Added multiview validation and limit checking |
tests/tests/wgpu-gpu/multiview.rs | Added comprehensive multiview testing |
naga/src/ | Updated shader validation to require u32 for view_index builtin |
examples/ | Updated all examples to include multiview_mask: None |
Comments suppressed due to low confidence (5)
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
@cwfitzgerald Is it just me or did it not leave any comments and not do anything? Lmfao |
Holy shit I'm actually fucking stupid In neither of 2 code paths did multiview actually get passed down to wgpu-hal 🤦. I fixed one by copilot randomly stumbling upon it and the resulting validation errors from incompatible render passes did the rest. Not sure how I would've found that without the wonderful validation layers. Anyway dx12 and metal are still completely broken. Also I nominate Metal for giving the funniest results from nonsensical inputs |
That's amazing :) |
Connections
Addresses #7196 and #8138
Description
Adds new limits and testing for multiview, add support for more backends (also in naga), add new multiview bitmask renderpass descriptor field for selecting which layers to render to in a single pass.
Marking as open because its had progress made and I think this is about what it will look like when complete, even though its completely broken at the moment. Also because I want to get it in the pipeline sooner rather than later. Just the following remaining.
TODO:
Testing
There are tests
Squash or Rebase?
Squash
Checklist
cargo fmt
.taplo format
.cargo clippy --tests
. If applicable, add:--target wasm32-unknown-unknown
cargo xtask test
to run tests.CHANGELOG.md
entry.