Skip to content

Commit

Permalink
Merge pull request #1620 from Armada651/ogl-msaa-array
Browse files Browse the repository at this point in the history
OGL: Don't use texture arrays for MSAA.
  • Loading branch information
lioncash committed Dec 3, 2014
2 parents eea3039 + 40920b3 commit 22209bc
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions Source/Core/VideoBackends/OGL/FramebufferManager.cpp
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand All @@ -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";
}
Expand Down

0 comments on commit 22209bc

Please sign in to comment.