aboutsummaryrefslogtreecommitdiff
path: root/layers/core_validation.cpp
diff options
context:
space:
mode:
authorMike Schuchardt <mikes@lunarg.com>2017-10-20 12:30:00 -0600
committerMike Schuchardt <mikes@lunarg.com>2017-10-20 16:16:37 -0600
commitf3e9f2010c37b31df1874d3217457bc030e94e94 (patch)
tree2377b55a21c5136a38439564e0c009960a0f3857 /layers/core_validation.cpp
parent5bb226034cf6a68608230fb12619d30d1034dd4e (diff)
downloadusermoji-f3e9f2010c37b31df1874d3217457bc030e94e94.tar.xz
layers: Track WSI fences and semaphores
Treat temporarily imported semaphores and fences from vkAcquireNextImageKHR as internal sync objects since the spec allows them to be waited on. Change-Id: I195bb7f4b65d141e9fb4a541817b4dc37b6aa600
Diffstat (limited to 'layers/core_validation.cpp')
-rw-r--r--layers/core_validation.cpp32
1 files changed, 10 insertions, 22 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp
index 946cbbde..0cd14d73 100644
--- a/layers/core_validation.cpp
+++ b/layers/core_validation.cpp
@@ -9928,31 +9928,19 @@ static bool PreCallValidateAcquireNextImageKHR(layer_data *dev_data, VkDevice de
static void PostCallRecordAcquireNextImageKHR(layer_data *dev_data, VkDevice device, VkSwapchainKHR swapchain, uint64_t timeout,
VkSemaphore semaphore, VkFence fence, uint32_t *pImageIndex) {
auto pFence = GetFenceNode(dev_data, fence);
- if (pFence) {
- if (GetDeviceExtensions(dev_data)->vk_khr_external_fence) {
- // A successful call with external fences enabled acts as a temporary import
- if (pFence->scope == kSyncScopeInternal) {
- pFence->scope = kSyncScopeExternalTemporary;
- }
- } else if (pFence->scope == kSyncScopeInternal) {
- // A successful call without external fences acts as a signal operation
- pFence->state = FENCE_INFLIGHT;
- pFence->signaler.first = VK_NULL_HANDLE; // ANI isn't on a queue, so this can't participate in a completion proof.
- }
+ if (pFence && pFence->scope == kSyncScopeInternal) {
+ // Treat as inflight since it is valid to wait on this fence, even in cases where it is technically a temporary
+ // import
+ pFence->state = FENCE_INFLIGHT;
+ pFence->signaler.first = VK_NULL_HANDLE; // ANI isn't on a queue, so this can't participate in a completion proof.
}
auto pSemaphore = GetSemaphoreNode(dev_data, semaphore);
- if (pSemaphore) {
- if (GetDeviceExtensions(dev_data)->vk_khr_external_semaphore) {
- // A successful call with external semaphores enabled acts as a temporary import
- if (pSemaphore->scope == kSyncScopeInternal) {
- pSemaphore->scope = kSyncScopeExternalTemporary;
- }
- } else if (pSemaphore->scope == kSyncScopeInternal) {
- // A successful call without external semaphores acts as a signal operation
- pSemaphore->signaled = true;
- pSemaphore->signaler.first = VK_NULL_HANDLE;
- }
+ if (pSemaphore && pSemaphore->scope == kSyncScopeInternal) {
+ // Treat as signaled since it is valid to wait on this semaphore, even in cases where it is technically a
+ // temporary import
+ pSemaphore->signaled = true;
+ pSemaphore->signaler.first = VK_NULL_HANDLE;
}
// Mark the image as acquired.