Specifying a pipeline rasterization state
The rasterization process generates fragments (pixels) from the assembled polygons. The viewport state is used to specify where, in the framebuffer coordinates, fragments will be generated. To specify how (if at all) fragments are generated, we need to prepare a rasterization state.
How to do it...
- Create a variable of type
VkPipelineRasterizationStateCreateInfo
namedrasterization_state_create_info
. Use the following values to initialize its members:VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO
value forsType
.nullptr
value forpNext
.0
value forflags
.- For
depthClampEnable
use atrue
value if a depth value for fragments whose depth is outside of the min/max range specified in a viewport state should be clamped within this range, or use afalse
value if fragments with depth outside of the this range should be clipped (discarded); when thedepthClampEnable
feature is not enabled only afalse
value can be specified. - For
rasterizerDiscardEnable...