GPU: Remove pitch parameters from indirect draw calls (#10803)

This commit is contained in:
Caleb Cornett
2024-09-12 01:30:14 -05:00
committed by GitHub
parent 3d7e8c9bb7
commit ddd5723e2e
8 changed files with 47 additions and 99 deletions

View File

@@ -2750,8 +2750,7 @@ static void METAL_DrawPrimitivesIndirect(
SDL_GPUCommandBuffer *commandBuffer,
SDL_GPUBuffer *buffer,
Uint32 offset,
Uint32 drawCount,
Uint32 pitch)
Uint32 drawCount)
{
@autoreleasepool {
MetalCommandBuffer *metalCommandBuffer = (MetalCommandBuffer *)commandBuffer;
@@ -2767,7 +2766,7 @@ static void METAL_DrawPrimitivesIndirect(
[metalCommandBuffer->renderEncoder
drawPrimitives:SDLToMetal_PrimitiveType[primitiveType]
indirectBuffer:metalBuffer->handle
indirectBufferOffset:offset + (pitch * i)];
indirectBufferOffset:offset + (sizeof(SDL_GPUIndirectDrawCommand) * i)];
}
METAL_INTERNAL_TrackBuffer(metalCommandBuffer, metalBuffer);
@@ -2778,8 +2777,7 @@ static void METAL_DrawIndexedPrimitivesIndirect(
SDL_GPUCommandBuffer *commandBuffer,
SDL_GPUBuffer *buffer,
Uint32 offset,
Uint32 drawCount,
Uint32 pitch)
Uint32 drawCount)
{
@autoreleasepool {
MetalCommandBuffer *metalCommandBuffer = (MetalCommandBuffer *)commandBuffer;
@@ -2795,7 +2793,7 @@ static void METAL_DrawIndexedPrimitivesIndirect(
indexBuffer:metalCommandBuffer->indexBuffer->handle
indexBufferOffset:metalCommandBuffer->indexBufferOffset
indirectBuffer:metalBuffer->handle
indirectBufferOffset:offset + (pitch * i)];
indirectBufferOffset:offset + (sizeof(SDL_GPUIndexedIndirectDrawCommand) * i)];
}
METAL_INTERNAL_TrackBuffer(metalCommandBuffer, metalBuffer);