From 3a133b6e71f1988bd337d5cd5d463c36d82ebd73 Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Wed, 5 Aug 2020 18:00:37 +0300 Subject: [PATCH] Test imported signaled sync fd for VkSemaphore New tests: dEQP-VK.api.external.semaphore.sync_fd.import_signaled_temporary Components: Vulkan Change-Id: I86937f57d580f62a0bae4f2d06ee28057ca0e27e --- android/cts/master/vk-master-2020-03-01.txt | 1 + android/cts/master/vk-master.txt | 1 + .../vulkan/api/vktApiExternalMemoryTests.cpp | 31 +++++++++++++++++++ .../vulkancts/mustpass/master/vk-default.txt | 1 + 4 files changed, 34 insertions(+) diff --git a/android/cts/master/vk-master-2020-03-01.txt b/android/cts/master/vk-master-2020-03-01.txt index 37496d69f..8bd700651 100644 --- a/android/cts/master/vk-master-2020-03-01.txt +++ b/android/cts/master/vk-master-2020-03-01.txt @@ -62744,6 +62744,7 @@ dEQP-VK.api.fill_and_update_buffer.dedicated_alloc.fill_buffer_vk_whole_size_3_e dEQP-VK.api.fill_and_update_buffer.dedicated_alloc.fill_buffer_vk_whole_size_3_extra_bytes_offset_4 dEQP-VK.api.fill_and_update_buffer.dedicated_alloc.fill_buffer_vk_whole_size_3_extra_bytes_offset_8 dEQP-VK.api.fill_and_update_buffer.dedicated_alloc.fill_buffer_vk_whole_size_3_extra_bytes_offset_12 +dEQP-VK.api.external.semaphore.sync_fd.import_signaled_temporary dEQP-VK.api.external.memory.android_hardware_buffer.image_formats.d16_unorm dEQP-VK.api.external.memory.android_hardware_buffer.image_formats.x8_d24_unorm_pack32 dEQP-VK.api.external.memory.android_hardware_buffer.image_formats.d24_unorm_s8_uint diff --git a/android/cts/master/vk-master.txt b/android/cts/master/vk-master.txt index 954ad7557..5dac9eca1 100644 --- a/android/cts/master/vk-master.txt +++ b/android/cts/master/vk-master.txt @@ -150361,6 +150361,7 @@ dEQP-VK.api.external.semaphore.sync_fd.import_multiple_times_temporary dEQP-VK.api.external.semaphore.sync_fd.signal_export_import_wait_temporary dEQP-VK.api.external.semaphore.sync_fd.signal_import_temporary dEQP-VK.api.external.semaphore.sync_fd.transference_temporary +dEQP-VK.api.external.semaphore.sync_fd.import_signaled_temporary dEQP-VK.api.external.semaphore.sync_fd.export_multiple_times_temporary dEQP-VK.api.external.semaphore.sync_fd.dup_temporary dEQP-VK.api.external.semaphore.sync_fd.dup2_temporary diff --git a/external/vulkancts/modules/vulkan/api/vktApiExternalMemoryTests.cpp b/external/vulkancts/modules/vulkan/api/vktApiExternalMemoryTests.cpp index a3e210dcf..30e70d92f 100644 --- a/external/vulkancts/modules/vulkan/api/vktApiExternalMemoryTests.cpp +++ b/external/vulkancts/modules/vulkan/api/vktApiExternalMemoryTests.cpp @@ -1163,6 +1163,31 @@ tcu::TestStatus testSemaphoreSignalWaitImport (Context& context, } } +tcu::TestStatus testSemaphoreImportSyncFdSignaled (Context& context, + const SemaphoreTestConfig config) +{ + const vk::PlatformInterface& vkp (context.getPlatformInterface()); + const CustomInstance instance (createTestInstance(context, 0u, 0u, config.externalType)); + const vk::InstanceDriver& vki (instance.getDriver()); + const vk::VkPhysicalDevice physicalDevice (vk::chooseDevice(vki, instance, context.getTestContext().getCommandLine())); + const deUint32 queueFamilyIndex (chooseQueueFamilyIndex(vki, physicalDevice, 0u)); + const vk::VkSemaphoreImportFlags flags = config.permanence == PERMANENCE_TEMPORARY ? vk::VK_SEMAPHORE_IMPORT_TEMPORARY_BIT : (vk::VkSemaphoreImportFlagBits)0u; + + checkSemaphoreSupport(vki, physicalDevice, config.externalType); + + { + const vk::Unique device (createTestDevice(context, vkp, instance, vki, physicalDevice, config.externalType, 0u, 0u, queueFamilyIndex)); + const vk::DeviceDriver vkd (vkp, instance, *device); + const vk::VkQueue queue (getQueue(vkd, *device, queueFamilyIndex)); + NativeHandle handle = -1; + const vk::Unique semaphore (createAndImportSemaphore(vkd, *device, config.externalType, handle, flags)); + + submitDummyWait(vkd, queue, *semaphore); + + return tcu::TestStatus::pass("Pass"); + } +} + tcu::TestStatus testSemaphoreMultipleExports (Context& context, const SemaphoreTestConfig config) { @@ -4301,6 +4326,12 @@ de::MovePtr createSemaphoreTests (tcu::TestContext& testCtx, addFunctionCase(semaphoreGroup.get(), std::string("signal_import_") + permanenceName, "Test signaling and importing the semaphore.", testSemaphoreSignalImport, config); addFunctionCase(semaphoreGroup.get(), std::string("transference_") + permanenceName, "Test semaphores transference.", testSemaphoreTransference, config); + if (externalType == vk::VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT) + { + addFunctionCase(semaphoreGroup.get(), std::string("import_signaled_") + permanenceName, "Test import signaled semaphore fd.", testSemaphoreImportSyncFdSignaled, config); + } + + if (externalType == vk::VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT || externalType == vk::VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT) { diff --git a/external/vulkancts/mustpass/master/vk-default.txt b/external/vulkancts/mustpass/master/vk-default.txt index bc35bb4b0..a94e3f09c 100644 --- a/external/vulkancts/mustpass/master/vk-default.txt +++ b/external/vulkancts/mustpass/master/vk-default.txt @@ -150360,6 +150360,7 @@ dEQP-VK.api.external.semaphore.sync_fd.import_multiple_times_temporary dEQP-VK.api.external.semaphore.sync_fd.signal_export_import_wait_temporary dEQP-VK.api.external.semaphore.sync_fd.signal_import_temporary dEQP-VK.api.external.semaphore.sync_fd.transference_temporary +dEQP-VK.api.external.semaphore.sync_fd.import_signaled_temporary dEQP-VK.api.external.semaphore.sync_fd.export_multiple_times_temporary dEQP-VK.api.external.semaphore.sync_fd.dup_temporary dEQP-VK.api.external.semaphore.sync_fd.dup2_temporary -- 2.34.1