From c68d484a6572fbf5a992d738ea9a4491f1cdcaab Mon Sep 17 00:00:00 2001 From: Pokechu22 Date: Sun, 5 Mar 2023 21:50:00 -0800 Subject: OGL: Convert SupportedESPointSize to an enum class --- Source/Core/VideoBackends/OGL/OGLConfig.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'Source/Core/VideoBackends/OGL/OGLConfig.cpp') diff --git a/Source/Core/VideoBackends/OGL/OGLConfig.cpp b/Source/Core/VideoBackends/OGL/OGLConfig.cpp index ab31592bd2..9d426c2ff6 100644 --- a/Source/Core/VideoBackends/OGL/OGLConfig.cpp +++ b/Source/Core/VideoBackends/OGL/OGLConfig.cpp @@ -368,9 +368,10 @@ bool PopulateConfig(GLContext* m_main_gl_context) if (m_main_gl_context->IsGLES()) { - g_ogl_config.SupportedESPointSize = GLExtensions::Supports("GL_OES_geometry_point_size") ? 1 : - GLExtensions::Supports("GL_EXT_geometry_point_size") ? 2 : - 0; + g_ogl_config.SupportedESPointSize = + GLExtensions::Supports("GL_OES_geometry_point_size") ? EsPointSizeType::PointSizeOes : + GLExtensions::Supports("GL_EXT_geometry_point_size") ? EsPointSizeType::PointSizeExt : + EsPointSizeType::PointSizeNone; g_ogl_config.SupportedESTextureBuffer = GLExtensions::Supports("VERSION_GLES_3_2") ? EsTexbufType::TexbufCore : GLExtensions::Supports("GL_OES_texture_buffer") ? EsTexbufType::TexbufOes : @@ -410,7 +411,8 @@ bool PopulateConfig(GLContext* m_main_gl_context) g_Config.backend_info.bSupportsGeometryShaders = g_ogl_config.bSupportsAEP; g_Config.backend_info.bSupportsComputeShaders = true; g_Config.backend_info.bSupportsGSInstancing = - g_Config.backend_info.bSupportsGeometryShaders && g_ogl_config.SupportedESPointSize > 0; + g_Config.backend_info.bSupportsGeometryShaders && + g_ogl_config.SupportedESPointSize != EsPointSizeType::PointSizeNone; g_Config.backend_info.bSupportsSSAA = g_ogl_config.bSupportsAEP; g_Config.backend_info.bSupportsFragmentStoresAndAtomics = true; g_ogl_config.bSupportsMSAA = true; @@ -434,7 +436,8 @@ bool PopulateConfig(GLContext* m_main_gl_context) g_ogl_config.bSupportsImageLoadStore = true; g_Config.backend_info.bSupportsGeometryShaders = true; g_Config.backend_info.bSupportsComputeShaders = true; - g_Config.backend_info.bSupportsGSInstancing = g_ogl_config.SupportedESPointSize > 0; + g_Config.backend_info.bSupportsGSInstancing = + g_ogl_config.SupportedESPointSize != EsPointSizeType::PointSizeNone; g_Config.backend_info.bSupportsPaletteConversion = true; g_Config.backend_info.bSupportsSSAA = true; g_Config.backend_info.bSupportsFragmentStoresAndAtomics = true; -- cgit v1.2.3 From 53beda526bf9d8b72cc8316550fbcacb107fd2f1 Mon Sep 17 00:00:00 2001 From: Pokechu22 Date: Sun, 5 Mar 2023 21:41:52 -0800 Subject: OGL: Remove bSupports2DTextureStorageMultisample and bSupports3DTextureStorageMultisample bSupports2DTextureStorageMultisample is completely unused, while bSupports3DTextureStorageMultisample is practically unused. In the past, these were checked and fell back to sampler2DMS instead of sampler2DMSArray on GLES 3.1, but this path was removed in f039149198657c1891e1c6462ed30c31ed4b8486 and Dolphin always uses array textures now. --- Source/Core/VideoBackends/OGL/OGLConfig.cpp | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'Source/Core/VideoBackends/OGL/OGLConfig.cpp') diff --git a/Source/Core/VideoBackends/OGL/OGLConfig.cpp b/Source/Core/VideoBackends/OGL/OGLConfig.cpp index 9d426c2ff6..575993c8bf 100644 --- a/Source/Core/VideoBackends/OGL/OGLConfig.cpp +++ b/Source/Core/VideoBackends/OGL/OGLConfig.cpp @@ -333,11 +333,6 @@ bool PopulateConfig(GLContext* m_main_gl_context) g_ogl_config.bSupportsDebug = GLExtensions::Supports("GL_KHR_debug") || GLExtensions::Supports("GL_ARB_debug_output"); g_ogl_config.bSupportsTextureStorage = GLExtensions::Supports("GL_ARB_texture_storage"); - g_ogl_config.bSupports3DTextureStorageMultisample = - GLExtensions::Supports("GL_ARB_texture_storage_multisample") || - GLExtensions::Supports("GL_OES_texture_storage_multisample_2d_array"); - g_ogl_config.bSupports2DTextureStorageMultisample = - GLExtensions::Supports("GL_ARB_texture_storage_multisample"); g_ogl_config.bSupportsImageLoadStore = GLExtensions::Supports("GL_ARB_shader_image_load_store"); g_ogl_config.bSupportsConservativeDepth = GLExtensions::Supports("GL_ARB_conservative_depth"); g_ogl_config.bSupportsAniso = GLExtensions::Supports("GL_EXT_texture_filter_anisotropic"); @@ -417,16 +412,8 @@ bool PopulateConfig(GLContext* m_main_gl_context) g_Config.backend_info.bSupportsFragmentStoresAndAtomics = true; g_ogl_config.bSupportsMSAA = true; g_ogl_config.bSupportsTextureStorage = true; - g_ogl_config.bSupports2DTextureStorageMultisample = true; g_Config.backend_info.bSupportsBitfield = true; g_Config.backend_info.bSupportsDynamicSamplerIndexing = g_ogl_config.bSupportsAEP; - if (g_ActiveConfig.stereo_mode != StereoMode::Off && g_ActiveConfig.iMultisamples > 1 && - !g_ogl_config.bSupports3DTextureStorageMultisample) - { - // GLES 3.1 can't support stereo rendering and MSAA - OSD::AddMessage("MSAA Stereo rendering isn't supported by your GPU.", 10000); - Config::SetCurrent(Config::GFX_MSAA, UINT32_C(1)); - } } else { @@ -446,8 +433,6 @@ bool PopulateConfig(GLContext* m_main_gl_context) g_ogl_config.bSupportsDebug = true; g_ogl_config.bSupportsMSAA = true; g_ogl_config.bSupportsTextureStorage = true; - g_ogl_config.bSupports2DTextureStorageMultisample = true; - g_ogl_config.bSupports3DTextureStorageMultisample = true; g_Config.backend_info.bSupportsBitfield = true; g_Config.backend_info.bSupportsDynamicSamplerIndexing = true; g_Config.backend_info.bSupportsSettingObjectNames = true; -- cgit v1.2.3 From 8b0bd31e72beaacff3be2dbd9cb44208fc4b0442 Mon Sep 17 00:00:00 2001 From: Pokechu22 Date: Sun, 5 Mar 2023 22:03:26 -0800 Subject: OGL: Use GL_OES_texture_storage_multisample_2d_array when supported See https://bugs.dolphin-emu.org/issues/13198 --- Source/Core/VideoBackends/OGL/OGLConfig.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Source/Core/VideoBackends/OGL/OGLConfig.cpp') diff --git a/Source/Core/VideoBackends/OGL/OGLConfig.cpp b/Source/Core/VideoBackends/OGL/OGLConfig.cpp index 575993c8bf..e5e1bff83f 100644 --- a/Source/Core/VideoBackends/OGL/OGLConfig.cpp +++ b/Source/Core/VideoBackends/OGL/OGLConfig.cpp @@ -333,6 +333,7 @@ bool PopulateConfig(GLContext* m_main_gl_context) g_ogl_config.bSupportsDebug = GLExtensions::Supports("GL_KHR_debug") || GLExtensions::Supports("GL_ARB_debug_output"); g_ogl_config.bSupportsTextureStorage = GLExtensions::Supports("GL_ARB_texture_storage"); + g_ogl_config.SupportedMultisampleTexStorage = MultisampleTexStorageType::TexStorageNone; g_ogl_config.bSupportsImageLoadStore = GLExtensions::Supports("GL_ARB_shader_image_load_store"); g_ogl_config.bSupportsConservativeDepth = GLExtensions::Supports("GL_ARB_conservative_depth"); g_ogl_config.bSupportsAniso = GLExtensions::Supports("GL_EXT_texture_filter_anisotropic"); @@ -412,6 +413,8 @@ bool PopulateConfig(GLContext* m_main_gl_context) g_Config.backend_info.bSupportsFragmentStoresAndAtomics = true; g_ogl_config.bSupportsMSAA = true; g_ogl_config.bSupportsTextureStorage = true; + if (GLExtensions::Supports("GL_OES_texture_storage_multisample_2d_array")) + g_ogl_config.SupportedMultisampleTexStorage = MultisampleTexStorageType::TexStorageOes; g_Config.backend_info.bSupportsBitfield = true; g_Config.backend_info.bSupportsDynamicSamplerIndexing = g_ogl_config.bSupportsAEP; } @@ -433,6 +436,7 @@ bool PopulateConfig(GLContext* m_main_gl_context) g_ogl_config.bSupportsDebug = true; g_ogl_config.bSupportsMSAA = true; g_ogl_config.bSupportsTextureStorage = true; + g_ogl_config.SupportedMultisampleTexStorage = MultisampleTexStorageType::TexStorageCore; g_Config.backend_info.bSupportsBitfield = true; g_Config.backend_info.bSupportsDynamicSamplerIndexing = true; g_Config.backend_info.bSupportsSettingObjectNames = true; @@ -440,6 +444,9 @@ bool PopulateConfig(GLContext* m_main_gl_context) } else { + if (GLExtensions::Supports("GL_ARB_texture_storage_multisample")) + g_ogl_config.SupportedMultisampleTexStorage = MultisampleTexStorageType::TexStorageCore; + if (GLExtensions::Version() < 300) { PanicAlertFmtT("GPU: OGL ERROR: Need at least GLSL 1.30\n" @@ -486,6 +493,7 @@ bool PopulateConfig(GLContext* m_main_gl_context) g_ogl_config.eSupportedGLSLVersion = Glsl430; } g_ogl_config.bSupportsTextureStorage = true; + g_ogl_config.SupportedMultisampleTexStorage = MultisampleTexStorageType::TexStorageCore; g_ogl_config.bSupportsImageLoadStore = true; g_Config.backend_info.bSupportsSSAA = true; g_Config.backend_info.bSupportsSettingObjectNames = true; -- cgit v1.2.3