inlining slices when on Device methods
This commit is contained in:
parent
5422a8032d
commit
f0251c157a
|
@ -384,7 +384,7 @@ fn main() {
|
|||
&[],
|
||||
&[texture_barrier],
|
||||
);
|
||||
let buffer_copy_regions = [vk::BufferImageCopy::builder()
|
||||
let buffer_copy_regions = vk::BufferImageCopy::builder()
|
||||
.image_subresource(
|
||||
vk::ImageSubresourceLayers::builder()
|
||||
.aspect_mask(vk::ImageAspectFlags::COLOR)
|
||||
|
@ -395,15 +395,14 @@ fn main() {
|
|||
width: image_dimensions.0,
|
||||
height: image_dimensions.1,
|
||||
depth: 1,
|
||||
})
|
||||
.build()];
|
||||
});
|
||||
|
||||
device.cmd_copy_buffer_to_image(
|
||||
texture_command_buffer,
|
||||
image_buffer,
|
||||
texture_image,
|
||||
vk::ImageLayout::TRANSFER_DST_OPTIMAL,
|
||||
&buffer_copy_regions,
|
||||
&[buffer_copy_regions.build()],
|
||||
);
|
||||
let texture_barrier_end = vk::ImageMemoryBarrier {
|
||||
src_access_mask: vk::AccessFlags::TRANSFER_WRITE,
|
||||
|
@ -682,7 +681,7 @@ fn main() {
|
|||
let dynamic_state_info =
|
||||
vk::PipelineDynamicStateCreateInfo::builder().dynamic_states(&dynamic_state);
|
||||
|
||||
let graphic_pipeline_infos = [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)
|
||||
|
@ -693,12 +692,15 @@ fn main() {
|
|||
.color_blend_state(&color_blend_state)
|
||||
.dynamic_state(&dynamic_state_info)
|
||||
.layout(pipeline_layout)
|
||||
.render_pass(renderpass)
|
||||
.build()];
|
||||
.render_pass(renderpass);
|
||||
|
||||
let graphics_pipelines = base
|
||||
.device
|
||||
.create_graphics_pipelines(vk::PipelineCache::null(), &graphic_pipeline_infos, None)
|
||||
.create_graphics_pipelines(
|
||||
vk::PipelineCache::null(),
|
||||
&[graphic_pipeline_infos.build()],
|
||||
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)
|
||||
|
@ -350,12 +350,15 @@ fn main() {
|
|||
.color_blend_state(&color_blend_state)
|
||||
.dynamic_state(&dynamic_state_info)
|
||||
.layout(pipeline_layout)
|
||||
.render_pass(renderpass)
|
||||
.build()];
|
||||
.render_pass(renderpass);
|
||||
|
||||
let graphics_pipelines = base
|
||||
.device
|
||||
.create_graphics_pipelines(vk::PipelineCache::null(), &graphic_pipeline_info, None)
|
||||
.create_graphics_pipelines(
|
||||
vk::PipelineCache::null(),
|
||||
&[graphic_pipeline_info.build()],
|
||||
None,
|
||||
)
|
||||
.expect("Unable to create graphics pipeline");
|
||||
|
||||
let graphic_pipeline = graphics_pipelines[0];
|
||||
|
|
|
@ -87,14 +87,15 @@ pub fn record_submit_commandbuffer<D: DeviceV1_0, F: FnOnce(&D, vk::CommandBuffe
|
|||
.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()];
|
||||
.signal_semaphores(signal_semaphores);
|
||||
|
||||
device
|
||||
.queue_submit(submit_queue, &submit_info, submit_fence)
|
||||
.queue_submit(submit_queue, &[submit_info.build()], submit_fence)
|
||||
.expect("queue submit failed.");
|
||||
device
|
||||
.wait_for_fences(&[submit_fence], true, std::u64::MAX)
|
||||
|
@ -567,7 +568,7 @@ impl ExampleBase {
|
|||
&[],
|
||||
&[],
|
||||
|device, setup_command_buffer| {
|
||||
let layout_transition_barriers = [vk::ImageMemoryBarrier::builder()
|
||||
let layout_transition_barriers = vk::ImageMemoryBarrier::builder()
|
||||
.image(depth_image)
|
||||
.dst_access_mask(
|
||||
vk::AccessFlags::DEPTH_STENCIL_ATTACHMENT_READ
|
||||
|
@ -581,8 +582,7 @@ impl ExampleBase {
|
|||
.layer_count(1)
|
||||
.level_count(1)
|
||||
.build(),
|
||||
)
|
||||
.build()];
|
||||
);
|
||||
|
||||
device.cmd_pipeline_barrier(
|
||||
setup_command_buffer,
|
||||
|
@ -591,7 +591,7 @@ impl ExampleBase {
|
|||
vk::DependencyFlags::empty(),
|
||||
&[],
|
||||
&[],
|
||||
&layout_transition_barriers,
|
||||
&[layout_transition_barriers.build()],
|
||||
);
|
||||
},
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue