limit height to 1 for 1D textures

This commit is contained in:
Samuliak 2024-11-19 16:46:46 +01:00
parent 8a8037377f
commit b48656850e
No known key found for this signature in database

View File

@ -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);