vkd3d: Re-implement d3d12_command_list_ClearUnorderedAccessViewUint().

Addresses the following limitations of the previous implementation:
    - Only R32_{UINT,TYPELESS} were supported for buffers.
    - Clearing an image UAV did not behave correctly for images with non-UINT formats.
    - Due to the use of transfer operations, extra memory barriers were needed.

If necessary, this will create a temporary view with a bit-compatible
UINT format for the resource in order to perform a bit-exact clear.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Philip Rebohle
2019-11-25 17:35:39 +03:30
committed by Alexandre Julliard
parent 65ee0562f9
commit 207ca12725
5 changed files with 102 additions and 102 deletions

View File

@@ -451,6 +451,37 @@ const struct vkd3d_format *vkd3d_get_format(const struct d3d12_device *device,
return NULL;
}
const struct vkd3d_format *vkd3d_find_uint_format(const struct d3d12_device *device, DXGI_FORMAT dxgi_format)
{
DXGI_FORMAT typeless_format = DXGI_FORMAT_UNKNOWN;
const struct vkd3d_format *vkd3d_format;
unsigned int i;
for (i = 0; i < ARRAY_SIZE(vkd3d_format_compatibility_info); ++i)
{
if (vkd3d_format_compatibility_info[i].format == dxgi_format)
{
typeless_format = vkd3d_format_compatibility_info[i].typeless_format;
break;
}
}
if (!typeless_format)
return NULL;
for (i = 0; i < ARRAY_SIZE(vkd3d_format_compatibility_info); ++i)
{
if (vkd3d_format_compatibility_info[i].typeless_format != typeless_format)
continue;
vkd3d_format = vkd3d_get_format(device, vkd3d_format_compatibility_info[i].format, false);
if (vkd3d_format->type == VKD3D_FORMAT_TYPE_UINT)
return vkd3d_format;
}
return NULL;
}
void vkd3d_format_copy_data(const struct vkd3d_format *format, const uint8_t *src,
unsigned int src_row_pitch, unsigned int src_slice_pitch, uint8_t *dst, unsigned int dst_row_pitch,
unsigned int dst_slice_pitch, unsigned int w, unsigned int h, unsigned int d)