Signed-off-by: Conor McCarthy cmccarthy@codeweavers.com --- tests/d3d12.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/tests/d3d12.c b/tests/d3d12.c index 9d4fb7d4..0702573b 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -1736,6 +1736,12 @@ static void test_create_committed_resource(void) ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); resource_desc.SampleDesc.Count = 1;
+ resource_desc.Format = DXGI_FORMAT_UNKNOWN; + hr = ID3D12Device_CreateCommittedResource(device, &heap_properties, D3D12_HEAP_FLAG_NONE, &resource_desc, + D3D12_RESOURCE_STATE_RENDER_TARGET, &clear_value, &IID_ID3D12Resource, (void **)&resource); + ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + resource_desc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; + hr = ID3D12Device_CreateCommittedResource(device, &heap_properties, D3D12_HEAP_FLAG_NONE, &resource_desc, D3D12_RESOURCE_STATE_RENDER_TARGET | D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE, &clear_value, &IID_ID3D12Resource, (void **)&resource);
This results in a valid format instead of NULL being returned for buffers and any other case where DXGI_FORMAT_UNKNOWN is specified. In some cases invalid use of a buffer or DXGI_FORMAT_UNKNOWN will not result in E_INVALIDARG, and would need to be tested explicitly if proven to be an issue.
Signed-off-by: Conor McCarthy cmccarthy@codeweavers.com --- libs/vkd3d/device.c | 8 +------- libs/vkd3d/resource.c | 8 ++++++++ libs/vkd3d/state.c | 4 ++++ libs/vkd3d/utils.c | 1 + tests/d3d12.c | 2 +- 5 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/libs/vkd3d/device.c b/libs/vkd3d/device.c index 661ca1d9..e1e878d1 100644 --- a/libs/vkd3d/device.c +++ b/libs/vkd3d/device.c @@ -3656,8 +3656,6 @@ static void STDMETHODCALLTYPE d3d12_device_GetCopyableFootprints(ID3D12Device *i UINT *row_counts, UINT64 *row_sizes, UINT64 *total_bytes) { struct d3d12_device *device = impl_from_ID3D12Device(iface); - static const struct vkd3d_format vkd3d_format_unknown - = {DXGI_FORMAT_UNKNOWN, VK_FORMAT_UNDEFINED, 1, 1, 1, 1, 0};
unsigned int i, sub_resource_idx, miplevel_idx, row_count, row_size, row_pitch; unsigned int width, height, depth, plane_count, sub_resources_per_plane; @@ -3678,11 +3676,7 @@ static void STDMETHODCALLTYPE d3d12_device_GetCopyableFootprints(ID3D12Device *i if (total_bytes) *total_bytes = ~(uint64_t)0;
- if (desc->Dimension == D3D12_RESOURCE_DIMENSION_BUFFER) - { - format = &vkd3d_format_unknown; - } - else if (!(format = vkd3d_format_from_d3d12_resource_desc(device, desc, 0))) + if (!(format = vkd3d_format_from_d3d12_resource_desc(device, desc, 0))) { WARN("Invalid format %#x.\n", desc->Format); return; diff --git a/libs/vkd3d/resource.c b/libs/vkd3d/resource.c index a4d16ee8..14e08b09 100644 --- a/libs/vkd3d/resource.c +++ b/libs/vkd3d/resource.c @@ -1589,6 +1589,12 @@ static void d3d12_validate_resource_flags(D3D12_RESOURCE_FLAGS flags) static bool d3d12_resource_validate_texture_format(const D3D12_RESOURCE_DESC *desc, const struct vkd3d_format *format) { + if (desc->Format == DXGI_FORMAT_UNKNOWN) + { + WARN("DXGI_FORMAT_UNKNOWN is invalid for textures.\n"); + return false; + } + if (!vkd3d_format_is_compressed(format)) return true;
@@ -2273,6 +2279,8 @@ static bool vkd3d_create_buffer_view_for_resource(struct d3d12_device *device, } else if ((format = vkd3d_format_from_d3d12_resource_desc(device, &resource->desc, view_format))) { + /* TODO: if view_format is DXGI_FORMAT_UNKNOWN, this is always 1, which + * may not match driver behaviour (return false?). */ element_size = format->byte_count; } else diff --git a/libs/vkd3d/state.c b/libs/vkd3d/state.c index 10503a60..b54a6527 100644 --- a/libs/vkd3d/state.c +++ b/libs/vkd3d/state.c @@ -2328,6 +2328,8 @@ static HRESULT compute_input_layout_offsets(const struct d3d12_device *device, return E_INVALIDARG; }
+ /* TODO: DXGI_FORMAT_UNKNOWN will return a format with byte_count == 1, + * which may not match driver behaviour (return E_INVALIDARG?). */ if (!(format = vkd3d_get_format(device, e->Format, false))) { WARN("Invalid input element format %#x.\n", e->Format); @@ -2816,6 +2818,8 @@ static HRESULT d3d12_pipeline_state_init_graphics(struct d3d12_pipeline_state *s const D3D12_INPUT_ELEMENT_DESC *e = &desc->InputLayout.pInputElementDescs[i]; const struct vkd3d_shader_signature_element *signature_element;
+ /* TODO: DXGI_FORMAT_UNKNOWN will succeed here, which may not match + * driver behaviour (return E_INVALIDARG?). */ if (!(format = vkd3d_get_format(device, e->Format, false))) { WARN("Invalid input element format %#x.\n", e->Format); diff --git a/libs/vkd3d/utils.c b/libs/vkd3d/utils.c index ec2b4b39..cdb81f67 100644 --- a/libs/vkd3d/utils.c +++ b/libs/vkd3d/utils.c @@ -29,6 +29,7 @@ #define UINT VKD3D_FORMAT_TYPE_UINT static const struct vkd3d_format vkd3d_formats[] = { + {DXGI_FORMAT_UNKNOWN, VK_FORMAT_UNDEFINED, 1, 1, 1, 1}, {DXGI_FORMAT_R32G32B32A32_TYPELESS, VK_FORMAT_R32G32B32A32_SFLOAT, 16, 1, 1, 1, COLOR, 1, TYPELESS}, {DXGI_FORMAT_R32G32B32A32_FLOAT, VK_FORMAT_R32G32B32A32_SFLOAT, 16, 1, 1, 1, COLOR, 1}, {DXGI_FORMAT_R32G32B32A32_UINT, VK_FORMAT_R32G32B32A32_UINT, 16, 1, 1, 1, COLOR, 1, UINT}, diff --git a/tests/d3d12.c b/tests/d3d12.c index 0702573b..23aab61d 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -1167,7 +1167,7 @@ static void test_format_support(void) memset(&format_support, 0, sizeof(format_support)); hr = ID3D12Device_CheckFeatureSupport(device, D3D12_FEATURE_FORMAT_SUPPORT, &format_support, sizeof(format_support)); - todo ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); todo ok(format_support.Support1 == D3D12_FORMAT_SUPPORT1_BUFFER, "Got unexpected support1 %#x.\n", format_support.Support1); ok(!format_support.Support2 || format_support.Support2 == D3D12_FORMAT_SUPPORT2_TILED,
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Conor McCarthy cmccarthy@codeweavers.com --- libs/vkd3d/command.c | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-)
diff --git a/libs/vkd3d/command.c b/libs/vkd3d/command.c index b4fd6cf3..271524b7 100644 --- a/libs/vkd3d/command.c +++ b/libs/vkd3d/command.c @@ -3498,12 +3498,7 @@ static void STDMETHODCALLTYPE d3d12_command_list_CopyTextureRegion(ID3D12Graphic assert(d3d12_resource_is_texture(dst_resource)); assert(d3d12_resource_is_buffer(src_resource));
- if (!(src_format = vkd3d_format_from_d3d12_resource_desc(list->device, - &dst_resource->desc, src->u.PlacedFootprint.Footprint.Format))) - { - WARN("Invalid format %#x.\n", src->u.PlacedFootprint.Footprint.Format); - return; - } + src_format = dst_resource->format;
if (src_format->is_emulated) { @@ -3527,18 +3522,8 @@ static void STDMETHODCALLTYPE d3d12_command_list_CopyTextureRegion(ID3D12Graphic assert(d3d12_resource_is_texture(dst_resource)); assert(d3d12_resource_is_texture(src_resource));
- if (!(dst_format = vkd3d_format_from_d3d12_resource_desc(list->device, - &dst_resource->desc, DXGI_FORMAT_UNKNOWN))) - { - WARN("Invalid format %#x.\n", dst_resource->desc.Format); - return; - } - if (!(src_format = vkd3d_format_from_d3d12_resource_desc(list->device, - &src_resource->desc, DXGI_FORMAT_UNKNOWN))) - { - WARN("Invalid format %#x.\n", src_resource->desc.Format); - return; - } + dst_format = dst_resource->format; + src_format = src_resource->format;
if ((dst_format->vk_aspect_mask & VK_IMAGE_ASPECT_DEPTH_BIT) && (dst_format->vk_aspect_mask & VK_IMAGE_ASPECT_STENCIL_BIT))
On Tue, 18 Jan 2022 at 06:08, Conor McCarthy cmccarthy@codeweavers.com wrote:
@@ -3498,12 +3498,7 @@ static void STDMETHODCALLTYPE d3d12_command_list_CopyTextureRegion(ID3D12Graphic assert(d3d12_resource_is_texture(dst_resource)); assert(d3d12_resource_is_buffer(src_resource));
if (!(src_format = vkd3d_format_from_d3d12_resource_desc(list->device,
&dst_resource->desc, src->u.PlacedFootprint.Footprint.Format)))
{
WARN("Invalid format %#x.\n", src->u.PlacedFootprint.Footprint.Format);
return;
}
src_format = dst_resource->format;
Is that right? This would previously use "src->u.PlacedFootprint.Footprint.Format" if non-zero.
Signed-off-by: Conor McCarthy cmccarthy@codeweavers.com --- libs/vkd3d/command.c | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-)
diff --git a/libs/vkd3d/command.c b/libs/vkd3d/command.c index 271524b7..c94a4afb 100644 --- a/libs/vkd3d/command.c +++ b/libs/vkd3d/command.c @@ -3558,7 +3558,6 @@ static void STDMETHODCALLTYPE d3d12_command_list_CopyResource(ID3D12GraphicsComm { struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface); struct d3d12_resource *dst_resource, *src_resource; - const struct vkd3d_format *src_format, *dst_format; const struct vkd3d_vk_device_procs *vk_procs; VkBufferCopy vk_buffer_copy; VkImageCopy vk_image_copy; @@ -3590,19 +3589,6 @@ static void STDMETHODCALLTYPE d3d12_command_list_CopyResource(ID3D12GraphicsComm } else { - if (!(dst_format = vkd3d_format_from_d3d12_resource_desc(list->device, - &dst_resource->desc, DXGI_FORMAT_UNKNOWN))) - { - WARN("Invalid format %#x.\n", dst_resource->desc.Format); - return; - } - if (!(src_format = vkd3d_format_from_d3d12_resource_desc(list->device, - &src_resource->desc, DXGI_FORMAT_UNKNOWN))) - { - WARN("Invalid format %#x.\n", src_resource->desc.Format); - return; - } - layer_count = d3d12_resource_desc_get_layer_count(&dst_resource->desc);
assert(d3d12_resource_is_texture(dst_resource)); @@ -3612,8 +3598,8 @@ static void STDMETHODCALLTYPE d3d12_command_list_CopyResource(ID3D12GraphicsComm
for (i = 0; i < dst_resource->desc.MipLevels; ++i) { - vk_image_copy_from_d3d12(&vk_image_copy, i, i, - &src_resource->desc, &dst_resource->desc, src_format, dst_format, NULL, 0, 0, 0); + vk_image_copy_from_d3d12(&vk_image_copy, i, i, &src_resource->desc, &dst_resource->desc, + src_resource->format, dst_resource->format, NULL, 0, 0, 0); vk_image_copy.dstSubresource.layerCount = layer_count; vk_image_copy.srcSubresource.layerCount = layer_count; VK_CALL(vkCmdCopyImage(list->vk_command_buffer, src_resource->u.vk_image,
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Conor McCarthy cmccarthy@codeweavers.com --- libs/vkd3d/command.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/libs/vkd3d/command.c b/libs/vkd3d/command.c index c94a4afb..9d98cff1 100644 --- a/libs/vkd3d/command.c +++ b/libs/vkd3d/command.c @@ -3648,16 +3648,8 @@ static void STDMETHODCALLTYPE d3d12_command_list_ResolveSubresource(ID3D12Graphi
d3d12_command_list_end_current_render_pass(list);
- if (!(dst_format = vkd3d_format_from_d3d12_resource_desc(device, &dst_resource->desc, DXGI_FORMAT_UNKNOWN))) - { - WARN("Invalid format %#x.\n", dst_resource->desc.Format); - return; - } - if (!(src_format = vkd3d_format_from_d3d12_resource_desc(device, &src_resource->desc, DXGI_FORMAT_UNKNOWN))) - { - WARN("Invalid format %#x.\n", src_resource->desc.Format); - return; - } + dst_format = dst_resource->format; + src_format = src_resource->format;
if (dst_format->type == VKD3D_FORMAT_TYPE_TYPELESS || src_format->type == VKD3D_FORMAT_TYPE_TYPELESS) {
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Conor McCarthy cmccarthy@codeweavers.com --- libs/vkd3d/resource.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/libs/vkd3d/resource.c b/libs/vkd3d/resource.c index 14e08b09..99050150 100644 --- a/libs/vkd3d/resource.c +++ b/libs/vkd3d/resource.c @@ -2439,7 +2439,11 @@ static bool init_default_texture_view_desc(struct vkd3d_texture_view_desc *desc, { const struct d3d12_device *device = resource->device;
- if (!(desc->format = vkd3d_format_from_d3d12_resource_desc(device, &resource->desc, view_format))) + if (view_format == resource->desc.Format) + { + desc->format = resource->format; + } + else if (!(desc->format = vkd3d_format_from_d3d12_resource_desc(device, &resource->desc, view_format))) { FIXME("Failed to find format (resource format %#x, view format %#x).\n", resource->desc.Format, view_format);
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
On Tue, 18 Jan 2022 at 06:08, Conor McCarthy cmccarthy@codeweavers.com wrote:
@@ -2439,7 +2439,11 @@ static bool init_default_texture_view_desc(struct vkd3d_texture_view_desc *desc, { const struct d3d12_device *device = resource->device;
- if (!(desc->format = vkd3d_format_from_d3d12_resource_desc(device, &resource->desc, view_format)))
- if (view_format == resource->desc.Format)
- {
desc->format = resource->format;
- }
That's not wrong, but note that we can also use the stored resource format when "view_format" is 0/DXGI_FORMAT_UNKNOWN.
vk_image_aspect_flags_from_d3d12_plane_slice() is based on a vkd3d-proton implementation by Philip Rebohle.
Signed-off-by: Conor McCarthy cmccarthy@codeweavers.com --- libs/vkd3d/resource.c | 42 +++++++++++++++++++++++++++++++------- libs/vkd3d/vkd3d_private.h | 1 + 2 files changed, 36 insertions(+), 7 deletions(-)
diff --git a/libs/vkd3d/resource.c b/libs/vkd3d/resource.c index 99050150..f55948bb 100644 --- a/libs/vkd3d/resource.c +++ b/libs/vkd3d/resource.c @@ -2454,6 +2454,7 @@ static bool init_default_texture_view_desc(struct vkd3d_texture_view_desc *desc, desc->miplevel_count = 1; desc->layer_idx = 0; desc->layer_count = d3d12_resource_desc_get_layer_count(&resource->desc); + desc->vk_image_aspect = desc->format->vk_aspect_mask;
switch (resource->desc.Dimension) { @@ -2537,7 +2538,7 @@ bool vkd3d_create_texture_view(struct d3d12_device *device, VkImage vk_image, vkd3d_set_view_swizzle_for_format(&view_desc.components, format, desc->allowed_swizzle); if (desc->allowed_swizzle) vk_component_mapping_compose(&view_desc.components, &desc->components); - view_desc.subresourceRange.aspectMask = format->vk_aspect_mask; + view_desc.subresourceRange.aspectMask = desc->vk_image_aspect; view_desc.subresourceRange.baseMipLevel = desc->miplevel_idx; view_desc.subresourceRange.levelCount = desc->miplevel_count; view_desc.subresourceRange.baseArrayLayer = desc->layer_idx; @@ -2705,6 +2706,27 @@ static void vkd3d_create_buffer_srv(struct d3d12_desc *descriptor, descriptor->u.view = view; }
+static VkImageAspectFlags vk_image_aspect_flags_from_d3d12_plane_slice(const struct vkd3d_format *format, + unsigned int plane_slice) +{ + VkImageAspectFlags aspect_flags = format->vk_aspect_mask; + unsigned int i; + + /* For all formats we currently handle, the n-th aspect bit in Vulkan, if the lowest bit set is + * n = 0, corresponds to the n-th plane in D3D12, so clear the lowest bit for each slice skipped. */ + for (i = 0; i < plane_slice; i++) + aspect_flags &= aspect_flags - 1; + + if (!aspect_flags) + { + WARN("Invalid plane slice %u for format %#x.\n", plane_slice, format->vk_format); + aspect_flags = format->vk_aspect_mask; + } + + /* The selected slice is now the lowest bit in the aspect flags, so clear the others. */ + return aspect_flags & -aspect_flags; +} + void d3d12_desc_create_srv(struct d3d12_desc *descriptor, struct d3d12_device *device, struct d3d12_resource *resource, const D3D12_SHADER_RESOURCE_VIEW_DESC *desc) @@ -2747,7 +2769,8 @@ void d3d12_desc_create_srv(struct d3d12_desc *descriptor, vkd3d_desc.miplevel_idx = desc->u.Texture2D.MostDetailedMip; vkd3d_desc.miplevel_count = desc->u.Texture2D.MipLevels; if (desc->u.Texture2D.PlaneSlice) - FIXME("Ignoring plane slice %u.\n", desc->u.Texture2D.PlaneSlice); + vkd3d_desc.vk_image_aspect = vk_image_aspect_flags_from_d3d12_plane_slice(resource->format, + desc->u.Texture2D.PlaneSlice); if (desc->u.Texture2D.ResourceMinLODClamp) FIXME("Unhandled min LOD clamp %.8e.\n", desc->u.Texture2D.ResourceMinLODClamp); break; @@ -2758,7 +2781,8 @@ void d3d12_desc_create_srv(struct d3d12_desc *descriptor, vkd3d_desc.layer_idx = desc->u.Texture2DArray.FirstArraySlice; vkd3d_desc.layer_count = desc->u.Texture2DArray.ArraySize; if (desc->u.Texture2DArray.PlaneSlice) - FIXME("Ignoring plane slice %u.\n", desc->u.Texture2DArray.PlaneSlice); + vkd3d_desc.vk_image_aspect = vk_image_aspect_flags_from_d3d12_plane_slice(resource->format, + desc->u.Texture2D.PlaneSlice); if (desc->u.Texture2DArray.ResourceMinLODClamp) FIXME("Unhandled min LOD clamp %.8e.\n", desc->u.Texture2DArray.ResourceMinLODClamp); vkd3d_texture_view_desc_normalise(&vkd3d_desc, &resource->desc); @@ -2955,7 +2979,8 @@ static void vkd3d_create_texture_uav(struct d3d12_desc *descriptor, case D3D12_UAV_DIMENSION_TEXTURE2D: vkd3d_desc.miplevel_idx = desc->u.Texture2D.MipSlice; if (desc->u.Texture2D.PlaneSlice) - FIXME("Ignoring plane slice %u.\n", desc->u.Texture2D.PlaneSlice); + vkd3d_desc.vk_image_aspect = vk_image_aspect_flags_from_d3d12_plane_slice(resource->format, + desc->u.Texture2D.PlaneSlice); break; case D3D12_UAV_DIMENSION_TEXTURE2DARRAY: vkd3d_desc.view_type = VK_IMAGE_VIEW_TYPE_2D_ARRAY; @@ -2963,7 +2988,8 @@ static void vkd3d_create_texture_uav(struct d3d12_desc *descriptor, vkd3d_desc.layer_idx = desc->u.Texture2DArray.FirstArraySlice; vkd3d_desc.layer_count = desc->u.Texture2DArray.ArraySize; if (desc->u.Texture2DArray.PlaneSlice) - FIXME("Ignoring plane slice %u.\n", desc->u.Texture2DArray.PlaneSlice); + vkd3d_desc.vk_image_aspect = vk_image_aspect_flags_from_d3d12_plane_slice(resource->format, + desc->u.Texture2D.PlaneSlice); vkd3d_texture_view_desc_normalise(&vkd3d_desc, &resource->desc); break; case D3D12_UAV_DIMENSION_TEXTURE3D: @@ -3206,7 +3232,8 @@ void d3d12_rtv_desc_create_rtv(struct d3d12_rtv_desc *rtv_desc, struct d3d12_dev case D3D12_RTV_DIMENSION_TEXTURE2D: vkd3d_desc.miplevel_idx = desc->u.Texture2D.MipSlice; if (desc->u.Texture2D.PlaneSlice) - FIXME("Ignoring plane slice %u.\n", desc->u.Texture2D.PlaneSlice); + vkd3d_desc.vk_image_aspect = vk_image_aspect_flags_from_d3d12_plane_slice(resource->format, + desc->u.Texture2D.PlaneSlice); break; case D3D12_RTV_DIMENSION_TEXTURE2DARRAY: vkd3d_desc.view_type = VK_IMAGE_VIEW_TYPE_2D_ARRAY; @@ -3214,7 +3241,8 @@ void d3d12_rtv_desc_create_rtv(struct d3d12_rtv_desc *rtv_desc, struct d3d12_dev vkd3d_desc.layer_idx = desc->u.Texture2DArray.FirstArraySlice; vkd3d_desc.layer_count = desc->u.Texture2DArray.ArraySize; if (desc->u.Texture2DArray.PlaneSlice) - FIXME("Ignoring plane slice %u.\n", desc->u.Texture2DArray.PlaneSlice); + vkd3d_desc.vk_image_aspect = vk_image_aspect_flags_from_d3d12_plane_slice(resource->format, + desc->u.Texture2D.PlaneSlice); vkd3d_texture_view_desc_normalise(&vkd3d_desc, &resource->desc); break; case D3D12_RTV_DIMENSION_TEXTURE2DMS: diff --git a/libs/vkd3d/vkd3d_private.h b/libs/vkd3d/vkd3d_private.h index 6c31467f..9c3f913b 100644 --- a/libs/vkd3d/vkd3d_private.h +++ b/libs/vkd3d/vkd3d_private.h @@ -531,6 +531,7 @@ struct vkd3d_texture_view_desc unsigned int miplevel_count; unsigned int layer_idx; unsigned int layer_count; + VkImageAspectFlags vk_image_aspect; VkComponentMapping components; bool allowed_swizzle; };
On Tue, 18 Jan 2022 at 06:08, Conor McCarthy cmccarthy@codeweavers.com wrote:
@@ -2758,7 +2781,8 @@ void d3d12_desc_create_srv(struct d3d12_desc *descriptor, vkd3d_desc.layer_idx = desc->u.Texture2DArray.FirstArraySlice; vkd3d_desc.layer_count = desc->u.Texture2DArray.ArraySize; if (desc->u.Texture2DArray.PlaneSlice)
FIXME("Ignoring plane slice %u.\n", desc->u.Texture2DArray.PlaneSlice);
vkd3d_desc.vk_image_aspect = vk_image_aspect_flags_from_d3d12_plane_slice(resource->format,
desc->u.Texture2D.PlaneSlice);
[...]
@@ -2963,7 +2988,8 @@ static void vkd3d_create_texture_uav(struct d3d12_desc *descriptor, vkd3d_desc.layer_idx = desc->u.Texture2DArray.FirstArraySlice; vkd3d_desc.layer_count = desc->u.Texture2DArray.ArraySize; if (desc->u.Texture2DArray.PlaneSlice)
FIXME("Ignoring plane slice %u.\n", desc->u.Texture2DArray.PlaneSlice);
vkd3d_desc.vk_image_aspect = vk_image_aspect_flags_from_d3d12_plane_slice(resource->format,
desc->u.Texture2D.PlaneSlice);
[...]
@@ -3214,7 +3241,8 @@ void d3d12_rtv_desc_create_rtv(struct d3d12_rtv_desc *rtv_desc, struct d3d12_dev vkd3d_desc.layer_idx = desc->u.Texture2DArray.FirstArraySlice; vkd3d_desc.layer_count = desc->u.Texture2DArray.ArraySize; if (desc->u.Texture2DArray.PlaneSlice)
FIXME("Ignoring plane slice %u.\n", desc->u.Texture2DArray.PlaneSlice);
vkd3d_desc.vk_image_aspect = vk_image_aspect_flags_from_d3d12_plane_slice(resource->format,
desc->u.Texture2D.PlaneSlice);
Those should be using "desc->u.Texture2DArray.PlaneSlice" instead of "desc->u.Texture2D.PlaneSlice".