summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Ekstrand <jason.ekstrand@intel.com>2017-05-03 15:09:14 -0700
committerJason Ekstrand <jason.ekstrand@intel.com>2017-05-03 15:09:14 -0700
commit4f60bf124e78c4c4843379cbf12f63096d834bac (patch)
tree19d5ade75d85e0bcebb04fd84b1507a771043a63
parent23eacca519ead6037e6222df29399dd5eb01469d (diff)
func.sync.semaphore-fd: Ceck physical device features
-rw-r--r--src/tests/func/sync/semaphore-fd.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/tests/func/sync/semaphore-fd.c b/src/tests/func/sync/semaphore-fd.c
index fc49201..1c90f3f 100644
--- a/src/tests/func/sync/semaphore-fd.c
+++ b/src/tests/func/sync/semaphore-fd.c
@@ -475,6 +475,32 @@ test_define {
};
static void
+require_handle_type(VkExternalSemaphoreHandleTypeFlagBitsKHX handle_type)
+{
+#define GET_FUNCTION_PTR(name) \
+ PFN_vk##name name = (PFN_vk##name)vkGetInstanceProcAddr(t_instance, "vk"#name)
+
+ GET_FUNCTION_PTR(GetPhysicalDeviceExternalSemaphorePropertiesKHX);
+
+#undef GET_FUNCTION_PTR
+
+ VkExternalSemaphorePropertiesKHX props = {
+ .sType = VK_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_PROPERTIES_KHX,
+ };
+ GetPhysicalDeviceExternalSemaphorePropertiesKHX(t_physical_dev,
+ &(VkPhysicalDeviceExternalSemaphoreInfoKHX) {
+ .handleType = handle_type,
+ }, &props);
+
+ const uint32_t features =
+ VK_EXTERNAL_SEMAPHORE_FEATURE_EXPORTABLE_BIT_KHX |
+ VK_EXTERNAL_SEMAPHORE_FEATURE_IMPORTABLE_BIT_KHX;
+
+ if ((props.externalSemaphoreFeatures & features) != features)
+ t_skip();
+}
+
+static void
test_opaque_fd(void)
{
t_require_ext("VK_KHX_external_memory");
@@ -482,6 +508,8 @@ test_opaque_fd(void)
t_require_ext("VK_KHX_external_semaphore");
t_require_ext("VK_KHX_external_semaphore_fd");
+ require_handle_type(VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT_KHX);
+
struct test_context ctx1, ctx2;
init_context(&ctx1, 1.0);
init_context(&ctx2, 0.0);
@@ -634,6 +662,8 @@ test_sync_fd(void)
t_require_ext("VK_KHX_external_semaphore");
t_require_ext("VK_KHX_external_semaphore_fd");
+ require_handle_type(VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_FENCE_FD_BIT_KHX);
+
struct test_context ctx1, ctx2;
init_context(&ctx1, 1.0);
init_context(&ctx2, 0.0);