make all textures be at least 1x1x1

This commit is contained in:
Samuliak 2024-09-02 08:25:36 +02:00
parent 45737e82d9
commit c4eb195797
2 changed files with 4 additions and 2 deletions

View File

@ -22,6 +22,8 @@ LatteTextureMtl::LatteTextureMtl(class MetalRenderer* mtlRenderer, Latte::E_DIM
effectiveBaseHeight = overwriteInfo.height;
effectiveBaseDepth = overwriteInfo.depth;
}
effectiveBaseWidth = std::max(1, effectiveBaseWidth);
effectiveBaseHeight = std::max(1, effectiveBaseHeight);
effectiveBaseDepth = std::max(1, effectiveBaseDepth);
desc->setWidth(effectiveBaseWidth);

View File

@ -61,14 +61,14 @@ MetalRenderer::MetalRenderer()
// Null resources
MTL::TextureDescriptor* textureDescriptor = MTL::TextureDescriptor::alloc()->init();
textureDescriptor->setTextureType(MTL::TextureType1D);
textureDescriptor->setWidth(4);
textureDescriptor->setWidth(1);
m_nullTexture1D = m_device->newTexture(textureDescriptor);
#ifdef CEMU_DEBUG_ASSERT
m_nullTexture1D->setLabel(GetLabel("Null texture 1D", m_nullTexture1D));
#endif
textureDescriptor->setTextureType(MTL::TextureType2D);
textureDescriptor->setHeight(4);
textureDescriptor->setHeight(1);
m_nullTexture2D = m_device->newTexture(textureDescriptor);
#ifdef CEMU_DEBUG_ASSERT
m_nullTexture2D->setLabel(GetLabel("Null texture 2D", m_nullTexture2D));