missed some premature .build() calls!
This commit is contained in:
parent
ca651f07cb
commit
752fc1f1ee
|
@ -645,8 +645,7 @@ fn main() {
|
|||
};
|
||||
|
||||
let multisample_state_info = vk::PipelineMultisampleStateCreateInfo::builder()
|
||||
.rasterization_samples(vk::SampleCountFlags::TYPE_1)
|
||||
.build();
|
||||
.rasterization_samples(vk::SampleCountFlags::TYPE_1);
|
||||
|
||||
let noop_stencil_state = vk::StencilOpState {
|
||||
fail_op: vk::StencilOp::KEEP,
|
||||
|
@ -683,7 +682,7 @@ fn main() {
|
|||
let dynamic_state_info =
|
||||
vk::PipelineDynamicStateCreateInfo::builder().dynamic_states(&dynamic_state);
|
||||
|
||||
let graphic_pipeline_info = vk::GraphicsPipelineCreateInfo::builder()
|
||||
let graphic_pipeline_infos = [vk::GraphicsPipelineCreateInfo::builder()
|
||||
.stages(&shader_stage_create_infos)
|
||||
.vertex_input_state(&vertex_input_state_info)
|
||||
.input_assembly_state(&vertex_input_assembly_state_info)
|
||||
|
@ -694,12 +693,12 @@ fn main() {
|
|||
.color_blend_state(&color_blend_state)
|
||||
.dynamic_state(&dynamic_state_info)
|
||||
.layout(pipeline_layout)
|
||||
.render_pass(renderpass)
|
||||
.build();
|
||||
.render_pass(renderpass).
|
||||
build()];
|
||||
|
||||
let graphics_pipelines = base
|
||||
.device
|
||||
.create_graphics_pipelines(vk::PipelineCache::null(), &[graphic_pipeline_info], None)
|
||||
.create_graphics_pipelines(vk::PipelineCache::null(), &graphic_pipeline_infos, None)
|
||||
.unwrap();
|
||||
|
||||
let graphic_pipeline = graphics_pipelines[0];
|
||||
|
|
|
@ -339,7 +339,7 @@ fn main() {
|
|||
let dynamic_state_info =
|
||||
vk::PipelineDynamicStateCreateInfo::builder().dynamic_states(&dynamic_state);
|
||||
|
||||
let graphic_pipeline_info = vk::GraphicsPipelineCreateInfo::builder()
|
||||
let graphic_pipeline_info = [vk::GraphicsPipelineCreateInfo::builder()
|
||||
.stages(&shader_stage_create_infos)
|
||||
.vertex_input_state(&vertex_input_state_info)
|
||||
.input_assembly_state(&vertex_input_assembly_state_info)
|
||||
|
@ -351,11 +351,11 @@ fn main() {
|
|||
.dynamic_state(&dynamic_state_info)
|
||||
.layout(pipeline_layout)
|
||||
.render_pass(renderpass)
|
||||
.build();
|
||||
.build()];
|
||||
|
||||
let graphics_pipelines = base
|
||||
.device
|
||||
.create_graphics_pipelines(vk::PipelineCache::null(), &[graphic_pipeline_info], None)
|
||||
.create_graphics_pipelines(vk::PipelineCache::null(), &graphic_pipeline_info, None)
|
||||
.expect("Unable to create graphics pipeline");
|
||||
|
||||
let graphic_pipeline = graphics_pipelines[0];
|
||||
|
|
|
@ -40,7 +40,6 @@ use std::default::Default;
|
|||
use std::ffi::{CStr, CString};
|
||||
use std::ops::Drop;
|
||||
use std::os::raw::{c_char, c_void};
|
||||
use std::ptr;
|
||||
|
||||
// Simple offset_of macro akin to C++ offsetof
|
||||
#[macro_export]
|
||||
|
@ -82,22 +81,19 @@ pub fn record_submit_commandbuffer<D: DeviceV1_0, F: FnOnce(&D, vk::CommandBuffe
|
|||
.end_command_buffer(command_buffer)
|
||||
.expect("End commandbuffer");
|
||||
|
||||
let fence_create_info = vk::FenceCreateInfo::default();
|
||||
|
||||
let submit_fence = device
|
||||
.create_fence(&fence_create_info, None)
|
||||
.create_fence(&vk::FenceCreateInfo::default(), None)
|
||||
.expect("Create fence failed.");
|
||||
|
||||
let command_buffers = vec![command_buffer];
|
||||
let submit_info = vk::SubmitInfo::builder()
|
||||
let submit_info = [vk::SubmitInfo::builder()
|
||||
.wait_semaphores(wait_semaphores)
|
||||
.wait_dst_stage_mask(wait_mask)
|
||||
.command_buffers(&command_buffers)
|
||||
.signal_semaphores(signal_semaphores)
|
||||
.build();
|
||||
|
||||
.build()];
|
||||
device
|
||||
.queue_submit(submit_queue, &[submit_info], submit_fence)
|
||||
.queue_submit(submit_queue, &submit_info, submit_fence)
|
||||
.expect("queue submit failed.");
|
||||
device
|
||||
.wait_for_fences(&[submit_fence], true, std::u64::MAX)
|
||||
|
@ -342,14 +338,12 @@ impl ExampleBase {
|
|||
.application_version(0)
|
||||
.engine_name(&app_name)
|
||||
.engine_version(0)
|
||||
.api_version(vk_make_version!(1, 0, 36))
|
||||
.build();
|
||||
.api_version(vk_make_version!(1, 0, 36));
|
||||
|
||||
let create_info = vk::InstanceCreateInfo::builder()
|
||||
.application_info(&appinfo)
|
||||
.enabled_layer_names(&layers_names_raw)
|
||||
.enabled_extension_names(&extension_names_raw)
|
||||
.build();
|
||||
.enabled_extension_names(&extension_names_raw);
|
||||
|
||||
let instance: Instance = entry
|
||||
.create_instance(&create_info, None)
|
||||
|
@ -554,8 +548,7 @@ impl ExampleBase {
|
|||
|
||||
let depth_image_allocate_info = vk::MemoryAllocateInfo::builder()
|
||||
.allocation_size(depth_image_memory_req.size)
|
||||
.memory_type_index(depth_image_memory_index)
|
||||
.build();
|
||||
.memory_type_index(depth_image_memory_index);
|
||||
|
||||
let depth_image_memory = device
|
||||
.allocate_memory(&depth_image_allocate_info, None)
|
||||
|
@ -570,11 +563,10 @@ impl ExampleBase {
|
|||
setup_command_buffer,
|
||||
present_queue,
|
||||
&[],
|
||||
// &[vk::PipelineStageFlags::BOTTOM_OF_PIPE],
|
||||
&[],
|
||||
&[],
|
||||
|device, setup_command_buffer| {
|
||||
let layout_transition_barrier = vk::ImageMemoryBarrier::builder()
|
||||
let layout_transition_barriers = [vk::ImageMemoryBarrier::builder()
|
||||
.image(depth_image)
|
||||
.dst_access_mask(
|
||||
vk::AccessFlags::DEPTH_STENCIL_ATTACHMENT_READ
|
||||
|
@ -589,7 +581,7 @@ impl ExampleBase {
|
|||
.level_count(1)
|
||||
.build(),
|
||||
)
|
||||
.build();
|
||||
.build()];
|
||||
|
||||
device.cmd_pipeline_barrier(
|
||||
setup_command_buffer,
|
||||
|
@ -598,7 +590,7 @@ impl ExampleBase {
|
|||
vk::DependencyFlags::empty(),
|
||||
&[],
|
||||
&[],
|
||||
&[layout_transition_barrier],
|
||||
&layout_transition_barriers,
|
||||
);
|
||||
},
|
||||
);
|
||||
|
@ -613,8 +605,7 @@ impl ExampleBase {
|
|||
)
|
||||
.image(depth_image)
|
||||
.format(depth_image_create_info.format)
|
||||
.view_type(vk::ImageViewType::TYPE_2D)
|
||||
.build();
|
||||
.view_type(vk::ImageViewType::TYPE_2D);
|
||||
|
||||
let depth_image_view = device
|
||||
.create_image_view(&depth_image_view_info, None)
|
||||
|
|
Loading…
Reference in a new issue