vulkan: Replace various uses of device->timeline_mode

What we really care about is if we're DEFERRED so we need to do a flush
and if there can be any other threads we might race against.  We don't
really care about the timeline mode itself.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15566>
This commit is contained in:
Jason Ekstrand 2022-03-24 17:49:19 -05:00 committed by Marge Bot
parent 8e51778acf
commit 08512aea09
4 changed files with 6 additions and 6 deletions

View file

@ -189,7 +189,7 @@ vk_device_finish(UNUSED struct vk_device *device)
VkResult
vk_device_flush(struct vk_device *device)
{
if (device->timeline_mode != VK_DEVICE_TIMELINE_MODE_EMULATED)
if (device->submit_mode != VK_QUEUE_SUBMIT_MODE_DEFERRED)
return VK_SUCCESS;
bool progress;

View file

@ -438,7 +438,7 @@ vk_common_GetFenceFdKHR(VkDevice _device,
* semaphore export apply. We can't export a sync file from a fence
* if the fence event hasn't been submitted to the kernel yet.
*/
if (device->timeline_mode == VK_DEVICE_TIMELINE_MODE_ASSISTED) {
if (vk_device_supports_threaded_submit(device)) {
result = vk_sync_wait(device, sync, 0,
VK_SYNC_WAIT_PENDING,
UINT64_MAX);

View file

@ -997,7 +997,7 @@ vk_queue_wait_before_present(struct vk_queue *queue,
* semaphores, however, we need to do a wait. Thanks to the above bit of
* spec text, that wait should never block for long.
*/
if (queue->base.device->timeline_mode != VK_DEVICE_TIMELINE_MODE_ASSISTED)
if (!vk_device_supports_threaded_submit(queue->base.device))
return VK_SUCCESS;
const uint32_t wait_count = pPresentInfo->waitSemaphoreCount;

View file

@ -156,7 +156,7 @@ vk_common_CreateSemaphore(VkDevice _device,
* operation which is much trickier to assert early.
*/
if (semaphore_type == VK_SEMAPHORE_TYPE_BINARY &&
device->timeline_mode == VK_DEVICE_TIMELINE_MODE_ASSISTED)
vk_device_supports_threaded_submit(device))
assert(sync_type->move);
/* Allocate a vk_semaphore + vk_sync implementation. Because the permanent
@ -371,7 +371,7 @@ vk_common_SignalSemaphore(VkDevice _device,
if (unlikely(result != VK_SUCCESS))
return result;
if (device->timeline_mode == VK_DEVICE_TIMELINE_MODE_EMULATED) {
if (device->submit_mode == VK_QUEUE_SUBMIT_MODE_DEFERRED) {
result = vk_device_flush(device);
if (unlikely(result != VK_SUCCESS))
return result;
@ -521,7 +521,7 @@ vk_common_GetSemaphoreFdKHR(VkDevice _device,
* However, thanks to the above bit of spec text, that wait should never
* block for long.
*/
if (device->timeline_mode == VK_DEVICE_TIMELINE_MODE_ASSISTED) {
if (vk_device_supports_threaded_submit(device)) {
result = vk_sync_wait(device, sync, 0,
VK_SYNC_WAIT_PENDING,
UINT64_MAX);