summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/OGL/FramebufferManager.cpp
diff options
context:
space:
mode:
authorRyan Houdek <Sonicadvance1@gmail.com>2015-09-01 00:17:24 -0500
committerRyan Houdek <Sonicadvance1@gmail.com>2015-09-05 05:23:29 -0500
commit7650117c266b3eed1c3bdae0feb2828a6482bfe0 (patch)
treeb36256d962371720e6aff1e1c9483d773670f577 /Source/Core/VideoBackends/OGL/FramebufferManager.cpp
parent0f3263ac6344fff53a588c392be5328506036c1a (diff)
Properly support MSAA and SSAA as separate features(+GLES)
SSAA relies on MSAA being active to work. We only supports 4x SSAA while in fact you can enable SSAA at any MSAA level. I even managed to run 64xMSAA + SSAA on my Quadro which made some pretty sleek looking games. They were very cinematic though. With this, it properly fixes up SSAA and MSAA support in GLES as well. Before they were broken when stereo rendering was enabled. Now in GLES they can properly support MSAA and also stereo rendering with MSAA enabled(with proper extensions).
Diffstat (limited to 'Source/Core/VideoBackends/OGL/FramebufferManager.cpp')
-rw-r--r--Source/Core/VideoBackends/OGL/FramebufferManager.cpp69
1 files changed, 50 insertions, 19 deletions
diff --git a/Source/Core/VideoBackends/OGL/FramebufferManager.cpp b/Source/Core/VideoBackends/OGL/FramebufferManager.cpp
index a4489a67ff..00e54967f8 100644
--- a/Source/Core/VideoBackends/OGL/FramebufferManager.cpp
+++ b/Source/Core/VideoBackends/OGL/FramebufferManager.cpp
@@ -107,29 +107,60 @@ FramebufferManager::FramebufferManager(int targetWidth, int targetHeight, int ms
{
m_textureType = GL_TEXTURE_2D_MULTISAMPLE_ARRAY;
- glBindTexture(m_textureType, m_efbColor);
- glTexImage3DMultisample(m_textureType, m_msaaSamples, GL_RGBA, m_targetWidth, m_targetHeight, m_EFBLayers, false);
-
- glBindTexture(m_textureType, m_efbDepth);
- glTexImage3DMultisample(m_textureType, m_msaaSamples, GL_DEPTH_COMPONENT32F, m_targetWidth, m_targetHeight, m_EFBLayers, false);
-
- glBindTexture(m_textureType, m_efbColorSwap);
- glTexImage3DMultisample(m_textureType, m_msaaSamples, GL_RGBA, m_targetWidth, m_targetHeight, m_EFBLayers, false);
- glBindTexture(m_textureType, 0);
+ if (g_ogl_config.bSupports3DTextureStorage)
+ {
+ glBindTexture(m_textureType, m_efbColor);
+ glTexStorage3DMultisample(m_textureType, m_msaaSamples, GL_RGBA8, m_targetWidth, m_targetHeight, m_EFBLayers, false);
+
+ glBindTexture(m_textureType, m_efbDepth);
+ glTexStorage3DMultisample(m_textureType, m_msaaSamples, GL_DEPTH_COMPONENT32F, m_targetWidth, m_targetHeight, m_EFBLayers, false);
+
+ glBindTexture(m_textureType, m_efbColorSwap);
+ glTexStorage3DMultisample(m_textureType, m_msaaSamples, GL_RGBA8, m_targetWidth, m_targetHeight, m_EFBLayers, false);
+ glBindTexture(m_textureType, 0);
+
+ }
+ else
+ {
+ glBindTexture(m_textureType, m_efbColor);
+ glTexImage3DMultisample(m_textureType, m_msaaSamples, GL_RGBA, m_targetWidth, m_targetHeight, m_EFBLayers, false);
+
+ glBindTexture(m_textureType, m_efbDepth);
+ glTexImage3DMultisample(m_textureType, m_msaaSamples, GL_DEPTH_COMPONENT32F, m_targetWidth, m_targetHeight, m_EFBLayers, false);
+
+ glBindTexture(m_textureType, m_efbColorSwap);
+ glTexImage3DMultisample(m_textureType, m_msaaSamples, GL_RGBA, m_targetWidth, m_targetHeight, m_EFBLayers, false);
+ glBindTexture(m_textureType, 0);
+ }
}
else
{
m_textureType = GL_TEXTURE_2D_MULTISAMPLE;
- glBindTexture(m_textureType, m_efbColor);
- glTexImage2DMultisample(m_textureType, m_msaaSamples, GL_RGBA, m_targetWidth, m_targetHeight, false);
-
- glBindTexture(m_textureType, m_efbDepth);
- glTexImage2DMultisample(m_textureType, m_msaaSamples, GL_DEPTH_COMPONENT32F, m_targetWidth, m_targetHeight, false);
-
- glBindTexture(m_textureType, m_efbColorSwap);
- glTexImage2DMultisample(m_textureType, m_msaaSamples, GL_RGBA, m_targetWidth, m_targetHeight, false);
- glBindTexture(m_textureType, 0);
+ if (g_ogl_config.bSupports2DTextureStorage)
+ {
+ glBindTexture(m_textureType, m_efbColor);
+ glTexStorage2DMultisample(m_textureType, m_msaaSamples, GL_RGBA8, m_targetWidth, m_targetHeight, false);
+
+ glBindTexture(m_textureType, m_efbDepth);
+ glTexStorage2DMultisample(m_textureType, m_msaaSamples, GL_DEPTH_COMPONENT32F, m_targetWidth, m_targetHeight, false);
+
+ glBindTexture(m_textureType, m_efbColorSwap);
+ glTexStorage2DMultisample(m_textureType, m_msaaSamples, GL_RGBA8, m_targetWidth, m_targetHeight, false);
+ glBindTexture(m_textureType, 0);
+ }
+ else
+ {
+ glBindTexture(m_textureType, m_efbColor);
+ glTexImage2DMultisample(m_textureType, m_msaaSamples, GL_RGBA, m_targetWidth, m_targetHeight, false);
+
+ glBindTexture(m_textureType, m_efbDepth);
+ glTexImage2DMultisample(m_textureType, m_msaaSamples, GL_DEPTH_COMPONENT32F, m_targetWidth, m_targetHeight, false);
+
+ glBindTexture(m_textureType, m_efbColorSwap);
+ 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.
@@ -213,7 +244,7 @@ FramebufferManager::FramebufferManager(int targetWidth, int targetHeight, int ms
" return texelFetch(samp9, pos, 0);\n"
"}\n";
}
- else if (g_ogl_config.bSupportSampleShading)
+ else if (g_ActiveConfig.backend_info.bSupportsSSAA)
{
// msaa + sample shading available, so just fetch the sample
// This will lead to sample shading, but it's the only way to not loose