From 3684cae58c53d2c4220f76623273f599b141653b Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Thu, 31 Mar 2022 17:44:19 +0200 Subject: [PATCH] dzn: Fix dzn_image_get_rtv_desc() for 3D views VK_REMAINING_ARRAY_LAYERS maps to -1 in the D3D12 world. Let's make sure we set WSize to -1 in that case, because the layer_count calculated by dzn_get_layer_count() won't work for 3D images which never have more than one layer (in case of 3D images, we treat slices as layers). Reviewed-by: Erik Faye-Lund Part-of: --- src/microsoft/vulkan/dzn_image.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/microsoft/vulkan/dzn_image.cpp b/src/microsoft/vulkan/dzn_image.cpp index 9531ac8..21f8695 100644 --- a/src/microsoft/vulkan/dzn_image.cpp +++ b/src/microsoft/vulkan/dzn_image.cpp @@ -500,7 +500,8 @@ dzn_image_get_rtv_desc(const dzn_image *image, case D3D12_RTV_DIMENSION_TEXTURE3D: rtv_desc.Texture3D.MipSlice = range->baseMipLevel + level; rtv_desc.Texture3D.FirstWSlice = range->baseArrayLayer; - rtv_desc.Texture3D.WSize = layer_count; + rtv_desc.Texture3D.WSize = + range->layerCount == VK_REMAINING_ARRAY_LAYERS ? -1 : layer_count; break; } -- 2.7.4