Skip to content

Commit

Permalink
metal: Cube texture support
Browse files Browse the repository at this point in the history
  • Loading branch information
TheSpydog committed Jul 7, 2024
1 parent 0ef4b45 commit 6df4eed
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/gpu/metal/SDL_gpu_metal.m
Original file line number Diff line number Diff line change
Expand Up @@ -1260,10 +1260,10 @@ static void METAL_PopDebugGroup(
MetalTexture *metalTexture;

if (textureCreateInfo->depth <= 1) {
if (textureCreateInfo->layerCount > 1) {
textureDescriptor.textureType = MTLTextureType2DArray;
} else if (textureCreateInfo->isCube) {
if (textureCreateInfo->isCube) {
textureDescriptor.textureType = MTLTextureTypeCube;
} else if (textureCreateInfo->layerCount > 1) {
textureDescriptor.textureType = MTLTextureType2DArray;
} else {
textureDescriptor.textureType = MTLTextureType2D;
}
Expand All @@ -1286,7 +1286,7 @@ static void METAL_PopDebugGroup(
textureDescriptor.depth = textureCreateInfo->depth;
textureDescriptor.mipmapLevelCount = textureCreateInfo->levelCount;
textureDescriptor.sampleCount = 1;
textureDescriptor.arrayLength = textureCreateInfo->layerCount; /* FIXME: What does this need to be for cubes? */
textureDescriptor.arrayLength = (textureCreateInfo->isCube) ? 1 : textureCreateInfo->layerCount; /* FIXME: Cube arrays? */
textureDescriptor.storageMode = MTLStorageModePrivate;

textureDescriptor.usage = 0;
Expand Down

0 comments on commit 6df4eed

Please sign in to comment.