Implement dispatch

This commit is contained in:
Joshua Groves 2018-05-01 20:48:07 -06:00
parent 07fc60dad9
commit 90e972fcab

View file

@ -877,7 +877,7 @@ pub extern "C" fn gfxBindBufferMemory(
let temp = unsafe { mem::zeroed() }; let temp = unsafe { mem::zeroed() };
*buffer = match mem::replace(&mut *buffer, temp) { *buffer = match mem::replace(&mut *buffer, temp) {
Buffer::Buffer(_) => panic!("An non-sparse buffer can only be bound once!"), Buffer::Buffer(_) => panic!("A non-sparse buffer can only be bound once!"),
Buffer::Unbound(unbound) => { Buffer::Unbound(unbound) => {
Buffer::Buffer( Buffer::Buffer(
gpu.device gpu.device
@ -2852,20 +2852,23 @@ pub extern "C" fn gfxCmdDrawIndexedIndirect(
} }
#[inline] #[inline]
pub extern "C" fn gfxCmdDispatch( pub extern "C" fn gfxCmdDispatch(
_commandBuffer: VkCommandBuffer, mut commandBuffer: VkCommandBuffer,
_groupCountX: u32, groupCountX: u32,
_groupCountY: u32, groupCountY: u32,
_groupCountZ: u32, groupCountZ: u32,
) { ) {
unimplemented!() commandBuffer.dispatch([groupCountX, groupCountY, groupCountZ])
} }
#[inline] #[inline]
pub extern "C" fn gfxCmdDispatchIndirect( pub extern "C" fn gfxCmdDispatchIndirect(
_commandBuffer: VkCommandBuffer, mut commandBuffer: VkCommandBuffer,
_buffer: VkBuffer, buffer: VkBuffer,
_offset: VkDeviceSize, offset: VkDeviceSize,
) { ) {
unimplemented!() match *buffer {
Buffer::Buffer(ref b) => commandBuffer.dispatch_indirect(b, offset),
Buffer::Unbound(_) => panic!("Bound buffer expected!"),
}
} }
#[inline] #[inline]
pub extern "C" fn gfxCmdCopyBuffer( pub extern "C" fn gfxCmdCopyBuffer(