Skip to content

Commit

Permalink
vkd3d: Only mark present ID as valid when it is valid.
Browse files Browse the repository at this point in the history
Checking for pNext is no longer valid with swapchain_maint1.

Missed case during development since I didn't test with non-FIFO
apparently.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
  • Loading branch information
HansKristian-Work committed Jan 29, 2024
1 parent 29a54c9 commit 32ff676
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion libs/vkd3d/swapchain.c
Original file line number Diff line number Diff line change
Expand Up @@ -2003,6 +2003,7 @@ static void dxgi_vk_swap_chain_present_iteration(struct dxgi_vk_swap_chain *chai
VkPresentInfoKHR present_info;
VkPresentIdKHR present_id;
uint32_t swapchain_index;
bool use_present_id;
VkResult vk_result;
VkQueue vk_queue;
VkResult vr;
Expand Down Expand Up @@ -2062,8 +2063,11 @@ static void dxgi_vk_swap_chain_present_iteration(struct dxgi_vk_swap_chain *chai
present_id.pNext = NULL;
present_id.swapchainCount = 1;
present_id.pPresentIds = &chain->present.present_id;
use_present_id = true;
vk_prepend_struct(&present_info, &present_id);
}
else
use_present_id = false;

if (chain->swapchain_maintenance1)
{
Expand Down Expand Up @@ -2104,7 +2108,7 @@ static void dxgi_vk_swap_chain_present_iteration(struct dxgi_vk_swap_chain *chai
if (vr >= 0)
chain->present.current_backbuffer_index = UINT32_MAX;

if (present_info.pNext && vr >= 0)
if (use_present_id && vr >= 0)
chain->present.present_id_valid = true;

/* Handle any errors and retry as needed. If we cannot make meaningful forward progress, just give up and retry later. */
Expand Down

0 comments on commit 32ff676

Please sign in to comment.