diff options
author | Jeff Bolz <jbolz@nvidia.com> | 2019-08-22 06:10:37 -0500 |
---|---|---|
committer | Mark Lobodzinski <mark@lunarg.com> | 2019-08-22 16:00:21 -0600 |
commit | 3b9022cae6f59ccacc93a845c5ff2e8fea4f839b (patch) | |
tree | 99b73cdacac00f3042cf68c346b66404e88cd1a7 | |
parent | 6d243119f4465ae838f8b07c335e6fc8b4be4879 (diff) | |
download | vulkan-validation-layers-3b9022cae6f59ccacc93a845c5ff2e8fea4f839b.tar.gz |
tests: Check for SPARSE support in TemporaryExternalSemaphore
-rw-r--r-- | tests/vklayertests_others.cpp | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/tests/vklayertests_others.cpp b/tests/vklayertests_others.cpp index e193647ad..f05426976 100644 --- a/tests/vklayertests_others.cpp +++ b/tests/vklayertests_others.cpp @@ -931,16 +931,19 @@ TEST_F(VkLayerTest, TemporaryExternalSemaphore) { vkQueueSubmit(m_device->m_queue, 4, si, VK_NULL_HANDLE); m_errorMonitor->VerifyFound(); - // Wait on the imported semaphore twice in vkQueueBindSparse, the second wait should be an error - VkBindSparseInfo bi[] = { - {VK_STRUCTURE_TYPE_BIND_SPARSE_INFO, nullptr, 0, nullptr, 0, nullptr, 0, nullptr, 0, nullptr, 1, &export_semaphore}, - {VK_STRUCTURE_TYPE_BIND_SPARSE_INFO, nullptr, 1, &import_semaphore, 0, nullptr, 0, nullptr, 0, nullptr, 0, nullptr}, - {VK_STRUCTURE_TYPE_BIND_SPARSE_INFO, nullptr, 0, nullptr, 0, nullptr, 0, nullptr, 0, nullptr, 1, &export_semaphore}, - {VK_STRUCTURE_TYPE_BIND_SPARSE_INFO, nullptr, 1, &import_semaphore, 0, nullptr, 0, nullptr, 0, nullptr, 0, nullptr}, - }; - m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, "has no way to be signaled"); - vkQueueBindSparse(m_device->m_queue, 4, bi, VK_NULL_HANDLE); - m_errorMonitor->VerifyFound(); + auto index = m_device->graphics_queue_node_index_; + if (m_device->queue_props[index].queueFlags & VK_QUEUE_SPARSE_BINDING_BIT) { + // Wait on the imported semaphore twice in vkQueueBindSparse, the second wait should be an error + VkBindSparseInfo bi[] = { + {VK_STRUCTURE_TYPE_BIND_SPARSE_INFO, nullptr, 0, nullptr, 0, nullptr, 0, nullptr, 0, nullptr, 1, &export_semaphore}, + {VK_STRUCTURE_TYPE_BIND_SPARSE_INFO, nullptr, 1, &import_semaphore, 0, nullptr, 0, nullptr, 0, nullptr, 0, nullptr}, + {VK_STRUCTURE_TYPE_BIND_SPARSE_INFO, nullptr, 0, nullptr, 0, nullptr, 0, nullptr, 0, nullptr, 1, &export_semaphore}, + {VK_STRUCTURE_TYPE_BIND_SPARSE_INFO, nullptr, 1, &import_semaphore, 0, nullptr, 0, nullptr, 0, nullptr, 0, nullptr}, + }; + m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, "has no way to be signaled"); + vkQueueBindSparse(m_device->m_queue, 4, bi, VK_NULL_HANDLE); + m_errorMonitor->VerifyFound(); + } // Cleanup err = vkQueueWaitIdle(m_device->m_queue); |