diff options
Diffstat (limited to '3rdparty/bgfx/src/renderer_mtl.mm')
-rw-r--r-- | 3rdparty/bgfx/src/renderer_mtl.mm | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/3rdparty/bgfx/src/renderer_mtl.mm b/3rdparty/bgfx/src/renderer_mtl.mm index 08faee495f7..ffb2c38a793 100644 --- a/3rdparty/bgfx/src/renderer_mtl.mm +++ b/3rdparty/bgfx/src/renderer_mtl.mm @@ -1855,20 +1855,10 @@ namespace bgfx { namespace mtl const uint32_t textureHeight = bx::uint32_max(blockInfo.blockHeight, imageContainer.m_height>>startLod); m_flags = _flags; - m_requestedFormat = (uint8_t)imageContainer.m_format; - m_textureFormat = MTLPixelFormatInvalid == s_textureFormat[m_requestedFormat].m_fmt - ? uint8_t(TextureFormat::BGRA8) - : m_requestedFormat - ; - - const bool convert = m_requestedFormat != m_textureFormat; - - uint8_t bpp = getBitsPerPixel(TextureFormat::Enum(m_textureFormat) ); - if (convert) - { - m_textureFormat = (uint8_t)TextureFormat::RGBA8; - bpp = 32; - } + m_requestedFormat = uint8_t(imageContainer.m_format); + m_textureFormat = uint8_t(getViableTextureFormat(imageContainer) ); + const bool convert = m_textureFormat != m_requestedFormat; + const uint8_t bpp = getBitsPerPixel(TextureFormat::Enum(m_textureFormat) ); TextureDescriptor desc = s_renderMtl->m_textureDescriptor; |