Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions attachments/05_window_surface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,16 @@ class HelloTriangleApplication
// Check if the physicalDevice supports the Vulkan 1.3 API version
bool supportsVulkan1_3 = physicalDevice.getProperties().apiVersion >= VK_API_VERSION_1_3;

// Check if any of the queue families support graphics operations
auto queueFamilies = physicalDevice.getQueueFamilyProperties();
bool supportsGraphics = std::ranges::any_of(queueFamilies, [](auto const &qfp) { return !!(qfp.queueFlags & vk::QueueFlagBits::eGraphics); });
// Check if any of the queue families support both graphics and presentation to our surface
auto queueFamilies = physicalDevice.getQueueFamilyProperties();
uint32_t qfpIndex = 0;
bool supportsGraphicsAndPresent =
std::ranges::any_of(queueFamilies,
[&physicalDevice, &surface = this->surface, &qfpIndex](auto const &qfp) {
bool const suitable = (qfp.queueFlags & vk::QueueFlagBits::eGraphics) && physicalDevice.getSurfaceSupportKHR(qfpIndex, *surface);
qfpIndex++;
return suitable;
});

// Check if all required physicalDevice extensions are available
auto availableDeviceExtensions = physicalDevice.enumerateDeviceExtensionProperties();
Expand All @@ -189,7 +196,7 @@ class HelloTriangleApplication
features.template get<vk::PhysicalDeviceExtendedDynamicStateFeaturesEXT>().extendedDynamicState;

// Return true if the physicalDevice meets all the criteria
return supportsVulkan1_3 && supportsGraphics && supportsAllRequiredExtensions && supportsRequiredFeatures;
return supportsVulkan1_3 && supportsGraphicsAndPresent && supportsAllRequiredExtensions && supportsRequiredFeatures;
}

void pickPhysicalDevice()
Expand Down
15 changes: 11 additions & 4 deletions attachments/06_swap_chain_creation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,16 @@ class HelloTriangleApplication
// Check if the physicalDevice supports the Vulkan 1.3 API version
bool supportsVulkan1_3 = physicalDevice.getProperties().apiVersion >= VK_API_VERSION_1_3;

// Check if any of the queue families support graphics operations
auto queueFamilies = physicalDevice.getQueueFamilyProperties();
bool supportsGraphics = std::ranges::any_of(queueFamilies, [](auto const &qfp) { return !!(qfp.queueFlags & vk::QueueFlagBits::eGraphics); });
// Check if any of the queue families support both graphics and presentation to our surface
auto queueFamilies = physicalDevice.getQueueFamilyProperties();
uint32_t qfpIndex = 0;
bool supportsGraphicsAndPresent =
std::ranges::any_of(queueFamilies,
[&physicalDevice, &surface = this->surface, &qfpIndex](auto const &qfp) {
bool const suitable = (qfp.queueFlags & vk::QueueFlagBits::eGraphics) && physicalDevice.getSurfaceSupportKHR(qfpIndex, *surface);
qfpIndex++;
return suitable;
});

// Check if all required physicalDevice extensions are available
auto availableDeviceExtensions = physicalDevice.enumerateDeviceExtensionProperties();
Expand All @@ -197,7 +204,7 @@ class HelloTriangleApplication
features.template get<vk::PhysicalDeviceExtendedDynamicStateFeaturesEXT>().extendedDynamicState;

// Return true if the physicalDevice meets all the criteria
return supportsVulkan1_3 && supportsGraphics && supportsAllRequiredExtensions && supportsRequiredFeatures;
return supportsVulkan1_3 && supportsGraphicsAndPresent && supportsAllRequiredExtensions && supportsRequiredFeatures;
}

void pickPhysicalDevice()
Expand Down
15 changes: 11 additions & 4 deletions attachments/07_image_views.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,16 @@ class HelloTriangleApplication
// Check if the physicalDevice supports the Vulkan 1.3 API version
bool supportsVulkan1_3 = physicalDevice.getProperties().apiVersion >= VK_API_VERSION_1_3;

// Check if any of the queue families support graphics operations
auto queueFamilies = physicalDevice.getQueueFamilyProperties();
bool supportsGraphics = std::ranges::any_of(queueFamilies, [](auto const &qfp) { return !!(qfp.queueFlags & vk::QueueFlagBits::eGraphics); });
// Check if any of the queue families support both graphics and presentation to our surface
auto queueFamilies = physicalDevice.getQueueFamilyProperties();
uint32_t qfpIndex = 0;
bool supportsGraphicsAndPresent =
std::ranges::any_of(queueFamilies,
[&physicalDevice, &surface = this->surface, &qfpIndex](auto const &qfp) {
bool const suitable = (qfp.queueFlags & vk::QueueFlagBits::eGraphics) && physicalDevice.getSurfaceSupportKHR(qfpIndex, *surface);
qfpIndex++;
return suitable;
});

// Check if all required physicalDevice extensions are available
auto availableDeviceExtensions = physicalDevice.enumerateDeviceExtensionProperties();
Expand All @@ -198,7 +205,7 @@ class HelloTriangleApplication
features.template get<vk::PhysicalDeviceExtendedDynamicStateFeaturesEXT>().extendedDynamicState;

// Return true if the physicalDevice meets all the criteria
return supportsVulkan1_3 && supportsGraphics && supportsAllRequiredExtensions && supportsRequiredFeatures;
return supportsVulkan1_3 && supportsGraphicsAndPresent && supportsAllRequiredExtensions && supportsRequiredFeatures;
}

void pickPhysicalDevice()
Expand Down
15 changes: 11 additions & 4 deletions attachments/08_graphics_pipeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,16 @@ class HelloTriangleApplication
// Check if the physicalDevice supports the Vulkan 1.3 API version
bool supportsVulkan1_3 = physicalDevice.getProperties().apiVersion >= VK_API_VERSION_1_3;

// Check if any of the queue families support graphics operations
auto queueFamilies = physicalDevice.getQueueFamilyProperties();
bool supportsGraphics = std::ranges::any_of(queueFamilies, [](auto const &qfp) { return !!(qfp.queueFlags & vk::QueueFlagBits::eGraphics); });
// Check if any of the queue families support both graphics and presentation to our surface
auto queueFamilies = physicalDevice.getQueueFamilyProperties();
uint32_t qfpIndex = 0;
bool supportsGraphicsAndPresent =
std::ranges::any_of(queueFamilies,
[&physicalDevice, &surface = this->surface, &qfpIndex](auto const &qfp) {
bool const suitable = (qfp.queueFlags & vk::QueueFlagBits::eGraphics) && physicalDevice.getSurfaceSupportKHR(qfpIndex, *surface);
qfpIndex++;
return suitable;
});

// Check if all required physicalDevice extensions are available
auto availableDeviceExtensions = physicalDevice.enumerateDeviceExtensionProperties();
Expand All @@ -199,7 +206,7 @@ class HelloTriangleApplication
features.template get<vk::PhysicalDeviceExtendedDynamicStateFeaturesEXT>().extendedDynamicState;

// Return true if the physicalDevice meets all the criteria
return supportsVulkan1_3 && supportsGraphics && supportsAllRequiredExtensions && supportsRequiredFeatures;
return supportsVulkan1_3 && supportsGraphicsAndPresent && supportsAllRequiredExtensions && supportsRequiredFeatures;
}

void pickPhysicalDevice()
Expand Down
15 changes: 11 additions & 4 deletions attachments/09_shader_modules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,16 @@ class HelloTriangleApplication
// Check if the physicalDevice supports the Vulkan 1.3 API version
bool supportsVulkan1_3 = physicalDevice.getProperties().apiVersion >= VK_API_VERSION_1_3;

// Check if any of the queue families support graphics operations
auto queueFamilies = physicalDevice.getQueueFamilyProperties();
bool supportsGraphics = std::ranges::any_of(queueFamilies, [](auto const &qfp) { return !!(qfp.queueFlags & vk::QueueFlagBits::eGraphics); });
// Check if any of the queue families support both graphics and presentation to our surface
auto queueFamilies = physicalDevice.getQueueFamilyProperties();
uint32_t qfpIndex = 0;
bool supportsGraphicsAndPresent =
std::ranges::any_of(queueFamilies,
[&physicalDevice, &surface = this->surface, &qfpIndex](auto const &qfp) {
bool const suitable = (qfp.queueFlags & vk::QueueFlagBits::eGraphics) && physicalDevice.getSurfaceSupportKHR(qfpIndex, *surface);
qfpIndex++;
return suitable;
});

// Check if all required physicalDevice extensions are available
auto availableDeviceExtensions = physicalDevice.enumerateDeviceExtensionProperties();
Expand All @@ -200,7 +207,7 @@ class HelloTriangleApplication
features.template get<vk::PhysicalDeviceExtendedDynamicStateFeaturesEXT>().extendedDynamicState;

// Return true if the physicalDevice meets all the criteria
return supportsVulkan1_3 && supportsGraphics && supportsAllRequiredExtensions && supportsRequiredFeatures;
return supportsVulkan1_3 && supportsGraphicsAndPresent && supportsAllRequiredExtensions && supportsRequiredFeatures;
}

void pickPhysicalDevice()
Expand Down
15 changes: 11 additions & 4 deletions attachments/10_fixed_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,16 @@ class HelloTriangleApplication
// Check if the physicalDevice supports the Vulkan 1.3 API version
bool supportsVulkan1_3 = physicalDevice.getProperties().apiVersion >= VK_API_VERSION_1_3;

// Check if any of the queue families support graphics operations
auto queueFamilies = physicalDevice.getQueueFamilyProperties();
bool supportsGraphics = std::ranges::any_of(queueFamilies, [](auto const &qfp) { return !!(qfp.queueFlags & vk::QueueFlagBits::eGraphics); });
// Check if any of the queue families support both graphics and presentation to our surface
auto queueFamilies = physicalDevice.getQueueFamilyProperties();
uint32_t qfpIndex = 0;
bool supportsGraphicsAndPresent =
std::ranges::any_of(queueFamilies,
[&physicalDevice, &surface = this->surface, &qfpIndex](auto const &qfp) {
bool const suitable = (qfp.queueFlags & vk::QueueFlagBits::eGraphics) && physicalDevice.getSurfaceSupportKHR(qfpIndex, *surface);
qfpIndex++;
return suitable;
});

// Check if all required physicalDevice extensions are available
auto availableDeviceExtensions = physicalDevice.enumerateDeviceExtensionProperties();
Expand All @@ -202,7 +209,7 @@ class HelloTriangleApplication
features.template get<vk::PhysicalDeviceExtendedDynamicStateFeaturesEXT>().extendedDynamicState;

// Return true if the physicalDevice meets all the criteria
return supportsVulkan1_3 && supportsGraphics && supportsAllRequiredExtensions && supportsRequiredFeatures;
return supportsVulkan1_3 && supportsGraphicsAndPresent && supportsAllRequiredExtensions && supportsRequiredFeatures;
}

void pickPhysicalDevice()
Expand Down
15 changes: 11 additions & 4 deletions attachments/12_graphics_pipeline_complete.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,16 @@ class HelloTriangleApplication
// Check if the physicalDevice supports the Vulkan 1.3 API version
bool supportsVulkan1_3 = physicalDevice.getProperties().apiVersion >= VK_API_VERSION_1_3;

// Check if any of the queue families support graphics operations
auto queueFamilies = physicalDevice.getQueueFamilyProperties();
bool supportsGraphics = std::ranges::any_of(queueFamilies, [](auto const &qfp) { return !!(qfp.queueFlags & vk::QueueFlagBits::eGraphics); });
// Check if any of the queue families support both graphics and presentation to our surface
auto queueFamilies = physicalDevice.getQueueFamilyProperties();
uint32_t qfpIndex = 0;
bool supportsGraphicsAndPresent =
std::ranges::any_of(queueFamilies,
[&physicalDevice, &surface = this->surface, &qfpIndex](auto const &qfp) {
bool const suitable = (qfp.queueFlags & vk::QueueFlagBits::eGraphics) && physicalDevice.getSurfaceSupportKHR(qfpIndex, *surface);
qfpIndex++;
return suitable;
});

// Check if all required physicalDevice extensions are available
auto availableDeviceExtensions = physicalDevice.enumerateDeviceExtensionProperties();
Expand All @@ -203,7 +210,7 @@ class HelloTriangleApplication
features.template get<vk::PhysicalDeviceExtendedDynamicStateFeaturesEXT>().extendedDynamicState;

// Return true if the physicalDevice meets all the criteria
return supportsVulkan1_3 && supportsGraphics && supportsAllRequiredExtensions && supportsRequiredFeatures;
return supportsVulkan1_3 && supportsGraphicsAndPresent && supportsAllRequiredExtensions && supportsRequiredFeatures;
}

void pickPhysicalDevice()
Expand Down
15 changes: 11 additions & 4 deletions attachments/14_command_buffers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,16 @@ class HelloTriangleApplication
// Check if the physicalDevice supports the Vulkan 1.3 API version
bool supportsVulkan1_3 = physicalDevice.getProperties().apiVersion >= VK_API_VERSION_1_3;

// Check if any of the queue families support graphics operations
auto queueFamilies = physicalDevice.getQueueFamilyProperties();
bool supportsGraphics = std::ranges::any_of(queueFamilies, [](auto const &qfp) { return !!(qfp.queueFlags & vk::QueueFlagBits::eGraphics); });
// Check if any of the queue families support both graphics and presentation to our surface
auto queueFamilies = physicalDevice.getQueueFamilyProperties();
uint32_t qfpIndex = 0;
bool supportsGraphicsAndPresent =
std::ranges::any_of(queueFamilies,
[&physicalDevice, &surface = this->surface, &qfpIndex](auto const &qfp) {
bool const suitable = (qfp.queueFlags & vk::QueueFlagBits::eGraphics) && physicalDevice.getSurfaceSupportKHR(qfpIndex, *surface);
qfpIndex++;
return suitable;
});

// Check if all required physicalDevice extensions are available
auto availableDeviceExtensions = physicalDevice.enumerateDeviceExtensionProperties();
Expand All @@ -208,7 +215,7 @@ class HelloTriangleApplication
features.template get<vk::PhysicalDeviceExtendedDynamicStateFeaturesEXT>().extendedDynamicState;

// Return true if the physicalDevice meets all the criteria
return supportsVulkan1_3 && supportsGraphics && supportsAllRequiredExtensions && supportsRequiredFeatures;
return supportsVulkan1_3 && supportsGraphicsAndPresent && supportsAllRequiredExtensions && supportsRequiredFeatures;
}

void pickPhysicalDevice()
Expand Down
15 changes: 11 additions & 4 deletions attachments/15_hello_triangle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,16 @@ class HelloTriangleApplication
// Check if the physicalDevice supports the Vulkan 1.3 API version
bool supportsVulkan1_3 = physicalDevice.getProperties().apiVersion >= VK_API_VERSION_1_3;

// Check if any of the queue families support graphics operations
auto queueFamilies = physicalDevice.getQueueFamilyProperties();
bool supportsGraphics = std::ranges::any_of(queueFamilies, [](auto const &qfp) { return !!(qfp.queueFlags & vk::QueueFlagBits::eGraphics); });
// Check if any of the queue families support both graphics and presentation to our surface
auto queueFamilies = physicalDevice.getQueueFamilyProperties();
uint32_t qfpIndex = 0;
bool supportsGraphicsAndPresent =
std::ranges::any_of(queueFamilies,
[&physicalDevice, &surface = this->surface, &qfpIndex](auto const &qfp) {
bool const suitable = (qfp.queueFlags & vk::QueueFlagBits::eGraphics) && physicalDevice.getSurfaceSupportKHR(qfpIndex, *surface);
qfpIndex++;
return suitable;
});

// Check if all required physicalDevice extensions are available
auto availableDeviceExtensions = physicalDevice.enumerateDeviceExtensionProperties();
Expand All @@ -217,7 +224,7 @@ class HelloTriangleApplication
features.template get<vk::PhysicalDeviceExtendedDynamicStateFeaturesEXT>().extendedDynamicState;

// Return true if the physicalDevice meets all the criteria
return supportsVulkan1_3 && supportsGraphics && supportsAllRequiredExtensions && supportsRequiredFeatures;
return supportsVulkan1_3 && supportsGraphicsAndPresent && supportsAllRequiredExtensions && supportsRequiredFeatures;
}

void pickPhysicalDevice()
Expand Down
15 changes: 11 additions & 4 deletions attachments/16_frames_in_flight.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,16 @@ class HelloTriangleApplication
// Check if the physicalDevice supports the Vulkan 1.3 API version
bool supportsVulkan1_3 = physicalDevice.getProperties().apiVersion >= VK_API_VERSION_1_3;

// Check if any of the queue families support graphics operations
auto queueFamilies = physicalDevice.getQueueFamilyProperties();
bool supportsGraphics = std::ranges::any_of(queueFamilies, [](auto const &qfp) { return !!(qfp.queueFlags & vk::QueueFlagBits::eGraphics); });
// Check if any of the queue families support both graphics and presentation to our surface
auto queueFamilies = physicalDevice.getQueueFamilyProperties();
uint32_t qfpIndex = 0;
bool supportsGraphicsAndPresent =
std::ranges::any_of(queueFamilies,
[&physicalDevice, &surface = this->surface, &qfpIndex](auto const &qfp) {
bool const suitable = (qfp.queueFlags & vk::QueueFlagBits::eGraphics) && physicalDevice.getSurfaceSupportKHR(qfpIndex, *surface);
qfpIndex++;
return suitable;
});

// Check if all required physicalDevice extensions are available
auto availableDeviceExtensions = physicalDevice.enumerateDeviceExtensionProperties();
Expand All @@ -220,7 +227,7 @@ class HelloTriangleApplication
features.template get<vk::PhysicalDeviceExtendedDynamicStateFeaturesEXT>().extendedDynamicState;

// Return true if the physicalDevice meets all the criteria
return supportsVulkan1_3 && supportsGraphics && supportsAllRequiredExtensions && supportsRequiredFeatures;
return supportsVulkan1_3 && supportsGraphicsAndPresent && supportsAllRequiredExtensions && supportsRequiredFeatures;
}

void pickPhysicalDevice()
Expand Down
15 changes: 11 additions & 4 deletions attachments/17_swap_chain_recreation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,16 @@ class HelloTriangleApplication
// Check if the physicalDevice supports the Vulkan 1.3 API version
bool supportsVulkan1_3 = physicalDevice.getProperties().apiVersion >= VK_API_VERSION_1_3;

// Check if any of the queue families support graphics operations
auto queueFamilies = physicalDevice.getQueueFamilyProperties();
bool supportsGraphics = std::ranges::any_of(queueFamilies, [](auto const &qfp) { return !!(qfp.queueFlags & vk::QueueFlagBits::eGraphics); });
// Check if any of the queue families support both graphics and presentation to our surface
auto queueFamilies = physicalDevice.getQueueFamilyProperties();
uint32_t qfpIndex = 0;
bool supportsGraphicsAndPresent =
std::ranges::any_of(queueFamilies,
[&physicalDevice, &surface = this->surface, &qfpIndex](auto const &qfp) {
bool const suitable = (qfp.queueFlags & vk::QueueFlagBits::eGraphics) && physicalDevice.getSurfaceSupportKHR(qfpIndex, *surface);
qfpIndex++;
return suitable;
});

// Check if all required physicalDevice extensions are available
auto availableDeviceExtensions = physicalDevice.enumerateDeviceExtensionProperties();
Expand All @@ -253,7 +260,7 @@ class HelloTriangleApplication
features.template get<vk::PhysicalDeviceExtendedDynamicStateFeaturesEXT>().extendedDynamicState;

// Return true if the physicalDevice meets all the criteria
return supportsVulkan1_3 && supportsGraphics && supportsAllRequiredExtensions && supportsRequiredFeatures;
return supportsVulkan1_3 && supportsGraphicsAndPresent && supportsAllRequiredExtensions && supportsRequiredFeatures;
}

void pickPhysicalDevice()
Expand Down
Loading
Loading