From 8564dbedce7ab72d754196d133be612fa4e631b9 Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 3 Jan 2016 20:08:41 +0100 Subject: [PATCH] Backport workaround for NVidia 361.43 driver bug to 1.9 --- panda/src/glstuff/glShaderContext_src.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/panda/src/glstuff/glShaderContext_src.cxx b/panda/src/glstuff/glShaderContext_src.cxx index 298eda1f9e..ed7e6df1bd 100644 --- a/panda/src/glstuff/glShaderContext_src.cxx +++ b/panda/src/glstuff/glShaderContext_src.cxx @@ -234,6 +234,14 @@ CLP(ShaderContext)(CLP(GraphicsStateGuardian) *glgsg, Shader *s) : ShaderContext } if (p > -1) { + // Some NVidia drivers (361.43 for example) (incorrectly) include "internal" uniforms in + // the list starting with "_main_" (for example, "_main_0_gp5fp[0]") + // we need to skip those, because we don't know anything about them + if (strncmp(param_name_cstr, "_main_", 6) == 0) { + GLCAT.warning() << "Ignoring uniform " << param_name << " which may be generated by buggy Nvidia driver.\n"; + continue; + } + // Strip off [0] suffix that some drivers append to arrays. size_t size = param_name.size(); if (size > 3 && param_name.substr(size - 3, 3) == "[0]") {