diff --git a/src/gpu/metal/SDL_gpu_metal.m b/src/gpu/metal/SDL_gpu_metal.m index c4f802a71cc23a..711b8c0b133312 100644 --- a/src/gpu/metal/SDL_gpu_metal.m +++ b/src/gpu/metal/SDL_gpu_metal.m @@ -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; } @@ -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;