@@ -155,6 +155,10 @@ static Cvar::Cvar<bool> workaround_glDriver_mesa_forceS3tc(
155
155
" workaround.glDriver.mesa.forceS3tc" ,
156
156
" Enable S3TC on Mesa even when libtxc-dxtn is not available" ,
157
157
Cvar::NONE, true );
158
+ static Cvar::Cvar<bool > workaround_glDriver_mesa_intel_glsl120_disableGpuShader4 (
159
+ " workaround.glDriver.mesa.intel.glsl120.disableGpuShader4" ,
160
+ " Disable EXT_gpu_shader4 on Mesa Intel driver with GLSL 1.20" ,
161
+ Cvar::NONE, true );
158
162
static Cvar::Cvar<bool > workaround_glDriver_mesa_intel_gma3_forceFragmentShader (
159
163
" workaround.glDriver.mesa.intel.gma3.forceFragmentShader" ,
160
164
" Force fragment shader on Intel GMA Gen 3 hardware" ,
@@ -2171,8 +2175,23 @@ static void GLimp_InitExtensions()
2171
2175
}
2172
2176
}
2173
2177
2178
+ /* Mesa implements incomplete GL_EXT_gpu_shader4 for the Intel GMA Gen 4.
2179
+ See: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12803 */
2180
+ bool gpuShader4Enabled = r_ext_gpu_shader4.Get ();
2181
+
2182
+ if ( gpuShader4Enabled
2183
+ && GL_EXT_gpu_shader4
2184
+ && glConfig2.shadingLanguageVersion <= 120
2185
+ && glConfig2.driverVendor == glDriverVendor_t::MESA
2186
+ && glConfig2.hardwareVendor == glHardwareVendor_t::INTEL
2187
+ && workaround_glDriver_mesa_intel_glsl120_disableGpuShader4.Get () )
2188
+ {
2189
+ logger.Warn ( " Found buggy Mesa EXT_gpu_shader4 implementation with GLSL 1.20 Intel card, disabling EXT_gpu_shader4." );
2190
+ gpuShader4Enabled = false ;
2191
+ }
2192
+
2174
2193
// made required in OpenGL 3.0
2175
- glConfig2.gpuShader4Available = LOAD_EXTENSION_WITH_TEST ( ExtFlag_CORE, EXT_gpu_shader4, r_ext_gpu_shader4. Get () );
2194
+ glConfig2.gpuShader4Available = LOAD_EXTENSION_WITH_TEST ( ExtFlag_CORE, EXT_gpu_shader4, gpuShader4Enabled );
2176
2195
2177
2196
// made required in OpenGL 4.0
2178
2197
glConfig2.gpuShader5Available = LOAD_EXTENSION_WITH_TEST ( ExtFlag_NONE, ARB_gpu_shader5, r_arb_gpu_shader5.Get () );
0 commit comments