From 85827aea57790c38ce07724c41b297d9bbbbd281 Mon Sep 17 00:00:00 2001 From: bones_was_here Date: Wed, 4 Oct 2023 00:46:10 +1000 Subject: [PATCH] Work around black texture bug on AMD's Windows driver Closes https://gitlab.com/xonotic/darkplaces/-/issues/228 Signed-off-by: bones_was_here --- vid_shared.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/vid_shared.c b/vid_shared.c index 2a9b84ba..1a418dd2 100644 --- a/vid_shared.c +++ b/vid_shared.c @@ -778,6 +778,17 @@ void GL_Setup(void) // COMMANDLINEOPTION: GL: -notexturegather disables GL_ARB_texture_gather (which provides fetch4 sampling) // COMMANDLINEOPTION: GL: -nogldebugoutput disables GL_ARB_debug_output (which provides the gl_debug feature, if enabled) +#ifdef WIN32 + // gl_texturecompression_color is somehow broken on AMD's Windows driver, + // see: https://gitlab.com/xonotic/darkplaces/-/issues/228 + // HACK: force it off (less bad than adding hacky checks to the renderer) + if (strncmp(gl_renderer, "AMD Radeon(TM)", 14) == 0) + { + Cvar_SetQuick(&gl_texturecompression_color, "0"); + gl_texturecompression_color.flags |= CF_READONLY; + } +#endif + #ifdef GL_MAX_DRAW_BUFFERS qglGetIntegerv(GL_MAX_DRAW_BUFFERS, (GLint*)&vid.maxdrawbuffers); CHECKGLERROR -- 2.39.2