Skip to content

Commit 02817d8

Browse files
authored
Merge pull request #909 from smallfx/main
Correct Metal backend's index buffer offset in indexed draw call
2 parents d944b40 + fef3f08 commit 02817d8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

backends/gpu/metal/sources/commandlist.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ void kore_metal_command_list_draw_indexed(kore_gpu_command_list *list, uint32_t
189189
indexCount:index_count
190190
indexType:list->metal.sixteen_bit_indices ? MTLIndexTypeUInt16 : MTLIndexTypeUInt32
191191
indexBuffer:index_buffer
192-
indexBufferOffset:first_index
192+
indexBufferOffset:first_index * (list->metal.sixteen_bit_indices ? sizeof(uint16_t) : sizeof(uint32_t))
193193
instanceCount:instance_count
194194
baseVertex:base_vertex
195195
baseInstance:first_instance];

0 commit comments

Comments
 (0)