From 7fb3e1bd1e846f6d5079eebab8ec531bbbd79393 Mon Sep 17 00:00:00 2001 From: Samuliak Date: Mon, 12 Aug 2024 10:27:52 +0200 Subject: [PATCH] support cubemap arrays --- .../HW/Latte/Renderer/Metal/LatteTextureMtl.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/Cafe/HW/Latte/Renderer/Metal/LatteTextureMtl.cpp b/src/Cafe/HW/Latte/Renderer/Metal/LatteTextureMtl.cpp index 63cd69f6..5d5273ca 100644 --- a/src/Cafe/HW/Latte/Renderer/Metal/LatteTextureMtl.cpp +++ b/src/Cafe/HW/Latte/Renderer/Metal/LatteTextureMtl.cpp @@ -42,7 +42,13 @@ LatteTextureMtl::LatteTextureMtl(class MetalRenderer* mtlRenderer, Latte::E_DIM textureType = MTL::TextureType3D; break; case Latte::E_DIM::DIM_CUBEMAP: - textureType = MTL::TextureTypeCube; // TODO: check this + if (effectiveBaseDepth % 6 != 0) + debug_printf("cubemaps must have an array length multiple of 6, length: %u\n", effectiveBaseDepth); + + if (effectiveBaseDepth <= 6) + textureType = MTL::TextureTypeCube; + else + textureType = MTL::TextureTypeCubeArray; break; default: cemu_assert_unimplemented(); @@ -55,7 +61,11 @@ LatteTextureMtl::LatteTextureMtl(class MetalRenderer* mtlRenderer, Latte::E_DIM { desc->setDepth(effectiveBaseDepth); } - else if (textureType == MTL::TextureTypeCube || textureType == MTL::TextureTypeCubeArray) + else if (textureType == MTL::TextureTypeCube) + { + // Do notjing + } + else if (textureType == MTL::TextureTypeCubeArray) { desc->setArrayLength(effectiveBaseDepth / 6); }