From b48656850ec63a771b252dc4b9b63e1dd315b7f7 Mon Sep 17 00:00:00 2001 From: Samuliak Date: Tue, 19 Nov 2024 16:46:46 +0100 Subject: [PATCH] limit height to 1 for 1D textures --- src/Cafe/HW/Latte/Renderer/Metal/LatteTextureMtl.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Cafe/HW/Latte/Renderer/Metal/LatteTextureMtl.cpp b/src/Cafe/HW/Latte/Renderer/Metal/LatteTextureMtl.cpp index 03cd9285..d8c52d4d 100644 --- a/src/Cafe/HW/Latte/Renderer/Metal/LatteTextureMtl.cpp +++ b/src/Cafe/HW/Latte/Renderer/Metal/LatteTextureMtl.cpp @@ -27,15 +27,12 @@ LatteTextureMtl::LatteTextureMtl(class MetalRenderer* mtlRenderer, Latte::E_DIM effectiveBaseHeight = std::max(1, effectiveBaseHeight); effectiveBaseDepth = std::max(1, effectiveBaseDepth); - desc->setWidth(effectiveBaseWidth); - desc->setHeight(effectiveBaseHeight); - desc->setMipmapLevelCount(mipLevels); - MTL::TextureType textureType; switch (dim) { case Latte::E_DIM::DIM_1D: textureType = MTL::TextureType1D; + effectiveBaseHeight = 1; break; case Latte::E_DIM::DIM_2D: case Latte::E_DIM::DIM_2D_MSAA: @@ -59,6 +56,10 @@ LatteTextureMtl::LatteTextureMtl(class MetalRenderer* mtlRenderer, Latte::E_DIM } desc->setTextureType(textureType); + desc->setWidth(effectiveBaseWidth); + desc->setHeight(effectiveBaseHeight); + desc->setMipmapLevelCount(mipLevels); + if (textureType == MTL::TextureType3D) { desc->setDepth(effectiveBaseDepth);