Skip to content

Commit d4a3d66

Browse files
committed
01_Swap_Chain fix grammar and formatting.
1 parent 4e36540 commit d4a3d66

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

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

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ before we visualize them on the screen. This infrastructure is
88
known as the *swap chain* and must be created explicitly in Vulkan. The swap
99
chain is essentially a queue of images that are waiting to be presented to the
1010
screen. Our application will acquire such an image to draw to it, and then
11-
return it to the queue. How exactly the queue works. The conditions for
11+
return it to the queue. How exactly the queue works and the conditions for
1212
presenting an image from the queue depend on how the swap chain is set up. However,
1313
the general purpose of the swap chain is to synchronize the presentation of
1414
images with the refresh rate of the screen.
@@ -326,8 +326,8 @@ void initVulkan() {
326326
}
327327
328328
void createSwapChain() {
329-
auto surfaceCapabilities = physicalDevice.getSurfaceCapabilitiesKHR( surface );
330-
swapChainSurfaceFormat = chooseSwapSurfaceFormat(physicalDevice.getSurfaceFormatsKHR( surface ));
329+
auto surfaceCapabilities = physicalDevice.getSurfaceCapabilitiesKHR( *surface );
330+
swapChainSurfaceFormat = chooseSwapSurfaceFormat(physicalDevice.getSurfaceFormatsKHR( *surface ));
331331
swapChainExtent = chooseSwapExtent(surfaceCapabilities);
332332
auto minImageCount = std::max( 3u, surfaceCapabilities.minImageCount );
333333
minImageCount = ( surfaceCapabilities.maxImageCount > 0 && minImageCount > surfaceCapabilities.maxImageCount ) ? surfaceCapabilities.maxImageCount : minImageCount;
@@ -370,14 +370,20 @@ object so it is among the larger createInfo structures in Vulkan:
370370
[,c++]
371371
----
372372
vk::SwapchainCreateInfoKHR swapChainCreateInfo{
373-
.flags = vk::SwapchainCreateFlagsKHR(), .
374-
surface = surface, .minImageCount = minImageCount,
375-
.imageFormat = swapChainSurfaceFormat.format, .imageColorSpace = swapChainSurfaceFormat.colorSpace,
376-
.imageExtent = swapChainExtent, .imageArrayLayers =1,
377-
.imageUsage = vk::ImageUsageFlagBits::eColorAttachment, .imageSharingMode = vk::SharingMode::eExclusive,
378-
.preTransform = surfaceCapabilities.currentTransform, .compositeAlpha = vk::CompositeAlphaFlagBitsKHR::eOpaque,
379-
.presentMode = chooseSwapPresentMode(physicalDevice.getSurfacePresentModesKHR( surface )),
380-
.clipped = true, .oldSwapchain = nullptr };
373+
.flags = vk::SwapchainCreateFlagsKHR(),
374+
.surface = *surface,
375+
.minImageCount = minImageCount,
376+
.imageFormat = swapChainSurfaceFormat.format,
377+
.imageColorSpace = swapChainSurfaceFormat.colorSpace,
378+
.imageExtent = swapChainExtent,
379+
.imageArrayLayers =1,
380+
.imageUsage = vk::ImageUsageFlagBits::eColorAttachment,
381+
.imageSharingMode = vk::SharingMode::eExclusive,
382+
.preTransform = surfaceCapabilities.currentTransform,
383+
.compositeAlpha = vk::CompositeAlphaFlagBitsKHR::eOpaque,
384+
.presentMode = chooseSwapPresentMode(physicalDevice.getSurfacePresentModesKHR( *surface )),
385+
.clipped = true,
386+
.oldSwapchain = nullptr };
381387
----
382388

383389
The `imageArrayLayers` specifies the number of layers each image consists of.

0 commit comments

Comments
 (0)