From: bones_was_here Date: Tue, 3 Oct 2023 14:46:10 +0000 (+1000) Subject: Work around black texture bug on AMD's Windows driver X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=85827aea57790c38ce07724c41b297d9bbbbd281;p=xonotic%2Fdarkplaces.git Work around black texture bug on AMD's Windows driver Closes https://gitlab.com/xonotic/darkplaces/-/issues/228 Signed-off-by: bones_was_here --- 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