diff options
| author | JMC47 <JMC4789@gmail.com> | 2023-02-10 04:47:20 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-02-10 04:47:20 -0500 |
| commit | 258151fe5aa9b1c28eb9bb9567d345c59b54e4a0 (patch) | |
| tree | 5365822144593d45342fb89b6fbdde9165457c00 /Source/Core/VideoBackends/OGL/OGLConfig.cpp | |
| parent | dad7a32a35d0d28946c16e740692d014a858d2ea (diff) | |
| parent | 4b2aa948e662aa037ad39f5ee81a64256a4d61aa (diff) | |
Merge pull request #11523 from degasus/OGL_KHR_subgroup
VideoBackend/OGL: Prefer KHR_shader_subgroup over NV_shader_thread.
Diffstat (limited to 'Source/Core/VideoBackends/OGL/OGLConfig.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/OGL/OGLConfig.cpp | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/Source/Core/VideoBackends/OGL/OGLConfig.cpp b/Source/Core/VideoBackends/OGL/OGLConfig.cpp index bafc28841d..10722e0526 100644 --- a/Source/Core/VideoBackends/OGL/OGLConfig.cpp +++ b/Source/Core/VideoBackends/OGL/OGLConfig.cpp @@ -489,7 +489,14 @@ bool PopulateConfig(GLContext* m_main_gl_context) else if (GLExtensions::Version() >= 430) { // TODO: We should really parse the GL_SHADING_LANGUAGE_VERSION token. - g_ogl_config.eSupportedGLSLVersion = Glsl430; + if (GLExtensions::Version() >= 450) + { + g_ogl_config.eSupportedGLSLVersion = Glsl450; + } + else + { + g_ogl_config.eSupportedGLSLVersion = Glsl430; + } g_ogl_config.bSupportsTextureStorage = true; g_ogl_config.bSupportsImageLoadStore = true; g_Config.backend_info.bSupportsSSAA = true; @@ -531,8 +538,23 @@ bool PopulateConfig(GLContext* m_main_gl_context) if (g_ogl_config.max_samples < 1 || !g_ogl_config.bSupportsMSAA) g_ogl_config.max_samples = 1; - g_ogl_config.bSupportsShaderThreadShuffleNV = - GLExtensions::Supports("GL_NV_shader_thread_shuffle"); + const bool bSupportsIsHelperInvocation = g_ogl_config.bIsES ? + g_ogl_config.eSupportedGLSLVersion >= GlslEs320 : + g_ogl_config.eSupportedGLSLVersion >= Glsl450; + g_ogl_config.bSupportsKHRShaderSubgroup = + GLExtensions::Supports("GL_KHR_shader_subgroup") && bSupportsIsHelperInvocation; + if (g_ogl_config.bSupportsKHRShaderSubgroup) + { + // Check for the features: basic + arithmetic + ballot + GLint supported_features = 0; + glGetIntegerv(GL_SUBGROUP_SUPPORTED_FEATURES_KHR, &supported_features); + if (~supported_features & + (GL_SUBGROUP_FEATURE_BASIC_BIT_KHR | GL_SUBGROUP_FEATURE_ARITHMETIC_BIT_KHR | + GL_SUBGROUP_FEATURE_BALLOT_BIT_KHR)) + { + g_ogl_config.bSupportsKHRShaderSubgroup = false; + } + } // We require texel buffers, image load store, and compute shaders to enable GPU texture decoding. // If the driver doesn't expose the extensions, but supports GL4.3/GLES3.1, it will still be |
