gfx-rs/gfx

Unimplemented path in Dx11 backend when constructing cube views of depth textures

Imberflur opened this issue · 1 comments

Short info header:

  • GFX version: d002952
  • OS: Windows 10
  • GPU: AMD Radeon(TM) Vega 3 Graphics
PanicInfo: panicked at 'not implemented', D:\veloren\gfx\src\backend\dx11\src\device.rs:771:18

I believe this is similar to the issue that was fixed in dx12: #3702

I'm currently attempting to mimic the patch used there.

with this diff

diff --git a/src/backend/dx11/src/device.rs b/src/backend/dx11/src/device.rs
index 9727b686..568b74bb 100644
--- a/src/backend/dx11/src/device.rs
+++ b/src/backend/dx11/src/device.rs
@@ -768,7 +768,13 @@ impl Device {
                     }
                 }
             }
-            _ => unimplemented!(),
+            image::ViewKind::D1 | image::ViewKind::D1Array | image::ViewKind::D3 | image::ViewKind::Cube | image::ViewKind::CubeArray => {
+                warn!(
+                    "3D and cube views are not supported for the image, kind: {:?}",
+                    info.kind
+                );
+                return Err(image::ViewCreationError::BadKind(info.view_kind));
+            },
         }

         let mut dsv = ptr::null_mut();

I get

WARN gfx_backend_dx11::device: 3D and cube views are not supported for the image, kind: D2(1024, 1024, 6, 1)
wgpu error: Validation Error

Caused by:
    In Texture::create_view
    not enough memory left

Without further investigation I'm not sure whether this is an unrelated error or due to the errors from view creation in the dx11 backend being handled differently than in the dx12 backend.