static void demo_init_vk(struct demo *demo)
{
+ // TODO : Should query count w/ GetGlobalExtensionInfo, then enable via CreateInstance
const VkApplicationInfo app = {
.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO,
.pNext = NULL,
.queueNodeIndex = 0,
.queueCount = 1,
};
+
const char *ext_names[] = {
"VK_WSI_X11",
};
+
const VkDeviceCreateInfo device = {
.sType = VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO,
.pNext = NULL,
.queueRecordCount = 1,
.pRequestedQueues = &queue,
- .extensionCount = 1,
+ .extensionCount = 1, // TODO : Should query count w/ GetGlobalExtensionInfo
.ppEnabledExtensionNames = ext_names,
.flags = VK_DEVICE_CREATE_VALIDATION_BIT,
};
err = vkEnumerateGpus(demo->inst, 1, &gpu_count, &demo->gpu);
assert(!err && gpu_count == 1);
- for (i = 0; i < device.extensionCount; i++) {
- err = vkGetExtensionSupport(demo->gpu, ext_names[i]);
- assert(!err);
- }
-
err = vkWsiX11AssociateConnection(demo->gpu, &connection);
assert(!err);
static void demo_init_vk(struct demo *demo)
{
+ // TODO : Should query count w/ GetGlobalExtensionInfo, then enable via CreateInstance
const VkApplicationInfo app = {
.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO,
.pNext = NULL,
.pNext = NULL,
.queueRecordCount = 1,
.pRequestedQueues = &queue,
- .extensionCount = 1,
+ .extensionCount = 1, // TODO : Should query count w/ GetGlobalExtensionInfo
.ppEnabledExtensionNames = ext_names,
.flags = VK_DEVICE_CREATE_VALIDATION_BIT,
};
err = vkEnumerateGpus(demo->inst, 1, &gpu_count, &demo->gpu);
assert(!err && gpu_count == 1);
- for (i = 0; i < device.extensionCount; i++) {
- err = vkGetExtensionSupport(demo->gpu, ext_names[i]);
- assert(!err);
- }
-
err = vkWsiX11AssociateConnection(demo->gpu, &connection);
assert(!err);
static void app_gpu_init_extensions(struct app_gpu *gpu)
{
- VkResult err;
+ //VkResult err;
uint32_t i;
+ // TODO : Should query count w/ GetGlobalExtensionInfo,
+ // Then dynamically set extensions based on returned count
static char *known_extensions[] = {
"VK_WSI_X11",
};
for (i = 0; i < ARRAY_SIZE(known_extensions); i++) {
+/*
err = vkGetExtensionSupport(gpu->obj, known_extensions[i]);
if (!err)
- gpu->extension_count++;
+*/
+ gpu->extension_count++;
}
gpu->extensions =
gpu->extension_count = 0;
for (i = 0; i < ARRAY_SIZE(known_extensions); i++) {
+/*
err = vkGetExtensionSupport(gpu->obj, known_extensions[i]);
if (!err)
- gpu->extensions[gpu->extension_count++] = known_extensions[i];
+*/
+ gpu->extensions[gpu->extension_count++] = known_extensions[i];
}
}