diff --git a/Project/Common/VulkanCommon.cpp b/Project/Common/VulkanCommon.cpp index df12914..a854ecb 100644 --- a/Project/Common/VulkanCommon.cpp +++ b/Project/Common/VulkanCommon.cpp @@ -275,6 +275,7 @@ namespace ApiWithoutSecrets { for( uint32_t i = 0; i < num_devices; ++i ) { if( CheckPhysicalDeviceProperties( physical_devices[i], selected_graphics_queue_family_index, selected_present_queue_family_index ) ) { Vulkan.PhysicalDevice = physical_devices[i]; + break; } } if( Vulkan.PhysicalDevice == VK_NULL_HANDLE ) { diff --git a/Project/Tutorial01/Tutorial01.cpp b/Project/Tutorial01/Tutorial01.cpp index e59a352..06af1db 100644 --- a/Project/Tutorial01/Tutorial01.cpp +++ b/Project/Tutorial01/Tutorial01.cpp @@ -165,6 +165,7 @@ namespace ApiWithoutSecrets { for( uint32_t i = 0; i < num_devices; ++i ) { if( CheckPhysicalDeviceProperties( physical_devices[i], selected_queue_family_index ) ) { selected_physical_device = physical_devices[i]; + break; } } if( selected_physical_device == VK_NULL_HANDLE ) { @@ -235,6 +236,7 @@ namespace ApiWithoutSecrets { if( (queue_family_properties[i].queueCount > 0) && (queue_family_properties[i].queueFlags & VK_QUEUE_GRAPHICS_BIT) ) { queue_family_index = i; + std::cout << "Selected device: " << device_properties.deviceName << std::endl; return true; } } diff --git a/Project/Tutorial02/Tutorial02.cpp b/Project/Tutorial02/Tutorial02.cpp index 99aa493..2c789d5 100644 --- a/Project/Tutorial02/Tutorial02.cpp +++ b/Project/Tutorial02/Tutorial02.cpp @@ -251,6 +251,7 @@ namespace ApiWithoutSecrets { for( uint32_t i = 0; i < num_devices; ++i ) { if( CheckPhysicalDeviceProperties( physical_devices[i], selected_graphics_queue_family_index, selected_present_queue_family_index ) ) { Vulkan.PhysicalDevice = physical_devices[i]; + break; } } if( Vulkan.PhysicalDevice == VK_NULL_HANDLE ) {