Browse Source

Backport workaround for NVidia 361.43 driver bug to 1.9

rdb 10 years ago
parent
commit
8564dbedce
1 changed files with 8 additions and 0 deletions
  1. 8 0
      panda/src/glstuff/glShaderContext_src.cxx

+ 8 - 0
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]") {