Skip to content

Commit 7fb3e1b

Browse files
committed
support cubemap arrays
1 parent 5bc9913 commit 7fb3e1b

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/Cafe/HW/Latte/Renderer/Metal/LatteTextureMtl.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,13 @@ LatteTextureMtl::LatteTextureMtl(class MetalRenderer* mtlRenderer, Latte::E_DIM
4242
textureType = MTL::TextureType3D;
4343
break;
4444
case Latte::E_DIM::DIM_CUBEMAP:
45-
textureType = MTL::TextureTypeCube; // TODO: check this
45+
if (effectiveBaseDepth % 6 != 0)
46+
debug_printf("cubemaps must have an array length multiple of 6, length: %u\n", effectiveBaseDepth);
47+
48+
if (effectiveBaseDepth <= 6)
49+
textureType = MTL::TextureTypeCube;
50+
else
51+
textureType = MTL::TextureTypeCubeArray;
4652
break;
4753
default:
4854
cemu_assert_unimplemented();
@@ -55,7 +61,11 @@ LatteTextureMtl::LatteTextureMtl(class MetalRenderer* mtlRenderer, Latte::E_DIM
5561
{
5662
desc->setDepth(effectiveBaseDepth);
5763
}
58-
else if (textureType == MTL::TextureTypeCube || textureType == MTL::TextureTypeCubeArray)
64+
else if (textureType == MTL::TextureTypeCube)
65+
{
66+
// Do notjing
67+
}
68+
else if (textureType == MTL::TextureTypeCubeArray)
5969
{
6070
desc->setArrayLength(effectiveBaseDepth / 6);
6171
}

0 commit comments

Comments
 (0)