aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobin Ehlis <tobin@lunarg.com>2015-09-24 15:18:22 -0600
committerTobin Ehlis <tobin@lunarg.com>2015-09-29 10:58:42 -0600
commitbf3020ecbca6a017726104823107a8106ec24f3c (patch)
treea9fc43c5f7b0148366affb2541c4b0efebef3795
parentb4156fd375d611dc631ece28a0909f9714d5b682 (diff)
downloadusermoji-bf3020ecbca6a017726104823107a8106ec24f3c.tar.xz
demos: Query device features in cube prior to creating device
-rw-r--r--demos/cube.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/demos/cube.c b/demos/cube.c
index 6c1f4d7e..b3398683 100644
--- a/demos/cube.c
+++ b/demos/cube.c
@@ -2273,6 +2273,12 @@ static void demo_init_vk(struct demo *demo)
break;
}
assert(gfx_queue_idx < demo->queue_count);
+ // Query fine-grained feature support for this device.
+ // If app has specific feature requirements it should check supported features based on this query
+ VkPhysicalDeviceFeatures physDevFeatures = {};
+ err = vkGetPhysicalDeviceFeatures(demo->gpu, &physDevFeatures);
+ assert(!err);
+
const VkDeviceQueueCreateInfo queue = {
.sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO,
.pNext = NULL,
@@ -2289,6 +2295,7 @@ static void demo_init_vk(struct demo *demo)
.ppEnabledLayerNames = (const char *const*) ((demo->validate) ? device_validation_layers : NULL),
.extensionCount = enabled_extension_count,
.ppEnabledExtensionNames = (const char *const*) extension_names,
+ .pEnabledFeatures = NULL, // If specific features are required, pass them in here
};
err = vkCreateDevice(demo->gpu, &device, &demo->device);