Changeset fe5c3ba in opengl-game for vulkan-game.cpp
- Timestamp:
- Sep 22, 2019, 2:28:22 AM (5 years ago)
- Branches:
- feature/imgui-sdl, master, points-test
- Children:
- a0c5f28
- Parents:
- 90a424f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vulkan-game.cpp
r90a424f rfe5c3ba 90 90 "VK_LAYER_KHRONOS_validation" 91 91 }; 92 const vector<const char*> deviceExtensions = { 93 VK_KHR_SWAPCHAIN_EXTENSION_NAME 94 }; 92 95 93 96 createVulkanInstance(validationLayers); 94 97 setupDebugMessenger(); 95 98 createVulkanSurface(); 96 pickPhysicalDevice( );99 pickPhysicalDevice(deviceExtensions); 97 100 } 98 101 … … 239 242 } 240 243 241 void VulkanGame::pickPhysicalDevice( ) {244 void VulkanGame::pickPhysicalDevice(const vector<const char*>& deviceExtensions) { 242 245 uint32_t deviceCount = 0; 243 246 vkEnumeratePhysicalDevices(instance, &deviceCount, nullptr); … … 252 255 cout << endl << "Graphics cards:" << endl; 253 256 for (const VkPhysicalDevice& device : devices) { 254 if (isDeviceSuitable(device )) {257 if (isDeviceSuitable(device, deviceExtensions)) { 255 258 physicalDevice = device; 256 259 break; … … 264 267 } 265 268 266 bool VulkanGame::isDeviceSuitable(VkPhysicalDevice device) { 267 const vector<const char*> deviceExtensions = { 268 VK_KHR_SWAPCHAIN_EXTENSION_NAME 269 }; 270 269 bool VulkanGame::isDeviceSuitable(VkPhysicalDevice device, const vector<const char*>& deviceExtensions) { 271 270 VkPhysicalDeviceProperties deviceProperties; 272 271 vkGetPhysicalDeviceProperties(device, &deviceProperties);
Note:
See TracChangeset
for help on using the changeset viewer.