[−][src]Macro vulkayes_core::create_graphics_pipeline
Graphics pipeline creation macro that makes it easier to specify parameters.
This macro expands to an item. To use the generated vk::GraphicsPipelineCreateInfoBuilder
,
the variable expanded from $create_info_variable_name
is introduced into the scope after calling this macro.
The builder is only valid for the lifetime of the calling scope because it borrows from variables declared inside
this macro. Calling build
on the builder and then returning it is undefined behavior!. TODO
The parameters are split into several sections grouping similar paramters. The following list shows
separate sections, their fields and the types of arguments expected. ?
marks an optional parameter.
- Shaders - Parameters affecting shader stages, input descriptions and primitive topology.
stages
- array of binding expressions:module, entry?, spec? => point
:module
- value of typeShaderModule
entry?
- value of typeShaderEntryPoint
, default:ShaderEntryPoint::default()
spec?
- any value definingfn specialization_info(&self) -> vk::SpecializationInfoBuilder
, default: unset (null pointer)point
-> value of typevk::ShaderStageFlags
input
- tokens passed directly tovertex_input_description!
macrotopology
- value of typevk::PrimitiveTopology
primitive_restart?
- value of typebool
, default:false
- Tessellation - Parameters affecting tessellation.
patch_control_points
? - value of typeu32
, default:0
- Viewport - Parameters affecting viewports and scissors.
viewports
- tokens passed directly toviewport_scissor_expr!
macro
- Rasterization - Parameters affecting rasterization, clipping and clamping.
depth_clamp?
- value of typebool
, default:false
depth_clip?
- value of typebool
, default: unset (extension struct not passed)discard?
- value of typebool
, default:false
polygon_mode
- value of typePolygonMode
depth_bias?
- value of typeDepthBias
, default:DepthBias::default()
- Multisampling - Parameters affecting multisampling.
samples
- value of typevk::SampleCountFlags
sample_shading?
- value of typeSampleShading
, default:SampleShading::default()
sample_mask?
- value that borrows as&[u32]
, default: unset (null pointer)alpha_to_coverage?
- value of typebool
, default:false
alpha_to_one?
- value of typebool
, default:false
- DepthStencil - Parameters affecting depth and stencil tests.
depth
- value of typeDepthTest
depth_bounds
? - value of typeDepthBoundsTest
, default:DepthBoundsTest::default()
stencil
? - value of typeStencilTest
, default:StencilTest::default()
- ColorBlend - Parameters affecting color blending and operations.
logic_op?
- value of typeBlendLogicOp
, default:BlendLogicOp::default()
attachments
- array of blending expressions passed directly tocolor_blend_state_expr!
macroblend_constants?
- value of typeOption<[f32; 4]>
, default:Some([0.0; 4])
,None
means to enable dynamic state
- Deps - Parameters needed as dependencies.
layout
- any value definingfn handle(&self) -> vk::PipelineLayout
render_pass
- any value definingfn handle(&self) -> vk::RenderPass
subpass?
- value of typeu32
, default:0
Note that some sections are optional altogether, however, not specifying a section means it won't be included at all in the
create info and no defaults will be provided (the struct pointer will be null). Commonly only the Tessellation
section is left out,
but with rasterization disabled the Viewport
, Multisampling
, DepthStencil
and ColorBlend
sections can be left out as well.
DepthStencil
and ColorBlend
also have additional cases where they can be left out: https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkGraphicsPipelineCreateInfo.html.