From 40920b3823ee7dab04a9c964fab9ea20c4ddbf43 Mon Sep 17 00:00:00 2001 From: Jules Blok Date: Wed, 3 Dec 2014 01:39:43 +0100 Subject: [PATCH] OGL: Don't use texture arrays for MSAA. This solves a performance regression on AMD cards. We don't currently support stereoscopy for MSAA anyway. --- .../VideoBackends/OGL/FramebufferManager.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Source/Core/VideoBackends/OGL/FramebufferManager.cpp b/Source/Core/VideoBackends/OGL/FramebufferManager.cpp index f24172e7e0..4ea9262625 100644 --- a/Source/Core/VideoBackends/OGL/FramebufferManager.cpp +++ b/Source/Core/VideoBackends/OGL/FramebufferManager.cpp @@ -99,17 +99,17 @@ FramebufferManager::FramebufferManager(int targetWidth, int targetHeight, int ms } else { - m_textureType = GL_TEXTURE_2D_MULTISAMPLE_ARRAY; + m_textureType = GL_TEXTURE_2D_MULTISAMPLE; GLenum resolvedType = GL_TEXTURE_2D_ARRAY; glBindTexture(m_textureType, m_efbColor); - glTexImage3DMultisample(m_textureType, m_msaaSamples, GL_RGBA, m_targetWidth, m_targetHeight, m_EFBLayers, false); + glTexImage2DMultisample(m_textureType, m_msaaSamples, GL_RGBA, m_targetWidth, m_targetHeight, false); glBindTexture(m_textureType, m_efbDepth); - glTexImage3DMultisample(m_textureType, m_msaaSamples, GL_DEPTH_COMPONENT24, m_targetWidth, m_targetHeight, m_EFBLayers, false); + glTexImage2DMultisample(m_textureType, m_msaaSamples, GL_DEPTH_COMPONENT24, m_targetWidth, m_targetHeight, false); glBindTexture(m_textureType, m_efbColorSwap); - glTexImage3DMultisample(m_textureType, m_msaaSamples, GL_RGBA, m_targetWidth, m_targetHeight, m_EFBLayers, false); + glTexImage2DMultisample(m_textureType, m_msaaSamples, GL_RGBA, m_targetWidth, m_targetHeight, false); glBindTexture(m_textureType, 0); // Although we are able to access the multisampled texture directly, we don't do it everywhere. @@ -181,9 +181,9 @@ FramebufferManager::FramebufferManager(int targetWidth, int targetHeight, int ms // This will lead to sample shading, but it's the only way to not loose // the values of each sample. sampler = - "SAMPLER_BINDING(9) uniform sampler2DMSArray samp9;\n" + "SAMPLER_BINDING(9) uniform sampler2DMS samp9;\n" "vec4 sampleEFB(ivec2 pos) {\n" - " return texelFetch(samp9, ivec3(pos, 0), gl_SampleID);\n" + " return texelFetch(samp9, pos, gl_SampleID);\n" "}\n"; } else @@ -192,11 +192,11 @@ FramebufferManager::FramebufferManager(int targetWidth, int targetHeight, int ms std::stringstream samples; samples << m_msaaSamples; sampler = - "SAMPLER_BINDING(9) uniform sampler2DMSArray samp9;\n" + "SAMPLER_BINDING(9) uniform sampler2DMS samp9;\n" "vec4 sampleEFB(ivec2 pos) {\n" " vec4 color = vec4(0.0, 0.0, 0.0, 0.0);\n" " for(int i=0; i<" + samples.str() + "; i++)\n" - " color += texelFetch(samp9, ivec3(pos, 0), i);\n" + " color += texelFetch(samp9, pos, i);\n" " return color / " + samples.str() + ";\n" "}\n"; }