summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/OGL/FramebufferManager.cpp
diff options
context:
space:
mode:
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