Backport workaround for NVidia 361.43 driver bug to 1.9

This commit is contained in:
rdb 2016-01-03 20:08:41 +01:00
parent 6a2e1a438c
commit 8564dbedce

View File

@ -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]") {