From d447ec3bc60cf923d572be2e1b0fee75838bc650 Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 15 Feb 2015 14:19:47 +0100 Subject: [PATCH] If GL_RENDERER begins with "Gallium", disable GL_PRIMITIVE_RESTART_FIXED_INDEX --- panda/src/glstuff/glGraphicsStateGuardian_src.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index 8845d69f61..76087d4644 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -558,10 +558,13 @@ reset() { _glPrimitiveRestartIndex = NULL; if (gl_support_primitive_restart_index) { - if (is_at_least_gl_version(4, 3) || has_extension("GL_ARB_ES3_compatibility")) { + if ((is_at_least_gl_version(4, 3) || has_extension("GL_ARB_ES3_compatibility")) && + _gl_renderer.substr(0, 7) != "Gallium") { // As long as we enable this, OpenGL will always use the highest possible index // for a numeric type as strip cut index, which coincides with our convention. - // This saves us a call to glPrimitiveRestartIndex. + // This saves us a call to glPrimitiveRestartIndex + // ... of course, though, the Gallium driver bugs out here. See also: + // https://www.panda3d.org/forums/viewtopic.php?f=5&t=17512 glEnable(GL_PRIMITIVE_RESTART_FIXED_INDEX); _supported_geom_rendering |= Geom::GR_strip_cut_index;