Add buffer to buffer copies

This commit is contained in:
Corentin Wallez
2017-06-12 18:12:29 -04:00
committed by Corentin Wallez
parent 367cb3515c
commit d84d107076
7 changed files with 101 additions and 0 deletions

View File

@@ -376,6 +376,20 @@ namespace metal {
}
break;
case Command::CopyBufferToBuffer:
{
CopyBufferToBufferCmd* copy = commands.NextCommand<CopyBufferToBufferCmd>();
encoders.EnsureBlit(commandBuffer);
[encoders.blit
copyFromBuffer:ToBackend(copy->source)->GetMTLBuffer()
sourceOffset:copy->sourceOffset
toBuffer:ToBackend(copy->destination)->GetMTLBuffer()
destinationOffset:copy->destinationOffset
size:copy->size];
}
break;
case Command::CopyBufferToTexture:
{
CopyBufferToTextureCmd* copy = commands.NextCommand<CopyBufferToTextureCmd>();