1
0
mirror of https://github.com/FunkyFr3sh/cnc-ddraw.git synced 2025-03-15 06:04:49 +01:00

#364 add hack for Intel HD 4000 driver Build 10.18.10.4252 bug - disable multipass shader

This commit is contained in:
FunkyFr3sh 2024-12-10 20:43:06 +01:00
parent 7e46fab834
commit 31b8d0aff8
3 changed files with 23 additions and 0 deletions

View File

@ -115,5 +115,6 @@ extern HMODULE g_oglu_hmodule;
extern BOOL g_oglu_got_version2; extern BOOL g_oglu_got_version2;
extern BOOL g_oglu_got_version3; extern BOOL g_oglu_got_version3;
extern char g_oglu_version[]; extern char g_oglu_version[];
extern char g_oglu_version_long[];
#endif #endif

View File

@ -95,6 +95,7 @@ HMODULE g_oglu_hmodule;
BOOL g_oglu_got_version2; BOOL g_oglu_got_version2;
BOOL g_oglu_got_version3; BOOL g_oglu_got_version3;
char g_oglu_version[128]; char g_oglu_version[128];
char g_oglu_version_long[128];
BOOL oglu_load_dll() BOOL oglu_load_dll()
{ {
@ -201,6 +202,7 @@ void oglu_init()
if (glversion) if (glversion)
{ {
strncpy(g_oglu_version, glversion, sizeof(g_oglu_version) - 1); strncpy(g_oglu_version, glversion, sizeof(g_oglu_version) - 1);
strncpy(g_oglu_version_long, glversion, sizeof(g_oglu_version_long) - 1);
g_oglu_version[sizeof(g_oglu_version) - 1] = '\0'; /* strncpy fix */ g_oglu_version[sizeof(g_oglu_version) - 1] = '\0'; /* strncpy fix */
strtok(g_oglu_version, " "); strtok(g_oglu_version, " ");
} }

View File

@ -248,6 +248,26 @@ static void ogl_build_programs()
_snprintf(shader_path, sizeof(shader_path) - 1, "%s%s", g_config.dll_path, g_config.shader); _snprintf(shader_path, sizeof(shader_path) - 1, "%s%s", g_config.dll_path, g_config.shader);
} }
/* Hack for Intel HD 4000 driver bug - disable multipass shader */
if (_stricmp(g_oglu_version_long, "4.0.0 - Build 10.18.10.4252") == 0)
{
char shader_path_tmp[MAX_PATH] = { 0 };
strncpy(shader_path_tmp, shader_path, sizeof(shader_path_tmp));
if (strlen(shader_path_tmp) <= sizeof(shader_path_tmp) - 8)
{
strcat(shader_path_tmp, ".pass1");
if (FILE_EXISTS(shader_path_tmp))
{
shader_path[0] = 0;
g_config.shader[0] = 0;
}
}
}
/* detect common upscaling shaders and disable them if no upscaling is required */ /* detect common upscaling shaders and disable them if no upscaling is required */
BOOL is_upscaler = BOOL is_upscaler =