Skip to content

Commit

Permalink
fix(multiview): Fixed multiview to work by disabling validation of la…
Browse files Browse the repository at this point in the history
…yer count and TextureViewDimension when enabled
  • Loading branch information
MalekiRe committed May 17, 2023
1 parent 372ac9b commit f64e80e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ Bottom level categories:

- Fix crash on dropping `wgpu::CommandBuffer`. By @wumpf in [#3726](https://github.com/gfx-rs/wgpu/pull/3726).
- Use `u32`s internally for bind group indices, rather than `u8`. By @ErichDonGubler in [#3743](https://github.com/gfx-rs/wgpu/pull/3743).
- Fix Multiview to disable validation of TextureViewDimension and ArrayLayerCount. By @MalekiRe in [#3779](https://github.com/gfx-rs/wgpu/pull/3779#issue-1713269437).

### Examples

Expand Down
9 changes: 7 additions & 2 deletions wgpu-core/src/device/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1189,7 +1189,10 @@ impl<A: HalApi> Device<A> {
break 'b Err(TextureViewNotRenderableReason::Usage(texture.desc.usage));
}

if resolved_dimension != TextureViewDimension::D2 {
if !(resolved_dimension == TextureViewDimension::D2
|| (self.features.contains(wgt::Features::MULTIVIEW)
&& resolved_dimension == TextureViewDimension::D2Array))
{
break 'b Err(TextureViewNotRenderableReason::Dimension(
resolved_dimension,
));
Expand All @@ -1201,7 +1204,9 @@ impl<A: HalApi> Device<A> {
));
}

if resolved_array_layer_count != 1 {
if resolved_array_layer_count != 1
&& !(self.features.contains(wgt::Features::MULTIVIEW))
{
break 'b Err(TextureViewNotRenderableReason::ArrayLayerCount(
resolved_array_layer_count,
));
Expand Down

0 comments on commit f64e80e

Please sign in to comment.