Fix multiview rendering (#3779)

This commit is contained in:
Malek 2023-05-18 21:03:57 -07:00 committed by GitHub
parent dd47d73c0c
commit dafc189d6b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View File

@ -62,6 +62,7 @@ Bottom level categories:
- Fix crash on dropping `wgpu::CommandBuffer`. By @wumpf in [#3726](https://github.com/gfx-rs/wgpu/pull/3726). - 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). - 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 ### Examples

View File

@ -1189,7 +1189,10 @@ impl<A: HalApi> Device<A> {
break 'b Err(TextureViewNotRenderableReason::Usage(texture.desc.usage)); 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( break 'b Err(TextureViewNotRenderableReason::Dimension(
resolved_dimension, resolved_dimension,
)); ));
@ -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( break 'b Err(TextureViewNotRenderableReason::ArrayLayerCount(
resolved_array_layer_count, resolved_array_layer_count,
)); ));