mirror of
https://github.com/italicsjenga/portability.git
synced 2024-11-26 08:51:31 +11:00
Merge #74
74: [WIP] Implement resolve_image r=kvark a=AIOOB
This change causes `make cts` to lock up my computer after it gets to a certain test, that test alone doesn't crash it but something seems to reach a critical point. I have no idea how to debug this, so good luck if you decide to replicate this and make sure everything is saved 😄
Co-authored-by: AIOOB <jack@rickard.plus.com>
This commit is contained in:
commit
2620cbb902
|
@ -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;
|
colors: &attachment_ref.color,
|
||||||
pass::SubpassDesc {
|
depth_stencil: attachment_ref.depth_stencil.as_ref(),
|
||||||
colors: &attachment_ref.color,
|
inputs: &attachment_ref.input,
|
||||||
depth_stencil: attachment_ref.depth_stencil.as_ref(),
|
resolves: &attachment_ref.resolve,
|
||||||
inputs: &attachment_ref.input,
|
preserves: &attachment_ref.preserve,
|
||||||
resolves: &attachment_ref.resolve,
|
|
||||||
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(
|
||||||
|
|
Loading…
Reference in a new issue