From 0feb8171305ba1d3f1677a04e981971d68e2d711 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Sun, 14 Mar 2021 01:09:16 +1000 Subject: [PATCH] ShaderGen: Disable interface blocks when using AMD OpenGL SSAA/per sample shading is broken otherwise. --- src/core/shadergen.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/core/shadergen.cpp b/src/core/shadergen.cpp index 3e4589ce9..b75028604 100644 --- a/src/core/shadergen.cpp +++ b/src/core/shadergen.cpp @@ -2,6 +2,7 @@ #include "common/assert.h" #include "common/log.h" #include +#include #include Log_SetChannel(ShaderGen); @@ -16,6 +17,14 @@ ShaderGen::ShaderGen(HostDisplay::RenderAPI render_api, bool supports_dual_sourc m_use_glsl_interface_blocks = (IsVulkan() || GLAD_GL_ES_VERSION_3_2 || GLAD_GL_VERSION_3_2); m_use_glsl_binding_layout = (IsVulkan() || UseGLSLBindingLayout()); + + if (m_render_api == HostDisplay::RenderAPI::OpenGL) + { + // SSAA with interface blocks is broken on AMD's OpenGL driver. + const char* gl_vendor = reinterpret_cast(glGetString(GL_VENDOR)); + if (std::strcmp(gl_vendor, "ATI Technologies Inc.") == 0) + m_use_glsl_interface_blocks = false; + } } }