Skip to content
Merged
Show file tree
Hide file tree
Changes from 98 commits
Commits
Show all changes
109 commits
Select commit Hold shift + click to select a range
375cf49
Exposed new limits for multiview
inner-daemons Sep 10, 2025
88fcb2f
Added multiview view count checks
inner-daemons Sep 10, 2025
9e20b55
Added check for instance limit
inner-daemons Sep 10, 2025
f8ab779
Added multiview test
inner-daemons Sep 10, 2025
56f8fc1
Fixed various compile issues
inner-daemons Sep 10, 2025
c103f42
Updated multiview test (idk what I'm doing)
inner-daemons Sep 10, 2025
06ce95c
Updated test again
inner-daemons Sep 10, 2025
d456310
Fixed shader hopefully
inner-daemons Sep 10, 2025
de5b1be
Added some of the functionality to dx12
inner-daemons Sep 11, 2025
263aa77
Added multiview mask parameter (didn't update all code to use this pa…
inner-daemons Sep 11, 2025
eca707f
Added multiview to HLSL writer
inner-daemons Sep 11, 2025
84334ba
Merge branch 'trunk' into multiview-tests-limits
inner-daemons Sep 15, 2025
1860e5f
Other merge commit
inner-daemons Sep 15, 2025
ac82457
Added changelog entry which assumes the view bitmask is allowed
inner-daemons Sep 15, 2025
3083f16
Merge branch 'trunk' into multiview-tests-limits
inner-daemons Sep 19, 2025
424f31e
Updated changelog
inner-daemons Sep 22, 2025
f933d2c
Exposed feature on metal, commented dx12, restricted vulkan to <=64 d…
inner-daemons Sep 22, 2025
13b012f
Updated multiview for metal
inner-daemons Sep 22, 2025
0cff8c5
Added view index thing to msl writer
inner-daemons Sep 22, 2025
bf9775a
Finalized MSL writer changes
inner-daemons Sep 22, 2025
4ba4759
Removed nonsense multiview mask from boids example, fixed wgpu-hal ex…
inner-daemons Sep 22, 2025
863283f
Mopped up miscellaneous crates, going to work on tests & examples now
inner-daemons Sep 22, 2025
ccec13b
Fixed examples
inner-daemons Sep 22, 2025
c6da54a
Fixed every test
inner-daemons Sep 22, 2025
e465389
Updated changelog entry
inner-daemons Sep 22, 2025
30438b3
Made multiview use 32bit integer
inner-daemons Sep 22, 2025
2a29de8
Merge branch 'trunk' into multiview-tests-limits
inner-daemons Sep 22, 2025
f20eaac
Made the default multiview mask 0
inner-daemons Sep 22, 2025
1528421
Fixed snapshots, final changelog update hopefully
inner-daemons Sep 22, 2025
81b681f
Reformatted multiview.toml
inner-daemons Sep 22, 2025
b04c75b
Fixed GLSL writer
inner-daemons Sep 22, 2025
d0ab6d4
Attempted to fix temporarily the HLSL stuff
inner-daemons Sep 22, 2025
63ce399
Made HLSL writer throw error if shader model is unsupported
inner-daemons Sep 22, 2025
11203bb
Fixed webgl writing
inner-daemons Sep 22, 2025
dbe1400
Fixed typos and hopefully also glsl (non-webgl) validation
inner-daemons Sep 22, 2025
7f8542d
Actually updated fixed snapshots
inner-daemons Sep 22, 2025
7d66fec
I think we're doing illegal shit in metal and somehow the second text…
inner-daemons Sep 23, 2025
5e3e662
Fixed illegal behavior in shader that naga currently allows
inner-daemons Sep 23, 2025
69120f3
Merge branch 'trunk' into multiview-tests-limits
inner-daemons Oct 1, 2025
f612d0f
Fixed compiles
inner-daemons Oct 1, 2025
988bc37
Tried to fix windows compiles
inner-daemons Oct 1, 2025
bd696d4
Updated multiview test to provide more information
inner-daemons Oct 1, 2025
15da620
ChatGPT thinks it fixed the vulkan backend (lets see!)
inner-daemons Oct 1, 2025
27035dd
ChatGPT also failed to fix metal backend lmao
inner-daemons Oct 1, 2025
e8b7452
Undid fake fix for metal
inner-daemons Oct 1, 2025
b4ce29b
Tried to fix again (still broken on metal but maybe this'll fix vulka…
inner-daemons Oct 1, 2025
a799a24
I'm not having fun :(
inner-daemons Oct 1, 2025
35536f9
Merge remote-tracking branch 'upstream/trunk' into multiview-tests-li…
inner-daemons Oct 2, 2025
9093910
Updated test to rely on new poll syntax
inner-daemons Oct 2, 2025
5a2ed97
Merge remote-tracking branch 'upstream/trunk' into multiview-tests-li…
inner-daemons Oct 8, 2025
5db19aa
Added multiview test
inner-daemons Oct 10, 2025
45b5a9d
Made it start on the second image for debugging reasons
inner-daemons Oct 10, 2025
3706ab5
Changed clear color, documented something in metal backend
inner-daemons Oct 11, 2025
ad03c55
This is incredibly confusing
inner-daemons Oct 11, 2025
78370af
I'm giving up on metal for now
inner-daemons Oct 11, 2025
dfc4e3a
Merge remote-tracking branch 'upstream/trunk' into multiview-tests-li…
inner-daemons Oct 11, 2025
78fb4f7
Removed the instance limit
inner-daemons Oct 11, 2025
b733999
Added errors
inner-daemons Oct 12, 2025
58d18c3
Very sloppy
inner-daemons Oct 12, 2025
d1c7c41
Removed the arbitrary limit
inner-daemons Oct 12, 2025
f9f7645
Tried to expose multiview mesh shaders on DX12
inner-daemons Oct 13, 2025
84b3ebd
Merge remote-tracking branch 'upstream/trunk' into multiview-tests-li…
inner-daemons Oct 13, 2025
9bc293d
Empty commit to see if linux vulkan failure was real
inner-daemons Oct 13, 2025
6741ec9
THATS IT????
inner-daemons Oct 13, 2025
9c8fe73
Added non contiguous test
inner-daemons Oct 13, 2025
bf2ae23
Removed the graphics debugger stuff
inner-daemons Oct 13, 2025
de53fd2
Tried to change API
inner-daemons Oct 13, 2025
5478696
Merge remote-tracking branch 'upstream/trunk' into multiview-tests-li…
inner-daemons Oct 18, 2025
6f4625f
Merge remote-tracking branch 'upstream/trunk' into multiview-tests-li…
inner-daemons Oct 18, 2025
2131515
Cargo.lock change
inner-daemons Oct 18, 2025
88ddedc
Fixed rp & pipeline creation in new tests
inner-daemons Oct 18, 2025
c2fac1b
Worked on multiview tests and added new selective multiview feature
inner-daemons Oct 18, 2025
323b7f7
Disabled multiview features on dx12
inner-daemons Oct 18, 2025
5c72a43
Fixed a stupid bug related to selective multiview
inner-daemons Oct 18, 2025
2721756
Some docs changes
inner-daemons Oct 19, 2025
61064b2
Apply suggestion from @Wumpf
inner-daemons Oct 19, 2025
0438103
Update wgpu-core/src/command/draw.rs
inner-daemons Oct 19, 2025
da7d643
Added more docs
inner-daemons Oct 19, 2025
273073f
Merge branch 'trunk' into multiview-tests-limits
inner-daemons Oct 20, 2025
44f8dd4
Merge branch 'trunk' into multiview-tests-limits
inner-daemons Oct 22, 2025
01da6cb
Merge remote-tracking branch 'upstream/trunk' into multiview-tests-li…
inner-daemons Oct 26, 2025
59353b7
Updated to trunk
inner-daemons Oct 26, 2025
9e33470
Update tests/tests/wgpu-gpu/multiview.rs
inner-daemons Oct 26, 2025
8c7f640
Update wgpu-hal/src/dx12/adapter.rs
inner-daemons Oct 26, 2025
47386fd
Update wgpu-hal/src/dx12/adapter.rs
inner-daemons Oct 26, 2025
bea70cb
Update tests/tests/wgpu-gpu/multiview.rs
inner-daemons Oct 26, 2025
e24670a
Update tests/tests/wgpu-gpu/multiview.rs
inner-daemons Oct 26, 2025
d87926c
Update wgpu-hal/src/metal/adapter.rs
inner-daemons Oct 26, 2025
41e6ea6
Fixed issue from previous commit
inner-daemons Oct 26, 2025
e6bc3f7
Improved example slightly
inner-daemons Oct 26, 2025
2e95fe5
Cleaned up some comments & docs
inner-daemons Oct 26, 2025
448125d
Final wgpu-hal tweak for now
inner-daemons Oct 26, 2025
9c957e7
Worked on wgpu-core
inner-daemons Oct 26, 2025
06dd64f
Unsure why my auto formatter missed this
inner-daemons Oct 26, 2025
c785558
Improved the example slightly
inner-daemons Oct 26, 2025
5453734
Fixed single multiview
inner-daemons Oct 26, 2025
3d30aa4
Updated tests
inner-daemons Oct 26, 2025
29faa86
Updated the example
inner-daemons Oct 26, 2025
8f4d0c1
Update mod.rs
inner-daemons Oct 28, 2025
fc29a98
Merge branch 'trunk' into multiview-tests-limits
inner-daemons Oct 28, 2025
f9aeb43
Updated thing with wumpf comments
inner-daemons Oct 28, 2025
fb021d6
Merge branch 'trunk' into multiview-tests-limits
inner-daemons Oct 29, 2025
47ab059
Fixed bad diff resolution
inner-daemons Oct 29, 2025
712e5ec
Merge remote-tracking branch 'upstream/trunk' into multiview-tests-li…
inner-daemons Oct 30, 2025
6ac9aff
Fixed stuff
inner-daemons Oct 30, 2025
0ba957e
Fix pt 2
inner-daemons Oct 30, 2025
06000af
Ran cargo fmt
inner-daemons Oct 30, 2025
252312e
dummy commit to rerun CI
inner-daemons Oct 30, 2025
0db72e0
Merge branch 'trunk' into multiview-tests-limits
Wumpf Nov 1, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 33 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Bottom level categories:

## Unreleased

### Major changes
### Major Changes

#### `wgpu::Instance::enumerate_adapters` is now `async` & available on WebGPU

Expand Down Expand Up @@ -73,6 +73,38 @@ SamplerDescriptor {
}
```

#### Multiview on all major platforms and support for multiview bitmasks

Multiview is a feature that allows rendering the same content to multiple layers of a texture. This is useful primarily in VR where you wish to
display almost identical content to 2 views, just with a different perspective. Instead of using 2 draw calls or 2 instances for each object, you
can use this feature.

Multiview is also called view instancing in DX12 land or vertex amplification in Metal land.

Multiview has been reworked, adding support for Metal, and adding testing and validation to wgpu itself.
This change also introduces a view bitmask, a new field in `RenderPassDescriptor` that allows a render pass to render to multiple non-adjacent layers
when using the `SELECTIVE_MULTIVIEW` feature. Note that this also influences apps that don't use multiview, as they have to set this mask to `None`.
```diff
- wgpu::RenderPassDescriptor {
- label: None,
- color_attachments: &color_attachments,
- depth_stencil_attachment: None,
- timestamp_writes: None,
- occlusion_query_set: None,
- }
+ wgpu::RenderPassDescriptor {
+ label: None,
+ color_attachments: &color_attachments,
+ depth_stencil_attachment: None,
+ timestamp_writes: None,
+ occlusion_query_set: None,
+ multiview_mask: NonZero::new(3),
+ }
```
One other breaking change worth noting is that in WGSL `@builtin(view_index)` now requires a type of `u32`, where previously it required `i32`.

By @SupaMaggie70Incorporated in [#8206](https://github.com/gfx-rs/wgpu/pull/8206).

### New Features

- Added support for transient textures on Vulkan and Metal. By @opstic in [#8247](https://github.com/gfx-rs/wgpu/pull/8247)
Expand Down
6 changes: 4 additions & 2 deletions benches/benches/wgpu-benchmark/renderpass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ impl RenderpassState {
})],
compilation_options: wgpu::PipelineCompilationOptions::default(),
}),
multiview: None,
multiview_mask: None,
cache: None,
});

Expand Down Expand Up @@ -322,7 +322,7 @@ impl RenderpassState {
})],
compilation_options: wgpu::PipelineCompilationOptions::default(),
}),
multiview: None,
multiview_mask: None,
cache: None,
},
));
Expand Down Expand Up @@ -370,6 +370,7 @@ impl RenderpassState {
occlusion_query_set: None,
timestamp_writes: None,
depth_stencil_attachment: None,
multiview_mask: None,
});

let start_idx = pass_number * draws_per_pass;
Expand Down Expand Up @@ -417,6 +418,7 @@ impl RenderpassState {
occlusion_query_set: None,
timestamp_writes: None,
depth_stencil_attachment: None,
multiview_mask: None,
});

render_pass.set_pipeline(self.bindless_pipeline.as_ref().unwrap());
Expand Down
2 changes: 2 additions & 0 deletions deno_webgpu/command_encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

use std::borrow::Cow;
use std::cell::RefCell;
use std::num::NonZero;

use deno_core::cppgc::Ptr;
use deno_core::op2;
Expand Down Expand Up @@ -142,6 +143,7 @@ impl GPUCommandEncoder {
occlusion_query_set: descriptor
.occlusion_query_set
.map(|query_set| query_set.id),
multiview_mask: NonZero::new(descriptor.multiview_mask),
};

let (render_pass, err) = self
Expand Down
2 changes: 1 addition & 1 deletion deno_webgpu/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -879,7 +879,7 @@ impl GPUDevice {
multisample,
fragment,
cache: None,
multiview: None,
multiview_mask: None,
};

let (id, err) = self.instance.device_create_render_pipeline(
Expand Down
3 changes: 3 additions & 0 deletions deno_webgpu/render_pass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,9 @@ pub(crate) struct GPURenderPassDescriptor {
/*#[webidl(default = 50000000)]
#[options(enforce_range = true)]
pub max_draw_count: u64,*/
#[webidl(default = 0)]
#[options(enforce_range = true)]
pub multiview_mask: u32,
}

#[derive(WebIDL)]
Expand Down
3 changes: 2 additions & 1 deletion examples/features/src/boids/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ impl crate::framework::Example for Example {
primitive: wgpu::PrimitiveState::default(),
depth_stencil: None,
multisample: wgpu::MultisampleState::default(),
multiview: None,
multiview_mask: None,
cache: None,
});

Expand Down Expand Up @@ -276,6 +276,7 @@ impl crate::framework::Example for Example {
depth_stencil_attachment: None,
timestamp_writes: None,
occlusion_query_set: None,
multiview_mask: None,
};

// get command encoder
Expand Down
3 changes: 2 additions & 1 deletion examples/features/src/bunnymark/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ impl Example {
depth_stencil_attachment: None,
timestamp_writes: None,
occlusion_query_set: None,
multiview_mask: None,
});
rpass.set_pipeline(&self.pipeline);
rpass.set_bind_group(0, &self.global_group, &[]);
Expand Down Expand Up @@ -229,7 +230,7 @@ impl crate::framework::Example for Example {
},
depth_stencil: None,
multisample: wgpu::MultisampleState::default(),
multiview: None,
multiview_mask: None,
cache: None,
});

Expand Down
10 changes: 6 additions & 4 deletions examples/features/src/conservative_raster/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ impl crate::framework::Example for Example {
},
depth_stencil: None,
multisample: wgpu::MultisampleState::default(),
multiview: None,
multiview_mask: None,
cache: None,
});

Expand All @@ -129,7 +129,7 @@ impl crate::framework::Example for Example {
primitive: wgpu::PrimitiveState::default(),
depth_stencil: None,
multisample: wgpu::MultisampleState::default(),
multiview: None,
multiview_mask: None,
cache: None,
});

Expand Down Expand Up @@ -160,7 +160,7 @@ impl crate::framework::Example for Example {
},
depth_stencil: None,
multisample: wgpu::MultisampleState::default(),
multiview: None,
multiview_mask: None,
cache: None,
}),
)
Expand Down Expand Up @@ -217,7 +217,7 @@ impl crate::framework::Example for Example {
primitive: wgpu::PrimitiveState::default(),
depth_stencil: None,
multisample: wgpu::MultisampleState::default(),
multiview: None,
multiview_mask: None,
cache: None,
}),
bind_group_layout,
Expand Down Expand Up @@ -273,6 +273,7 @@ impl crate::framework::Example for Example {
depth_stencil_attachment: None,
timestamp_writes: None,
occlusion_query_set: None,
multiview_mask: None,
});

rpass.set_pipeline(&self.pipeline_triangle_conservative);
Expand All @@ -295,6 +296,7 @@ impl crate::framework::Example for Example {
depth_stencil_attachment: None,
timestamp_writes: None,
occlusion_query_set: None,
multiview_mask: None,
});

rpass.set_pipeline(&self.pipeline_upscale);
Expand Down
5 changes: 3 additions & 2 deletions examples/features/src/cube/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ impl crate::framework::Example for Example {
},
depth_stencil: None,
multisample: wgpu::MultisampleState::default(),
multiview: None,
multiview_mask: None,
cache: None,
});

Expand Down Expand Up @@ -298,7 +298,7 @@ impl crate::framework::Example for Example {
},
depth_stencil: None,
multisample: wgpu::MultisampleState::default(),
multiview: None,
multiview_mask: None,
cache: None,
});
Some(pipeline_wire)
Expand Down Expand Up @@ -356,6 +356,7 @@ impl crate::framework::Example for Example {
depth_stencil_attachment: None,
timestamp_writes: None,
occlusion_query_set: None,
multiview_mask: None,
});
rpass.push_debug_group("Prepare data for draw.");
rpass.set_pipeline(&self.pipeline);
Expand Down
3 changes: 2 additions & 1 deletion examples/features/src/hello_triangle/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ async fn run(event_loop: EventLoop<()>, window: Window) {
primitive: wgpu::PrimitiveState::default(),
depth_stencil: None,
multisample: wgpu::MultisampleState::default(),
multiview: None,
multiview_mask: None,
cache: None,
});

Expand Down Expand Up @@ -129,6 +129,7 @@ async fn run(event_loop: EventLoop<()>, window: Window) {
depth_stencil_attachment: None,
timestamp_writes: None,
occlusion_query_set: None,
multiview_mask: None,
});
rpass.set_pipeline(&render_pipeline);
rpass.draw(0..3, 0..1);
Expand Down
1 change: 1 addition & 0 deletions examples/features/src/hello_windows/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ async fn run(event_loop: EventLoop<()>, viewports: Vec<(Arc<Window>, wgpu::Color
depth_stencil_attachment: None,
timestamp_writes: None,
occlusion_query_set: None,
multiview_mask: None,
});
}

Expand Down
1 change: 1 addition & 0 deletions examples/features/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ pub mod mesh_shader;
pub mod mipmap;
pub mod msaa_line;
pub mod multiple_render_targets;
pub mod multiview;
pub mod ray_cube_compute;
pub mod ray_cube_fragment;
pub mod ray_cube_normals;
Expand Down
6 changes: 6 additions & 0 deletions examples/features/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,12 @@ const EXAMPLES: &[ExampleDesc] = &[
webgl: false,
webgpu: false,
},
ExampleDesc {
name: "multiview",
function: wgpu_examples::multiview::main,
webgl: false,
webgpu: false,
},
];

fn get_example_name() -> Option<String> {
Expand Down
1 change: 1 addition & 0 deletions examples/features/src/mesh_shader/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ impl crate::framework::Example for Example {
depth_stencil_attachment: None,
timestamp_writes: None,
occlusion_query_set: None,
multiview_mask: None,
});
rpass.push_debug_group("Prepare data for draw.");
rpass.set_pipeline(&self.pipeline);
Expand Down
6 changes: 4 additions & 2 deletions examples/features/src/mipmap/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ impl Example {
},
depth_stencil: None,
multisample: wgpu::MultisampleState::default(),
multiview: None,
multiview_mask: None,
cache: None,
});

Expand Down Expand Up @@ -170,6 +170,7 @@ impl Example {
depth_stencil_attachment: None,
timestamp_writes: None,
occlusion_query_set: None,
multiview_mask: None,
});
if let Some(ref query_sets) = query_sets {
rpass.write_timestamp(&query_sets.timestamp, timestamp_query_index_base);
Expand Down Expand Up @@ -305,7 +306,7 @@ impl crate::framework::Example for Example {
},
depth_stencil: None,
multisample: wgpu::MultisampleState::default(),
multiview: None,
multiview_mask: None,
cache: None,
});

Expand Down Expand Up @@ -492,6 +493,7 @@ impl crate::framework::Example for Example {
depth_stencil_attachment: None,
timestamp_writes: None,
occlusion_query_set: None,
multiview_mask: None,
});
rpass.set_pipeline(&self.draw_pipeline);
rpass.set_bind_group(0, &self.bind_group, &[]);
Expand Down
3 changes: 2 additions & 1 deletion examples/features/src/msaa_line/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ impl Example {
count: sample_count,
..Default::default()
},
multiview: None,
multiview_mask: None,
cache: None,
});
let mut encoder =
Expand Down Expand Up @@ -307,6 +307,7 @@ impl crate::framework::Example for Example {
depth_stencil_attachment: None,
timestamp_writes: None,
occlusion_query_set: None,
multiview_mask: None,
})
.execute_bundles(iter::once(&self.bundle));
}
Expand Down
6 changes: 4 additions & 2 deletions examples/features/src/multiple_render_targets/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ impl MultiTargetRenderer {
primitive: wgpu::PrimitiveState::default(),
depth_stencil: None,
multisample: wgpu::MultisampleState::default(),
multiview: None,
multiview_mask: None,
cache: None,
});

Expand All @@ -182,6 +182,7 @@ impl MultiTargetRenderer {
depth_stencil_attachment: None,
timestamp_writes: None,
occlusion_query_set: None,
multiview_mask: None,
});
rpass.set_pipeline(&self.pipeline);
rpass.set_bind_group(0, &self.bindgroup, &[]);
Expand Down Expand Up @@ -266,7 +267,7 @@ impl TargetRenderer {
primitive: wgpu::PrimitiveState::default(),
depth_stencil: None,
multisample: wgpu::MultisampleState::default(),
multiview: None,
multiview_mask: None,
cache: None,
});

Expand Down Expand Up @@ -339,6 +340,7 @@ impl TargetRenderer {
depth_stencil_attachment: None,
timestamp_writes: None,
occlusion_query_set: None,
multiview_mask: None,
});
rpass.set_pipeline(&self.pipeline);
rpass.set_bind_group(0, &self.bindgroup_left, &[]);
Expand Down
Loading
Loading