From ea65db4bea71f140ae8ef129089400433f083daf Mon Sep 17 00:00:00 2001 From: Steve Wooster Date: Sun, 19 Dec 2021 03:28:34 -0800 Subject: [PATCH] Simplify triangle example's vertex input state (#512) Co-authored-by: Steve Wooster --- examples/src/bin/triangle.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/examples/src/bin/triangle.rs b/examples/src/bin/triangle.rs index 03488e5..5c5f69b 100644 --- a/examples/src/bin/triangle.rs +++ b/examples/src/bin/triangle.rs @@ -263,13 +263,9 @@ fn main() { }, ]; - let vertex_input_state_info = vk::PipelineVertexInputStateCreateInfo { - vertex_attribute_description_count: vertex_input_attribute_descriptions.len() as u32, - p_vertex_attribute_descriptions: vertex_input_attribute_descriptions.as_ptr(), - vertex_binding_description_count: vertex_input_binding_descriptions.len() as u32, - p_vertex_binding_descriptions: vertex_input_binding_descriptions.as_ptr(), - ..Default::default() - }; + let vertex_input_state_info = vk::PipelineVertexInputStateCreateInfo::builder() + .vertex_attribute_descriptions(&vertex_input_attribute_descriptions) + .vertex_binding_descriptions(&vertex_input_binding_descriptions); let vertex_input_assembly_state_info = vk::PipelineInputAssemblyStateCreateInfo { topology: vk::PrimitiveTopology::TRIANGLE_LIST, ..Default::default()