Skip to content

Commit

Permalink
vkd3d: Add config option for async presentation.
Browse files Browse the repository at this point in the history
Signed-off-by: Hans-Kristian Arntzen <[email protected]>
  • Loading branch information
HansKristian-Work committed Aug 23, 2024
1 parent 793b0f5 commit 0d575bc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions include/vkd3d.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ extern "C" {
#define VKD3D_CONFIG_FLAG_DRIVER_VERSION_SENSITIVE_SHADERS (1ull << 48)
#define VKD3D_CONFIG_FLAG_SMALL_VRAM_REBAR (1ull << 49)
#define VKD3D_CONFIG_FLAG_STAGGERED_SUBMIT (1ull << 50)
#define VKD3D_CONFIG_FLAG_ASYNC_PRESENT (1ull << 51)

struct vkd3d_instance;

Expand Down
1 change: 1 addition & 0 deletions libs/vkd3d/device.c
Original file line number Diff line number Diff line change
Expand Up @@ -940,6 +940,7 @@ static const struct vkd3d_debug_option vkd3d_config_options[] =
{"app_debug_marker_only", VKD3D_CONFIG_FLAG_APP_DEBUG_MARKER_ONLY},
{"small_vram_rebar", VKD3D_CONFIG_FLAG_SMALL_VRAM_REBAR},
{"staggered_submit", VKD3D_CONFIG_FLAG_STAGGERED_SUBMIT},
{"async_present", VKD3D_CONFIG_FLAG_ASYNC_PRESENT},
};

static void vkd3d_config_flags_init_once(void)
Expand Down
3 changes: 2 additions & 1 deletion libs/vkd3d/swapchain.c
Original file line number Diff line number Diff line change
Expand Up @@ -1349,7 +1349,8 @@ static HRESULT dxgi_vk_swap_chain_create_surface(struct dxgi_vk_swap_chain *chai
* Only attempt this if the application is asking for an "unusual" priority, since this
* implies some out of order shenanigans. */
family_info = chain->queue->device->queue_families[VKD3D_QUEUE_FAMILY_COMPUTE];
if (chain->queue->device->queue_families[VKD3D_QUEUE_FAMILY_GRAPHICS]->queue_count == 1 &&
if ((vkd3d_config_flags & VKD3D_CONFIG_FLAG_ASYNC_PRESENT) &&
chain->queue->device->queue_families[VKD3D_QUEUE_FAMILY_GRAPHICS]->queue_count == 1 &&
family_info->vk_family_index != chain->queue->vkd3d_queue->vk_family_index &&
VK_CALL(vkGetPhysicalDeviceSurfaceSupportKHR(vk_physical_device,
family_info->vk_family_index, chain->vk_surface, &supported)) == VK_SUCCESS && supported)
Expand Down

0 comments on commit 0d575bc

Please sign in to comment.