diff --git a/src/ptk_vk/device.c b/src/ptk_vk/device.c index e03b022..79b2cb4 100644 --- a/src/ptk_vk/device.c +++ b/src/ptk_vk/device.c @@ -18,7 +18,7 @@ VkQueue g_graphics_queue; VkQueue g_present_queue; QueueFamilyIndices g_queue_family_indices = {0}; -const size_t g_queue_family_count = sizeof(QueueFamilyIndices) / sizeof(PTK_OPTION(uint32_t)); +static const size_t m_queue_family_count = sizeof(QueueFamilyIndices) / sizeof(PTK_OPTION(uint32_t)); PTK_LIST_DEFINE(VkQueueFamilyProperties); @@ -96,9 +96,9 @@ PTK_OPTION(VkDevice) vk_create_logical_dev(VkPhysicalDevice physical_dev, VkSurf return PTK_OPTION_NONE(VkDevice); } - VkDeviceQueueCreateInfo queue_create_infos[g_queue_family_count]; + VkDeviceQueueCreateInfo queue_create_infos[m_queue_family_count]; - for (size_t i = 0; i < g_queue_family_count; ++i) { + for (size_t i = 0; i < m_queue_family_count; ++i) { const PTK_OPTION(uint32_t) index = *(((PTK_OPTION(uint32_t) *)&g_queue_family_indices) + i); queue_create_infos[i] = (VkDeviceQueueCreateInfo){ @@ -120,7 +120,7 @@ PTK_OPTION(VkDevice) vk_create_logical_dev(VkPhysicalDevice physical_dev, VkSurf .sType = VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO, .pNext = NULL, .flags = 0, - .queueCreateInfoCount = g_queue_family_count, + .queueCreateInfoCount = m_queue_family_count, .pQueueCreateInfos = queue_create_infos, .enabledLayerCount = validation_layers.size, .ppEnabledLayerNames = validation_layers.data, diff --git a/src/ptk_vk/device.h b/src/ptk_vk/device.h index daea122..5303f5d 100644 --- a/src/ptk_vk/device.h +++ b/src/ptk_vk/device.h @@ -21,7 +21,6 @@ typedef struct { } QueueFamilyIndices; extern QueueFamilyIndices g_queue_family_indices; -extern const size_t g_queue_family_count; extern VkQueue g_graphics_queue; extern VkQueue g_present_queue;