diff options
Diffstat (limited to 'Source/Core/VideoBackends/OGL/ProgramShaderCache.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/OGL/ProgramShaderCache.cpp | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/Source/Core/VideoBackends/OGL/ProgramShaderCache.cpp b/Source/Core/VideoBackends/OGL/ProgramShaderCache.cpp index eff1497e7f..a149c9fad0 100644 --- a/Source/Core/VideoBackends/OGL/ProgramShaderCache.cpp +++ b/Source/Core/VideoBackends/OGL/ProgramShaderCache.cpp @@ -664,12 +664,13 @@ void ProgramShaderCache::CreateHeader() std::string SupportedESTextureBuffer; switch (g_ogl_config.SupportedESPointSize) { - case 1: + case EsPointSizeType::PointSizeOes: SupportedESPointSize = "#extension GL_OES_geometry_point_size : enable"; break; - case 2: + case EsPointSizeType::PointSizeExt: SupportedESPointSize = "#extension GL_EXT_geometry_point_size : enable"; break; + case EsPointSizeType::PointSizeNone: default: SupportedESPointSize = ""; break; @@ -721,6 +722,13 @@ void ProgramShaderCache::CreateHeader() break; } + // The sampler2DMSArray keyword is reserved in GLSL ES 3.0 and 3.1, but is available in 3.2 and + // with GL_OES_texture_storage_multisample_2d_array for 3.1. + // See https://bugs.dolphin-emu.org/issues/13198. + const bool use_multisample_2d_array_precision = + v >= GlslEs320 || + g_ogl_config.SupportedMultisampleTexStorage != MultisampleTexStorageType::TexStorageNone; + std::string shader_shuffle_string; if (g_ogl_config.bSupportsKHRShaderSubgroup) { @@ -758,6 +766,7 @@ void ProgramShaderCache::CreateHeader() "{}\n" // shader thread shuffle "{}\n" // derivative control "{}\n" // query levels + "{}\n" // OES multisample texture storage // Precision defines for GLSL ES "{}\n" @@ -843,12 +852,18 @@ void ProgramShaderCache::CreateHeader() g_ActiveConfig.backend_info.bSupportsTextureQueryLevels ? "#extension GL_ARB_texture_query_levels : enable" : "", + // Note: GL_ARB_texture_storage_multisample doesn't have an #extension, as it doesn't + // need to change GLSL, but on GLES 3.1 sampler2DMSArray is a reserved keyword unless + // the extension is enabled. Thus, we don't need to check TexStorageCore/have an ARB version. + g_ogl_config.SupportedMultisampleTexStorage == MultisampleTexStorageType::TexStorageOes ? + "#extension GL_OES_texture_storage_multisample_2d_array : enable" : + "", is_glsles ? "precision highp float;" : "", is_glsles ? "precision highp int;" : "", is_glsles ? "precision highp sampler2DArray;" : "", (is_glsles && g_ActiveConfig.backend_info.bSupportsPaletteConversion) ? "precision highp usamplerBuffer;" : "", - v > GlslEs300 ? "precision highp sampler2DMSArray;" : "", + use_multisample_2d_array_precision ? "precision highp sampler2DMSArray;" : "", v >= GlslEs310 ? "precision highp image2DArray;" : ""); } |
