[PATCH vkd3d 2/6] vkd3d: Call vkd3d_get_texture_layer_count() when creating an RTV.

Conor McCarthy cmccarthy at codeweavers.com
Wed Sep 29 00:33:59 CDT 2021


Signed-off-by: Conor McCarthy <cmccarthy at codeweavers.com>
---
 libs/vkd3d/resource.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libs/vkd3d/resource.c b/libs/vkd3d/resource.c
index 16dd07db..c5666b67 100644
--- a/libs/vkd3d/resource.c
+++ b/libs/vkd3d/resource.c
@@ -3205,6 +3205,10 @@ void d3d12_rtv_desc_create_rtv(struct d3d12_rtv_desc *rtv_desc, struct d3d12_dev
             default:
                 FIXME("Unhandled view dimension %#x.\n", desc->ViewDimension);
         }
+        /* ArraySize or WSize can be UINT_MAX. This is equal to VK_REMAINING_ARRAY_LAYERS, but it is not
+         * valid for TEXTURE3D or for Vulkan frame buffers. It is easiest to deal with UINT_MAX here. */
+        vkd3d_desc.layer_count = vkd3d_get_texture_layer_count(vkd3d_desc.layer_idx,
+                vkd3d_desc.layer_count, &resource->desc);
     }
     else if (resource->desc.Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE3D)
     {
-- 
2.32.0




More information about the wine-devel mailing list