mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
workaround for NVidia 361.43 driver bug
This driver returns internal/synthetic uniform shaders when asked for the list of active uniforms. They all start with "_main_" and have names like "_main_0_gp5fp[0]". We need to ignore these, otherwise, Panda will later crash with failed assertions when trying to set this unknown uniform.
This commit is contained in:
parent
1df9be6fc0
commit
9cb6903690
@ -687,6 +687,15 @@ reflect_uniform(int i, char *name_buffer, GLsizei name_buflen) {
|
|||||||
_glgsg->_glGetActiveUniform(_glsl_program, i, name_buflen, NULL, ¶m_size, ¶m_type, name_buffer);
|
_glgsg->_glGetActiveUniform(_glsl_program, i, name_buflen, NULL, ¶m_size, ¶m_type, name_buffer);
|
||||||
GLint p = _glgsg->_glGetUniformLocation(_glsl_program, name_buffer);
|
GLint p = _glgsg->_glGetUniformLocation(_glsl_program, name_buffer);
|
||||||
|
|
||||||
|
|
||||||
|
// 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(name_buffer, "_main_", 6) == 0) {
|
||||||
|
GLCAT.warning() << "Ignoring uniform " << name_buffer << " which may be generated by buggy Nvidia driver.\n";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (GLCAT.is_debug()) {
|
if (GLCAT.is_debug()) {
|
||||||
GLCAT.debug()
|
GLCAT.debug()
|
||||||
<< "Active uniform " << name_buffer << " with size " << param_size
|
<< "Active uniform " << name_buffer << " with size " << param_size
|
||||||
|
Loading…
x
Reference in New Issue
Block a user