Implement resolve_image

This commit is contained in:
AIOOB 2018-05-14 18:51:48 +01:00
parent a893304383
commit d0478d8571

View file

@ -1804,14 +1804,14 @@ pub extern "C" fn gfxCreateGraphicsPipelines(
flags, flags,
parent, parent,
} }
}).collect::<Vec<_>>(); });
let pipelines = gpu.device.create_graphics_pipelines(&descs); let pipelines = gpu.device.create_graphics_pipelines(descs);
let pipelines = unsafe { let pipelines = unsafe {
slice::from_raw_parts_mut(pPipelines, descs.len()) slice::from_raw_parts_mut(pPipelines, infos.len())
.into_iter() .into_iter()
.zip(pipelines.into_iter()) .zip(pipelines)
}; };
for (pipeline, raw) in pipelines { for (pipeline, raw) in pipelines {
@ -2442,15 +2442,12 @@ pub extern "C" fn gfxCreateRenderPass(
let subpasses = attachment_refs let subpasses = attachment_refs
.iter() .iter()
.map(|attachment_ref| { .map(|attachment_ref| pass::SubpassDesc {
let _ = &attachment_ref.resolve;
pass::SubpassDesc {
colors: &attachment_ref.color, colors: &attachment_ref.color,
depth_stencil: attachment_ref.depth_stencil.as_ref(), depth_stencil: attachment_ref.depth_stencil.as_ref(),
inputs: &attachment_ref.input, inputs: &attachment_ref.input,
resolves: &attachment_ref.resolve, resolves: &attachment_ref.resolve,
preserves: &attachment_ref.preserve, preserves: &attachment_ref.preserve,
}
}) })
.collect::<Vec<_>>(); .collect::<Vec<_>>();
@ -3156,15 +3153,31 @@ pub extern "C" fn gfxCmdClearAttachments(
} }
#[inline] #[inline]
pub extern "C" fn gfxCmdResolveImage( pub extern "C" fn gfxCmdResolveImage(
_commandBuffer: VkCommandBuffer, mut commandBuffer: VkCommandBuffer,
_srcImage: VkImage, srcImage: VkImage,
_srcImageLayout: VkImageLayout, srcImageLayout: VkImageLayout,
_dstImage: VkImage, dstImage: VkImage,
_dstImageLayout: VkImageLayout, dstImageLayout: VkImageLayout,
_regionCount: u32, regionCount: u32,
_pRegions: *const VkImageResolve, pRegions: *const VkImageResolve,
) { ) {
unimplemented!() let regions = unsafe {
slice::from_raw_parts(pRegions, regionCount as _)
}.iter().cloned().map(|resolve| com::ImageResolve {
src_subresource: srcImage.map_subresource_layers(resolve.srcSubresource),
src_offset: conv::map_offset(resolve.srcOffset),
dst_subresource: srcImage.map_subresource_layers(resolve.dstSubresource),
dst_offset: conv::map_offset(resolve.dstOffset),
extent: conv::map_extent(resolve.extent),
});
commandBuffer.resolve_image(
srcImage.expect("Bound image expected!"),
conv::map_image_layout(srcImageLayout),
dstImage.expect("Bound image expected!"),
conv::map_image_layout(dstImageLayout),
regions,
);
} }
#[inline] #[inline]
pub extern "C" fn gfxCmdSetEvent( pub extern "C" fn gfxCmdSetEvent(