From 02b87cdb46af48c5249e6674992a91f3653f2031 Mon Sep 17 00:00:00 2001 From: vladislavbelov Date: Thu, 31 Mar 2022 07:04:51 +0000 Subject: [PATCH] Fixes MSAA on macOS GL drivers for textures with incorrect sample count, fixes #6480 Refs #5969 Tested By: Langbart Differential Revision: https://code.wildfiregames.com/D4581 This was SVN commit r26737. --- source/renderer/PostprocManager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/renderer/PostprocManager.cpp b/source/renderer/PostprocManager.cpp index 9e1ced4e09..b1e23722f0 100644 --- a/source/renderer/PostprocManager.cpp +++ b/source/renderer/PostprocManager.cpp @@ -555,7 +555,7 @@ void CPostprocManager::UpdateAntiAliasingTechnique() // We don't want to enable MSAA in Atlas, because it uses wxWidgets and its canvas. if (g_AtlasGameLoop && g_AtlasGameLoop->running) return; - if (!g_VideoMode.GetBackendDevice()->GetCapabilities().multisampling && !m_AllowedSampleCounts.empty()) + if (!g_VideoMode.GetBackendDevice()->GetCapabilities().multisampling || m_AllowedSampleCounts.empty()) { LOGWARNING("MSAA is unsupported."); return; @@ -565,7 +565,7 @@ void CPostprocManager::UpdateAntiAliasingTechnique() if (std::find(std::begin(m_AllowedSampleCounts), std::end(m_AllowedSampleCounts), m_MultisampleCount) == std::end(m_AllowedSampleCounts)) { - m_MultisampleCount = 4; + m_MultisampleCount = std::min(4u, g_VideoMode.GetBackendDevice()->GetCapabilities().maxSampleCount); LOGWARNING("Wrong MSAA sample count: %s.", m_AAName.EscapeToPrintableASCII().c_str()); } m_UsingMultisampleBuffer = true;