From 566eeb046542636116e4367b830fd03b92f3fb74 Mon Sep 17 00:00:00 2001 From: Conor McCarthy Date: Mon, 18 Oct 2021 18:28:08 +0200 Subject: [PATCH] vkd3d: Take the mip-level into account for the 3D UAV slice check in vkd3d_create_texture_uav(). Based on a vkd3d-proton patch by Philip Rebohle. Signed-off-by: Conor McCarthy Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- libs/vkd3d/resource.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libs/vkd3d/resource.c b/libs/vkd3d/resource.c index 1c667aa0..28877793 100644 --- a/libs/vkd3d/resource.c +++ b/libs/vkd3d/resource.c @@ -2967,8 +2967,9 @@ static void vkd3d_create_texture_uav(struct d3d12_desc *descriptor, case D3D12_UAV_DIMENSION_TEXTURE3D: vkd3d_desc.view_type = VK_IMAGE_VIEW_TYPE_3D; vkd3d_desc.miplevel_idx = desc->u.Texture3D.MipSlice; - if (desc->u.Texture3D.FirstWSlice || (desc->u.Texture3D.WSize != resource->desc.DepthOrArraySize - && desc->u.Texture3D.WSize != UINT_MAX)) + if (desc->u.Texture3D.FirstWSlice || (desc->u.Texture3D.WSize != UINT_MAX + && desc->u.Texture3D.WSize != max(1u, + resource->desc.DepthOrArraySize >> desc->u.Texture3D.MipSlice))) FIXME("Unhandled depth view %u-%u.\n", desc->u.Texture3D.FirstWSlice, desc->u.Texture3D.WSize); break;