Creating a graphics pipeline
A graphics pipeline is the object that allows us to draw anything on screen. It controls how the graphics hardware performs all the drawing-related operations, which transform vertices provided by the application into fragments appearing on screen. Through it we specify shader programs used during drawing, the state and parameters of tests such as depth and stencil, or how the final color is calculated and written to any of the subpass attachments. It is one of the most important objects used by our application. Before we can draw anything, we need to create a graphics pipeline. If we want, we can create multiple pipelines at once.
How to do it...
- Take the handle of a logical device and store it in a variable of type
VkDevice
namedlogical_device
. - Create a variable of type
std::vector<VkGraphicsPipelineCreateInfo>
namedgraphics_pipeline_create_infos
. For each pipeline that should be created, add an element to thegraphics_pipeline_create_infos
vector describing...