|
@@ -1805,7 +1805,8 @@ static void METAL_UploadToTexture(
|
|
copyFromBuffer:bufferContainer->activeBuffer->handle
|
|
copyFromBuffer:bufferContainer->activeBuffer->handle
|
|
sourceOffset:source->offset
|
|
sourceOffset:source->offset
|
|
sourceBytesPerRow:BytesPerRow(destination->w, textureContainer->header.info.format)
|
|
sourceBytesPerRow:BytesPerRow(destination->w, textureContainer->header.info.format)
|
|
- sourceBytesPerImage:SDL_CalculateGPUTextureFormatSize(textureContainer->header.info.format, destination->w, destination->h, destination->d)
|
|
|
|
|
|
+ // sourceBytesPerImage expects the stride between 2D images (slices) of a 3D texture, not the size of the entire region
|
|
|
|
+ sourceBytesPerImage:SDL_CalculateGPUTextureFormatSize(textureContainer->header.info.format, destination->w, destination->h, 1)
|
|
sourceSize:MTLSizeMake(destination->w, destination->h, destination->d)
|
|
sourceSize:MTLSizeMake(destination->w, destination->h, destination->d)
|
|
toTexture:metalTexture->handle
|
|
toTexture:metalTexture->handle
|
|
destinationSlice:destination->layer
|
|
destinationSlice:destination->layer
|