mirror of
https://github.com/vulkano-rs/vulkano.git
synced 2024-11-23 07:15:31 +00:00
Don't pass an empty dynamic states list, as it is forbidden
This commit is contained in:
parent
8b1cb63f4f
commit
483b08984f
@ -821,12 +821,16 @@ impl<Vdef, L, Rp> GraphicsPipeline<Vdef, L, Rp>
|
||||
}
|
||||
};
|
||||
|
||||
let dynamic_states = vk::PipelineDynamicStateCreateInfo {
|
||||
sType: vk::STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO,
|
||||
pNext: ptr::null(),
|
||||
flags: 0, // reserved
|
||||
dynamicStateCount: dynamic_states.len() as u32,
|
||||
pDynamicStates: dynamic_states.as_ptr(),
|
||||
let dynamic_states = if !dynamic_states.is_empty() {
|
||||
Some(vk::PipelineDynamicStateCreateInfo {
|
||||
sType: vk::STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO,
|
||||
pNext: ptr::null(),
|
||||
flags: 0, // reserved
|
||||
dynamicStateCount: dynamic_states.len() as u32,
|
||||
pDynamicStates: dynamic_states.as_ptr(),
|
||||
})
|
||||
} else {
|
||||
None
|
||||
};
|
||||
|
||||
let pipeline = unsafe {
|
||||
@ -845,7 +849,8 @@ impl<Vdef, L, Rp> GraphicsPipeline<Vdef, L, Rp>
|
||||
pMultisampleState: &multisample,
|
||||
pDepthStencilState: &depth_stencil,
|
||||
pColorBlendState: &blend,
|
||||
pDynamicState: &dynamic_states,
|
||||
pDynamicState: dynamic_states.as_ref().map(|s| s as *const _)
|
||||
.unwrap_or(ptr::null()),
|
||||
layout: PipelineLayout::inner(&**params.layout).internal_object(),
|
||||
renderPass: params.render_pass.render_pass().inner().internal_object(),
|
||||
subpass: params.render_pass.index(),
|
||||
|
Loading…
Reference in New Issue
Block a user