Creating a graphics pipeline with vertex and fragment shaders, depth test enabled, and with dynamic viewport and scissor tests
In this recipe, we will see how to create a commonly used graphics pipeline, in which vertex and fragment shaders are active and a depth test is enabled. We will also specify that viewport and scissor tests are set up dynamically.
How to do it...
- Take the handle of a logical device. Use it to initialize a variable of type
VkDevice
namedlogical_device
. - Take the SPIR-V assembly of a vertex shader and use it, along with the
logical_device
variable, to create a shader module. Store it in a variable of typeVkShaderModule
namedvertex_shader_module
(refer to the Creating a shader module recipe). - Take the SPIR-V assembly of a fragment shader and using it, along with the
logical_device
variable, create a second shader module. Store its handle in a variable of typeVkShaderModule
namedfragment_shader_module
(refer to the Creating a shader module recipe). - Create a variable of...