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

@@ -2150,8 +2150,7 @@ static bool vkd3d_create_vk_buffer_view(struct d3d12_device *device,
return vr == VK_SUCCESS;
}
static bool vkd3d_create_buffer_view(struct d3d12_device *device,
VkBuffer vk_buffer, const struct vkd3d_format *format,
bool vkd3d_create_buffer_view(struct d3d12_device *device, VkBuffer vk_buffer, const struct vkd3d_format *format,
VkDeviceSize offset, VkDeviceSize size, struct vkd3d_view **view)
{
const struct vkd3d_vk_device_procs *vk_procs = &device->vk_procs;
@@ -2350,18 +2349,6 @@ static void vk_component_mapping_compose(VkComponentMapping *dst, const VkCompon
dst->a = swizzle_vk_component(&a, a.a, b->a);
}
struct vkd3d_texture_view_desc
{
VkImageViewType view_type;
const struct vkd3d_format *format;
unsigned int miplevel_idx;
unsigned int miplevel_count;
unsigned int layer_idx;
unsigned int layer_count;
VkComponentMapping components;
bool allowed_swizzle;
};
static bool init_default_texture_view_desc(struct vkd3d_texture_view_desc *desc,
struct d3d12_resource *resource, DXGI_FORMAT view_format)
{
@@ -2409,9 +2396,8 @@ static bool init_default_texture_view_desc(struct vkd3d_texture_view_desc *desc,
return true;
}
static bool vkd3d_create_texture_view(struct d3d12_device *device,
VkImage vk_image, const struct vkd3d_texture_view_desc *desc,
struct vkd3d_view **view)
bool vkd3d_create_texture_view(struct d3d12_device *device, VkImage vk_image,
const struct vkd3d_texture_view_desc *desc, struct vkd3d_view **view)
{
const struct vkd3d_vk_device_procs *vk_procs = &device->vk_procs;
const struct vkd3d_format *format = desc->format;