@@ -53,7 +53,7 @@ And finally we have the reference to the render pass and the index of the sub
5353pass where this graphics pipeline will be used.
5454
5555``` c++
56- pipelineInfo.basePipelineHandle = VK_NULL_HANDLE;
56+ pipelineInfo.basePipelineHandle = VK_NULL_HANDLE; // Optional
5757pipelineInfo.basePipelineIndex = -1 ; // Optional
5858```
5959
@@ -62,8 +62,12 @@ There are actually two more parameters: `basePipelineHandle` and
6262deriving from an existing pipeline. The idea of pipeline derivatives is that it
6363is less expensive to set up pipelines when they have much functionality in
6464common with an existing pipeline and switching between pipelines from the same
65- parent can also be done quicker. Right now there is only a single pipeline, so
66- we'll simply specify a null handle.
65+ parent can also be done quicker. You can either specify the handle of an
66+ existing pipeline with ` basePipelineHandle ` or reference another pipeline that
67+ is about to be created by index with ` basePipelineIndex ` . Right now there is
68+ only a single pipeline, so we'll simply specify a null handle and an invalid
69+ index. These values are only used if the ` VK_PIPELINE_CREATE_DERIVATIVE_BIT `
70+ flag is also specified in the ` flags ` field of ` VkGraphicsPipelineCreateInfo ` .
6771
6872Now prepare for the final step by creating a class member to hold the
6973` VkPipeline ` object:
@@ -99,4 +103,4 @@ actual framebuffers from the swap chain images and prepare the drawing commands.
99103
100104[ C++ code] ( /code/graphics_pipeline_complete.cpp ) /
101105[ Vertex shader] ( /code/shader_base.vert ) /
102- [ Fragment shader] ( /code/shader_base.frag )
106+ [ Fragment shader] ( /code/shader_base.frag )
0 commit comments