Skip to content

Conversation

SupaMaggie70Incorporated
Copy link
Collaborator

@SupaMaggie70Incorporated SupaMaggie70Incorporated commented Sep 10, 2025

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:

  • Currently it WORKS ON VULKAN (HOORAY!)
  • Currently the implementation is completely broken on Metal and DX12
    • On my Macbook, it for some reason sets all texture bytes to 255 outside of the first pass?
    • On every other platform, including MacOS CI, it zeroes the texture
  • Make DX12 backend check for dxc with support for SM6.1+

Testing
There are tests

Squash or Rebase?
Squash

Checklist

  • Run cargo fmt.
  • Run taplo format.
  • Run cargo clippy --tests. If applicable, add:
    • --target wasm32-unknown-unknown
  • Run cargo xtask test to run tests.
  • If this contains user-facing changes, add a CHANGELOG.md entry.

@SupaMaggie70Incorporated SupaMaggie70Incorporated marked this pull request as ready for review September 10, 2025 20:10
@SupaMaggie70Incorporated SupaMaggie70Incorporated marked this pull request as draft September 11, 2025 18:38
@SupaMaggie70Incorporated SupaMaggie70Incorporated requested review from cwfitzgerald and removed request for cwfitzgerald September 11, 2025 18:38
@SupaMaggie70Incorporated
Copy link
Collaborator Author

SupaMaggie70Incorporated commented Sep 12, 2025

@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

@SupaMaggie70Incorporated SupaMaggie70Incorporated marked this pull request as draft September 23, 2025 00:59
@SupaMaggie70Incorporated SupaMaggie70Incorporated marked this pull request as ready for review September 24, 2025 05:30
@SupaMaggie70Incorporated
Copy link
Collaborator Author

@cwfitzgerald Can you request a review from copilot? (lol)
I wanna see if it can quickly find what I can't

@cwfitzgerald cwfitzgerald requested a review from Copilot October 1, 2025 18:28
Copy link
Contributor

@Copilot Copilot AI left a 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 to RenderPassDescriptor 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 from i32 to u32 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.

@SupaMaggie70Incorporated
Copy link
Collaborator Author

@cwfitzgerald Is it just me or did it not leave any comments and not do anything? Lmfao

@SupaMaggie70Incorporated
Copy link
Collaborator Author

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

@cwfitzgerald
Copy link
Member

That's amazing :)

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.

3 participants