vkd3d: Add VKD3D_CONFIG flags for forcing EXCLUSIVE queue modes.

Helps in some cases, but we cannot do this by default :(

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
This commit is contained in:
Hans-Kristian Arntzen 2021-06-27 23:41:39 +02:00
parent 5e3ec4337b
commit c1860a1ead
3 changed files with 22 additions and 2 deletions

View File

@ -66,7 +66,9 @@ enum vkd3d_config_flags
VKD3D_CONFIG_FLAG_FORCE_STATIC_CBV = 0x00000008,
VKD3D_CONFIG_FLAG_DXR = 0x00000010,
VKD3D_CONFIG_FLAG_SINGLE_QUEUE = 0x00000020,
VKD3D_CONFIG_FLAG_DESCRIPTOR_QA_CHECKS = 0x00000040
VKD3D_CONFIG_FLAG_DESCRIPTOR_QA_CHECKS = 0x00000040,
VKD3D_CONFIG_FLAG_FORCE_RTV_EXCLUSIVE_QUEUE = 0x00000080,
VKD3D_CONFIG_FLAG_FORCE_DSV_EXCLUSIVE_QUEUE = 0x00000100,
};
typedef HRESULT (*PFN_vkd3d_signal_event)(HANDLE event);

View File

@ -485,6 +485,9 @@ static const struct vkd3d_debug_option vkd3d_config_options[] =
{"dxr", VKD3D_CONFIG_FLAG_DXR},
{"single_queue", VKD3D_CONFIG_FLAG_SINGLE_QUEUE},
{"descriptor_qa_checks", VKD3D_CONFIG_FLAG_DESCRIPTOR_QA_CHECKS},
{"force_rtv_exclusive_queue", VKD3D_CONFIG_FLAG_FORCE_RTV_EXCLUSIVE_QUEUE},
{"force_dsv_exclusive_queue", VKD3D_CONFIG_FLAG_FORCE_DSV_EXCLUSIVE_QUEUE},
{"force_exclusive_queue", VKD3D_CONFIG_FLAG_FORCE_RTV_EXCLUSIVE_QUEUE | VKD3D_CONFIG_FLAG_FORCE_DSV_EXCLUSIVE_QUEUE},
};
static void vkd3d_config_flags_init_once(void)

View File

@ -356,6 +356,7 @@ static HRESULT vkd3d_create_image(struct d3d12_device *device,
const struct vkd3d_format *format;
VkImageCreateInfo image_info;
DXGI_FORMAT typeless_format;
bool use_concurrent;
unsigned int i;
VkResult vr;
@ -496,7 +497,21 @@ static HRESULT vkd3d_create_image(struct d3d12_device *device,
if (vkd3d_resource_can_be_vrs(device, heap_properties, desc))
image_info.usage |= VK_IMAGE_USAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR;
if (device->unique_queue_mask & (device->unique_queue_mask - 1))
use_concurrent = !!(device->unique_queue_mask & (device->unique_queue_mask - 1));
if (!(desc->Flags & D3D12_RESOURCE_FLAG_ALLOW_SIMULTANEOUS_ACCESS))
{
/* Ignore config flags for actual simultaneous access cases. */
if (((desc->Flags & D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET) &&
(vkd3d_config_flags & VKD3D_CONFIG_FLAG_FORCE_RTV_EXCLUSIVE_QUEUE)) ||
((desc->Flags & D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL) &&
(vkd3d_config_flags & VKD3D_CONFIG_FLAG_FORCE_DSV_EXCLUSIVE_QUEUE)))
{
use_concurrent = false;
}
}
if (use_concurrent)
{
/* For multi-queue, we have to use CONCURRENT since D3D does
* not give us enough information to do ownership transfers. */