Created
January 24, 2017 07:49
-
-
Save codingstyle/e88ce6c0097b708e27159a71b5d45c58 to your computer and use it in GitHub Desktop.
Metal texture copy and mipmap generation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
id<MTLBlitCommandEncoder> blit = [currentCommandBuffer blitCommandEncoder]; | |
[blit copyFromTexture:internalTexture sourceSlice:0 sourceLevel:0 sourceOrigin:MTLOriginMake(0, 0, 0) sourceSize:region.size toTexture:externalTexture destinationSlice:0 destinationLevel:0 destinationOrigin:MTLOriginMake(0, 0, 0)]; | |
[blit generateMipmapsForTexture:externalTexture]; | |
[blit endEncoding]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment