summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.am1
-rw-r--r--src/tests/func/global-priority.c62
2 files changed, 63 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am
index 6c144dd..8c34532 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -89,6 +89,7 @@ bin_crucible_SOURCES = \
src/tests/func/query/timestamp.c \
src/tests/func/first.c \
src/tests/func/bind-points.c \
+ src/tests/func/global-priority.c \
src/tests/func/compute.c \
src/tests/func/compute-local-id.c \
src/tests/func/compute-num-workgroups.c \
diff --git a/src/tests/func/global-priority.c b/src/tests/func/global-priority.c
new file mode 100644
index 0000000..902682b
--- /dev/null
+++ b/src/tests/func/global-priority.c
@@ -0,0 +1,62 @@
+// Copyright 2018 Intel Corporation
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice (including the next
+// paragraph) shall be included in all copies or substantial portions of the
+// Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+
+#include "tapi/t.h"
+
+static void
+init_context(VkQueueGlobalPriorityEXT priority)
+{
+ VkDevice device;
+
+ VkDeviceQueueGlobalPriorityCreateInfoEXT pri;
+ pri.sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_EXT;
+ pri.pNext = NULL;
+ pri.globalPriority = priority;
+
+ VkResult result = vkCreateDevice(t_physical_dev,
+ &(VkDeviceCreateInfo) {
+ .sType = VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO,
+ .queueCreateInfoCount = 1,
+ .pQueueCreateInfos = &(VkDeviceQueueCreateInfo) {
+ .sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO,
+ .pNext = &pri,
+ .queueFamilyIndex = 0,
+ .queueCount = 1,
+ .pQueuePriorities = (float[]) { 1.0 },
+ },
+ }, NULL, &device);
+ t_assert(result == VK_SUCCESS);
+ t_cleanup_push_vk_device(device, NULL);
+}
+
+
+static void
+test_global_priority(void)
+{
+ t_require_ext("VK_EXT_global_priority");
+ init_context(VK_QUEUE_GLOBAL_PRIORITY_MEDIUM);
+}
+
+test_define {
+ .name = "func.global.priority.simple",
+ .start = test_global_priority,
+ .no_image = true,
+};