diff --git a/panda/src/glstuff/glShaderContext_src.cxx b/panda/src/glstuff/glShaderContext_src.cxx index 618b228754..9dd82c1cdf 100644 --- a/panda/src/glstuff/glShaderContext_src.cxx +++ b/panda/src/glstuff/glShaderContext_src.cxx @@ -890,7 +890,17 @@ reflect_uniform(int i, char *name_buffer, GLsizei name_buflen) { // Add it once for each index. for (bind._index = 0; bind._index < param_size; ++bind._index) { + // It was discovered in #846, that GLSL 4.10 and lower don't seem to + // guarantee that matrices occupy successive locations, and on macOS + // they indeed occupy four locations per element. + // As a big fat hack, we multiply by four on macOS, because this is + // hard to fix on the 1.10 branch. We'll have a proper fix on the + // master branch. +#ifdef __APPLE__ + bind._id._seqno = p + bind._index * 4; +#else bind._id._seqno = p + bind._index; +#endif _shader->_mat_spec.push_back(bind); } _shader->_mat_deps |= bind._dep[0];