nvk icon indicating copy to clipboard operation
nvk copied to clipboard

Incorrect TypeScript signature for vkCmdBindVertexBuffers

Open Mudbill opened this issue 2 years ago • 0 comments

The fifth argument claims it should be of type Float32Array but should actually be BigUint64Array.

It says:

vkCmdBindVertexBuffers(commandBuffer: VkCommandBuffer | null, firstBinding: number, bindingCount: number, pBuffers: VkBuffer[] | null, pOffsets: Float32Array | null): void

Attempting to use a Float32Array results in a crash with the message: TypeError: Invalid type for argument 5 'pOffsets' in 'vkCmdBindVertexBuffers'

Giving a type of BigUint64Array makes TypeScript complain, so I suppose the only work-around at the moment is to silence the TS compiler.

const offsets = new BigUint64Array();
vkCmdBindVertexBuffers(/*...*/, offsets as any);

Mudbill avatar Sep 18 '22 15:09 Mudbill