mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 02:20:11 +01:00
wsi: Always signal semaphores and fences in wsi_common_acquire_next_image
If the driver wants to do something special, it can reset the semaphore or fence again and re-signal it. Sure, that wastes a malloc/free but this is the window-system path. It'll be fine. Reviewed-by: Iago Toral Quiroga <itoral@igalia.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4037>
This commit is contained in:
parent
e32892130f
commit
b03216de9c
1 changed files with 28 additions and 12 deletions
|
|
@ -33,6 +33,8 @@
|
||||||
#include "vk_physical_device.h"
|
#include "vk_physical_device.h"
|
||||||
#include "vk_queue.h"
|
#include "vk_queue.h"
|
||||||
#include "vk_semaphore.h"
|
#include "vk_semaphore.h"
|
||||||
|
#include "vk_sync.h"
|
||||||
|
#include "vk_sync_dummy.h"
|
||||||
#include "vk_util.h"
|
#include "vk_util.h"
|
||||||
|
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
@ -834,15 +836,22 @@ wsi_signal_semaphore_for_image(struct vk_device *device,
|
||||||
const struct wsi_image *image,
|
const struct wsi_image *image,
|
||||||
VkSemaphore _semaphore)
|
VkSemaphore _semaphore)
|
||||||
{
|
{
|
||||||
VK_FROM_HANDLE(vk_semaphore, semaphore, _semaphore);
|
if (device->physical->supported_sync_types == NULL)
|
||||||
|
|
||||||
if (!chain->wsi->signal_semaphore_with_memory)
|
|
||||||
return VK_SUCCESS;
|
return VK_SUCCESS;
|
||||||
|
|
||||||
|
VK_FROM_HANDLE(vk_semaphore, semaphore, _semaphore);
|
||||||
|
|
||||||
vk_semaphore_reset_temporary(device, semaphore);
|
vk_semaphore_reset_temporary(device, semaphore);
|
||||||
return device->create_sync_for_memory(device, image->memory,
|
|
||||||
false /* signal_memory */,
|
if (chain->wsi->signal_semaphore_with_memory) {
|
||||||
&semaphore->temporary);
|
return device->create_sync_for_memory(device, image->memory,
|
||||||
|
false /* signal_memory */,
|
||||||
|
&semaphore->temporary);
|
||||||
|
} else {
|
||||||
|
return vk_sync_create(device, &vk_sync_dummy_type,
|
||||||
|
0 /* flags */, 0 /* initial_value */,
|
||||||
|
&semaphore->temporary);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static VkResult
|
static VkResult
|
||||||
|
|
@ -851,15 +860,22 @@ wsi_signal_fence_for_image(struct vk_device *device,
|
||||||
const struct wsi_image *image,
|
const struct wsi_image *image,
|
||||||
VkFence _fence)
|
VkFence _fence)
|
||||||
{
|
{
|
||||||
VK_FROM_HANDLE(vk_fence, fence, _fence);
|
if (device->physical->supported_sync_types == NULL)
|
||||||
|
|
||||||
if (!chain->wsi->signal_fence_with_memory)
|
|
||||||
return VK_SUCCESS;
|
return VK_SUCCESS;
|
||||||
|
|
||||||
|
VK_FROM_HANDLE(vk_fence, fence, _fence);
|
||||||
|
|
||||||
vk_fence_reset_temporary(device, fence);
|
vk_fence_reset_temporary(device, fence);
|
||||||
return device->create_sync_for_memory(device, image->memory,
|
|
||||||
false /* signal_memory */,
|
if (chain->wsi->signal_fence_with_memory) {
|
||||||
&fence->temporary);
|
return device->create_sync_for_memory(device, image->memory,
|
||||||
|
false /* signal_memory */,
|
||||||
|
&fence->temporary);
|
||||||
|
} else {
|
||||||
|
return vk_sync_create(device, &vk_sync_dummy_type,
|
||||||
|
0 /* flags */, 0 /* initial_value */,
|
||||||
|
&fence->temporary);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VkResult
|
VkResult
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue