Skip to content

Commit 31b8d0a

Browse files
committed
#364 add hack for Intel HD 4000 driver Build 10.18.10.4252 bug - disable multipass shader
1 parent 7e46fab commit 31b8d0a

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

inc/opengl_utils.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,5 +115,6 @@ extern HMODULE g_oglu_hmodule;
115115
extern BOOL g_oglu_got_version2;
116116
extern BOOL g_oglu_got_version3;
117117
extern char g_oglu_version[];
118+
extern char g_oglu_version_long[];
118119

119120
#endif

src/opengl_utils.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ HMODULE g_oglu_hmodule;
9595
BOOL g_oglu_got_version2;
9696
BOOL g_oglu_got_version3;
9797
char g_oglu_version[128];
98+
char g_oglu_version_long[128];
9899

99100
BOOL oglu_load_dll()
100101
{
@@ -201,6 +202,7 @@ void oglu_init()
201202
if (glversion)
202203
{
203204
strncpy(g_oglu_version, glversion, sizeof(g_oglu_version) - 1);
205+
strncpy(g_oglu_version_long, glversion, sizeof(g_oglu_version_long) - 1);
204206
g_oglu_version[sizeof(g_oglu_version) - 1] = '\0'; /* strncpy fix */
205207
strtok(g_oglu_version, " ");
206208
}

src/render_ogl.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,26 @@ static void ogl_build_programs()
248248
_snprintf(shader_path, sizeof(shader_path) - 1, "%s%s", g_config.dll_path, g_config.shader);
249249
}
250250

251+
252+
/* Hack for Intel HD 4000 driver bug - disable multipass shader */
253+
254+
if (_stricmp(g_oglu_version_long, "4.0.0 - Build 10.18.10.4252") == 0)
255+
{
256+
char shader_path_tmp[MAX_PATH] = { 0 };
257+
strncpy(shader_path_tmp, shader_path, sizeof(shader_path_tmp));
258+
259+
if (strlen(shader_path_tmp) <= sizeof(shader_path_tmp) - 8)
260+
{
261+
strcat(shader_path_tmp, ".pass1");
262+
263+
if (FILE_EXISTS(shader_path_tmp))
264+
{
265+
shader_path[0] = 0;
266+
g_config.shader[0] = 0;
267+
}
268+
}
269+
}
270+
251271
/* detect common upscaling shaders and disable them if no upscaling is required */
252272

253273
BOOL is_upscaler =

0 commit comments

Comments
 (0)