Skip to content
This repository was archived by the owner on Mar 31, 2023. It is now read-only.

Commit 340a7a6

Browse files
committed
Fixed small mistake in device selection loop. Added info about selected device name in Tutorial01.
1 parent 71151a6 commit 340a7a6

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

Project/Common/VulkanCommon.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ namespace ApiWithoutSecrets {
275275
for( uint32_t i = 0; i < num_devices; ++i ) {
276276
if( CheckPhysicalDeviceProperties( physical_devices[i], selected_graphics_queue_family_index, selected_present_queue_family_index ) ) {
277277
Vulkan.PhysicalDevice = physical_devices[i];
278+
break;
278279
}
279280
}
280281
if( Vulkan.PhysicalDevice == VK_NULL_HANDLE ) {

Project/Tutorial01/Tutorial01.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ namespace ApiWithoutSecrets {
165165
for( uint32_t i = 0; i < num_devices; ++i ) {
166166
if( CheckPhysicalDeviceProperties( physical_devices[i], selected_queue_family_index ) ) {
167167
selected_physical_device = physical_devices[i];
168+
break;
168169
}
169170
}
170171
if( selected_physical_device == VK_NULL_HANDLE ) {
@@ -235,6 +236,7 @@ namespace ApiWithoutSecrets {
235236
if( (queue_family_properties[i].queueCount > 0) &&
236237
(queue_family_properties[i].queueFlags & VK_QUEUE_GRAPHICS_BIT) ) {
237238
queue_family_index = i;
239+
std::cout << "Selected device: " << device_properties.deviceName << std::endl;
238240
return true;
239241
}
240242
}

Project/Tutorial02/Tutorial02.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ namespace ApiWithoutSecrets {
251251
for( uint32_t i = 0; i < num_devices; ++i ) {
252252
if( CheckPhysicalDeviceProperties( physical_devices[i], selected_graphics_queue_family_index, selected_present_queue_family_index ) ) {
253253
Vulkan.PhysicalDevice = physical_devices[i];
254+
break;
254255
}
255256
}
256257
if( Vulkan.PhysicalDevice == VK_NULL_HANDLE ) {

0 commit comments

Comments
 (0)