You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This structure specifies that we'll be using one color attachment with the format of our swap chain images. We then include this structure in the `pNext` chain of the `vk::GraphicsPipelineCreateInfo` structure:
20
+
This structure specifies that we'll be using one color attachment with the format of our swap chain images. We then include this structure in the `vk::StructureChain`, starting with the `vk::GraphicsPipelineCreateInfo` structure:
Copy file name to clipboardExpand all lines: en/03_Drawing_a_triangle/02_Graphics_pipeline_basics/04_Conclusion.adoc
+23-31Lines changed: 23 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,58 +10,53 @@ Here are the types of objects we have now, as a quick recap:
10
10
* Pipeline layout: the uniform and push values referenced by the shader that can be updated at draw time
11
11
* Dynamic rendering: the formats of the attachments that will be used during rendering
12
12
13
-
All of these combined fully define the functionality of the graphics pipeline, so we can now begin filling in the `VkGraphicsPipelineCreateInfo` structure at the end of the `createGraphicsPipeline` function.
13
+
All of these combined fully define the functionality of the graphics pipeline, so we can now begin filling in the `vk::GraphicsPipelineCreateInfo` structure at the end of the `createGraphicsPipeline` function.
Note that we're using dynamic rendering instead of a traditional render pass, so we set the `renderPass` parameter to `nullptr` and include a `vk::PipelineRenderingCreateInfo` structure in the `pNext` chain. This structure specifies the formats of the attachments that will be used during rendering.
50
+
Note that we're using dynamic rendering instead of a traditional render pass, so we set the `renderPass` parameter to `nullptr` and include a `vk::PipelineRenderingCreateInfo` structure in the `vk::StructureChain`. This structure specifies the formats of the attachments that will be used during rendering.
There are actually two more parameters: `basePipelineHandle` and `basePipelineIndex`.
52
+
There are actually two more members in the vk::GraphicsPipelineCreateInfo: `basePipelineHandle` and `basePipelineIndex`.
58
53
Vulkan allows you to create a new graphics pipeline by deriving from an existing pipeline.
59
54
The idea of pipeline derivatives is that it is less expensive to set up pipelines when they have much functionality in common with an existing pipeline and switching between pipelines from the same parent can also be done quicker.
60
55
You can either specify the handle of an existing pipeline with `basePipelineHandle` or reference another pipeline that is about to be created by index with `basePipelineIndex`.
61
-
Right now there is only a single pipeline, so we'll simply specify a null handle and an invalid index.
62
-
These values are only used if the `VK_PIPELINE_CREATE_DERIVATIVE_BIT` flag is also specified in the `flags` field of `VkGraphicsPipelineCreateInfo`.
56
+
These values are only used if the `vk::PipelineCreateFlagBits::eDerivative` flag is also specified in the `flags` field of `vk::GraphicsPipelineCreateInfo`.
57
+
Right now there is only a single pipeline, so we'll ignore those members.
63
58
64
-
Now prepare for the final step by creating a class member to hold the `VkPipeline` object:
59
+
Now prepare for the final step by creating a class member to hold the `vk::raii::Pipeline` object:
65
60
66
61
[,c++]
67
62
----
@@ -72,14 +67,11 @@ And finally, create the graphics pipeline:
The `vkCreateGraphicsPipelines` function actually has more parameters than the usual object creation functions in Vulkan.
79
-
It is designed to take multiple `VkGraphicsPipelineCreateInfo` objects and create multiple `VkPipeline` objects in a single call.
80
-
81
-
The second parameter, for which we've passed the `VK_NULL_HANDLE` argument, references an optional `VkPipelineCache` object.
82
-
A pipeline cache can be used to store and reuse data relevant to pipeline creation across multiple calls to `vkCreateGraphicsPipelines` and even across program executions if the cache is stored to a file.
73
+
The second parameter, for which we've passed the `nullptr` argument, references an optional `vk::raii::PipelineCache` object.
74
+
A pipeline cache can be used to store and reuse data relevant to pipeline creation across multiple calls to `vk::raii::Pipeline` constructors and even across program executions if the cache is stored to a file.
83
75
This makes it possible to significantly speed up pipeline creation at a later time.
84
76
We'll get into this in the pipeline cache chapter.
0 commit comments