Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ValveSoftware/vkd3d.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Rebohle <philip.rebohle@tu-dortmund.de>2021-11-25 19:00:56 +0300
committerHans-Kristian Arntzen <post@arntzen-software.no>2021-11-26 18:51:01 +0300
commit0de25ac3cd18b322eef7db7bc60be02b68282d62 (patch)
tree56339fd5b48e6ce55aa26055b0fe106d42287b0b
parentab111dcdbeeb24208cc541797c74286baca955e1 (diff)
vkd3d: Do not use vkd3d_find_uint_format in ClearUAV.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
-rw-r--r--libs/vkd3d/command.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/libs/vkd3d/command.c b/libs/vkd3d/command.c
index 47ee1a55..3e1e2a96 100644
--- a/libs/vkd3d/command.c
+++ b/libs/vkd3d/command.c
@@ -8084,7 +8084,7 @@ static void d3d12_command_list_clear_uav(struct d3d12_command_list *list, const
}
}
-static const struct vkd3d_format *vkd3d_fixup_clear_uav_uint_color(struct d3d12_device *device,
+static void vkd3d_fixup_clear_uav_uint_color(struct d3d12_device *device,
DXGI_FORMAT dxgi_format, VkClearColorValue *color)
{
switch (dxgi_format)
@@ -8093,13 +8093,22 @@ static const struct vkd3d_format *vkd3d_fixup_clear_uav_uint_color(struct d3d12_
color->uint32[0] = (color->uint32[0] & 0x7FF)
| ((color->uint32[1] & 0x7FF) << 11)
| ((color->uint32[2] & 0x3FF) << 22);
- return vkd3d_get_format(device, DXGI_FORMAT_R32_UINT, false);
+ break;
- default:
- return NULL;
+ default: ;
}
}
+static const struct vkd3d_format *vkd3d_clear_uav_find_uint_format(struct d3d12_device *device, DXGI_FORMAT dxgi_format)
+{
+ DXGI_FORMAT uint_format = DXGI_FORMAT_UNKNOWN;
+
+ if (dxgi_format < device->format_compatibility_list_count)
+ uint_format = device->format_compatibility_lists[dxgi_format].uint_format;
+
+ return vkd3d_get_format(device, uint_format, false);
+}
+
static bool vkd3d_clear_uav_info_from_desc(struct vkd3d_clear_uav_info *args, const struct d3d12_desc *desc)
{
if (desc->metadata.flags & VKD3D_DESCRIPTOR_FLAG_VIEW)
@@ -8179,15 +8188,16 @@ static void STDMETHODCALLTYPE d3d12_command_list_ClearUnorderedAccessViewUint(d3
if (args.has_view && desc->info.view->format->type != VKD3D_FORMAT_TYPE_UINT)
{
const struct vkd3d_view *base_view = desc->info.view;
- uint_format = vkd3d_find_uint_format(list->device, base_view->format->dxgi_format);
+ uint_format = vkd3d_clear_uav_find_uint_format(list->device, base_view->format->dxgi_format);
- if (!uint_format && !(uint_format = vkd3d_fixup_clear_uav_uint_color(
- list->device, base_view->format->dxgi_format, &color)))
+ if (!uint_format)
{
ERR("Unhandled format %d.\n", base_view->format->dxgi_format);
return;
}
+
+ vkd3d_fixup_clear_uav_uint_color(list->device, base_view->format->dxgi_format, &color);
vkd3d_mask_uint_clear_color(color.uint32, uint_format->vk_format);
if (d3d12_resource_is_texture(resource_impl))