]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
Work around black texture bug on AMD's Windows driver
authorbones_was_here <bones_was_here@xonotic.au>
Tue, 3 Oct 2023 14:46:10 +0000 (00:46 +1000)
committerbones_was_here <bones_was_here@xonotic.au>
Sat, 28 Oct 2023 08:22:29 +0000 (18:22 +1000)
Closes https://gitlab.com/xonotic/darkplaces/-/issues/228

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
vid_shared.c

index 2a9b84ba8b21ab4db7fa0cc5b7a9f8a3e2fcf9d8..1a418dd29854da7f52199d79c2c5aae96f53f249 100644 (file)
@@ -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