Skip to content

Commit f89d642

Browse files
Merge pull request #550 from stradoc/swapchain-support-text
Swap chain: point extension support check to physical device selection
2 parents ac2e513 + 105755c commit f89d642

1 file changed

Lines changed: 6 additions & 16 deletions

File tree

‎en/03_Drawing_a_triangle/01_Presentation/01_Swap_chain.adoc‎

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,12 @@ into the window system and the surfaces associated with windows, it is not
2222
part of the Vulkan core. You have to enable the `VK_KHR_swapchain` device
2323
extension after querying for its support.
2424

25-
For that purpose we'll first extend the `createLogicalDevice` function to
26-
check if this extension is supported. We've previously seen how to list the
27-
extensions that are supported by a `vk::raii::PhysicalDevice`, so doing that should
28-
be fairly straightforward. Note that the Vulkan header file provides a nice
29-
macro `vk::KHRSwapchainExtensionName` that is defined as
30-
`VK_KHR_swapchain`. The advantage of using this macro is that the compiler
31-
will catch misspellings.
32-
33-
First declare a list of required device extensions, similar to the list of
34-
validation layers to enable.
35-
36-
[,c++]
37-
----
38-
std::vector<const char*> requiredDeviceExtension = {
39-
vk::KHRSwapchainExtensionName};
40-
----
25+
We already queried for it in `isDeviceSuitable` during
26+
xref:03_Drawing_a_triangle/00_Setup/03_Physical_devices_and_queue_families.adoc#_required_extension_check[physical device selection],
27+
which only selects devices that support every extension within `requiredDeviceExtension`.
28+
Note that the Vulkan header file provides a nice macro `vk::KHRSwapchainExtensionName`
29+
that is defined as `VK_KHR_swapchain`. The advantage of using this macro is that the
30+
compiler will catch misspellings.
4131

4232
It should be noted that the availability of a presentation queue,
4333
as we checked in the previous chapter, implies that the swap chain extension

0 commit comments

Comments
 (0)