164 uint32_t numQueues = 1;
165 float queuePriority = 1.f;
166 VkDeviceQueueCreateInfo queueCreateInfo[3];
167 queueCreateInfo[0].sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO;
168 queueCreateInfo[0].pNext =
NULL;
169 queueCreateInfo[0].flags = 0;
171 queueCreateInfo[0].queueCount = 1;
172 queueCreateInfo[0].pQueuePriorities = &queuePriority;
173 queueCreateInfo[1].sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO;
174 queueCreateInfo[1].pNext =
NULL;
175 queueCreateInfo[1].flags = 0;
176 queueCreateInfo[1].queueFamilyIndex = 0;
177 queueCreateInfo[1].queueCount = 1;
178 queueCreateInfo[1].pQueuePriorities = &queuePriority;
179 queueCreateInfo[2].sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO;
180 queueCreateInfo[2].pNext =
NULL;
181 queueCreateInfo[2].flags = 0;
182 queueCreateInfo[2].queueFamilyIndex = 0;
183 queueCreateInfo[2].queueCount = 1;
184 queueCreateInfo[2].pQueuePriorities = &queuePriority;
186 VkPhysicalDeviceFeatures wantedDeviceFeatures = {
204 const char *deviceExtensions[] = { VK_KHR_SWAPCHAIN_EXTENSION_NAME };
206 VkDeviceCreateInfo deviceCreateInfo = {
207 .sType = VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO,
208 .pEnabledFeatures = &wantedDeviceFeatures,
209 .ppEnabledExtensionNames = deviceExtensions,
210 .enabledExtensionCount = 1,
211 .enabledLayerCount = 0,
212 .ppEnabledLayerNames =
NULL,
213 .queueCreateInfoCount = numQueues,
214 .pQueueCreateInfos = queueCreateInfo
217 #if VK_HEADER_VERSION > 101
218 const char *validationLayers[] = {
"VK_LAYER_KHRONOS_validation" };
220 const char *validationLayers[] = {
"VK_LAYER_LUNARG_standard_validation" };
225 deviceCreateInfo.enabledLayerCount =
sizeof(validationLayers)/
sizeof(validationLayers[0]);
226 deviceCreateInfo.ppEnabledLayerNames = validationLayers;