mirror of
https://github.com/italicsjenga/portability.git
synced 2024-12-02 03:41:31 +11:00
Implement push constant command
This commit is contained in:
parent
6102540750
commit
e43939453d
|
@ -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…
Reference in a new issue