mirror of
https://github.com/italicsjenga/portability.git
synced 2025-02-17 06:37:43 +11:00
Merge #59
59: Implement push constant command r=kvark a=msiglreith With this and a small change to spirv cross for combined image sampler support we can start tracking support for the Vulkan samples from SaschaWillems. Co-authored-by: msiglreith <m.siglreith@gmail.com>
This commit is contained in:
commit
b46ade6360
1 changed files with 22 additions and 2 deletions
|
@ -3004,14 +3004,34 @@ pub extern "C" fn gfxCmdCopyQueryPoolResults(
|
||||||
}
|
}
|
||||||
#[inline]
|
#[inline]
|
||||||
pub extern "C" fn gfxCmdPushConstants(
|
pub extern "C" fn gfxCmdPushConstants(
|
||||||
commandBuffer: VkCommandBuffer,
|
mut commandBuffer: VkCommandBuffer,
|
||||||
layout: VkPipelineLayout,
|
layout: VkPipelineLayout,
|
||||||
stageFlags: VkShaderStageFlags,
|
stageFlags: VkShaderStageFlags,
|
||||||
offset: u32,
|
offset: u32,
|
||||||
size: u32,
|
size: u32,
|
||||||
pValues: *const ::std::os::raw::c_void,
|
pValues: *const ::std::os::raw::c_void,
|
||||||
) {
|
) {
|
||||||
unimplemented!()
|
assert_eq!(size % 4, 0);
|
||||||
|
|
||||||
|
let values = unsafe {
|
||||||
|
slice::from_raw_parts(pValues as *const u32, size as usize / 4)
|
||||||
|
};
|
||||||
|
|
||||||
|
if stageFlags & VkShaderStageFlagBits::VK_SHADER_STAGE_COMPUTE_BIT as u32 != 0 {
|
||||||
|
commandBuffer.push_compute_constants(
|
||||||
|
&*layout,
|
||||||
|
offset,
|
||||||
|
values,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if stageFlags & VkShaderStageFlagBits::VK_SHADER_STAGE_ALL_GRAPHICS as u32 != 0 {
|
||||||
|
commandBuffer.push_graphics_constants(
|
||||||
|
&*layout,
|
||||||
|
conv::map_stage_flags(stageFlags),
|
||||||
|
offset,
|
||||||
|
values,
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#[inline]
|
#[inline]
|
||||||
pub extern "C" fn gfxCmdBeginRenderPass(
|
pub extern "C" fn gfxCmdBeginRenderPass(
|
||||||
|
|
Loading…
Add table
Reference in a new issue