deUint32 queueFamilyIndex,
vk::VkFence fence,
vk::VkExternalFenceHandleTypeFlagBits externalType,
- NativeHandle& nativeHandle)
+ NativeHandle& nativeHandle,
+ bool expectFenceUnsignaled = true)
{
const vk::Unique<vk::VkCommandPool> cmdPool(createCommandPool(vk, device, vk::VK_COMMAND_POOL_CREATE_TRANSIENT_BIT, queueFamilyIndex, DE_NULL));
const vk::Unique<vk::VkCommandBuffer> cmdBuffer(allocateCommandBuffer(vk, device, *cmdPool, vk::VK_COMMAND_BUFFER_LEVEL_PRIMARY));
VK_CHECK(vk.queueSubmit(queue, 1, &submit, fence));
- getFenceNative(vk, device, fence, externalType, nativeHandle);
+ getFenceNative(vk, device, fence, externalType, nativeHandle, expectFenceUnsignaled);
VK_CHECK(vk.setEvent(device, *event));
NativeHandle handle;
if (transference == TRANSFERENCE_COPY)
- submitDummySignalAndGetFenceNative(vkd, *device, queue, queueFamilyIndex, *fence, config.externalType, handle);
+ submitDummySignalAndGetFenceNative(vkd, *device, queue, queueFamilyIndex, *fence, config.externalType, handle, exportNdx == 0 /* expect fence to be signaled after first pass */);
else
- getFenceNative(vkd, *device, *fence, config.externalType, handle);
+ getFenceNative(vkd, *device, *fence, config.externalType, handle, exportNdx == 0 /* expect fence to be signaled after first pass */);
}
submitDummySignal(vkd, queue, *fence);
vk::VkDevice device,
vk::VkFence fence,
vk::VkExternalFenceHandleTypeFlagBits externalType,
- NativeHandle& nativeHandle)
+ NativeHandle& nativeHandle,
+ bool expectFenceUnsignaled)
{
if (externalType == vk::VK_EXTERNAL_FENCE_HANDLE_TYPE_SYNC_FD_BIT
|| externalType == vk::VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_FD_BIT)
int fd = -1;
VK_CHECK(vkd.getFenceFdKHR(device, &info, &fd));
- TCU_CHECK(fd >= 0);
+
+ if (externalType == vk::VK_EXTERNAL_FENCE_HANDLE_TYPE_SYNC_FD_BIT)
+ {
+ TCU_CHECK(!expectFenceUnsignaled || (fd >= 0));
+ }
+ else
+ {
+ TCU_CHECK(fd >= 0);
+ }
+
nativeHandle = fd;
}
else if (externalType == vk::VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_BIT