Various crashes and bugs can be attributed to running out of texture image units. OpenGL guarantees we get at least 16, and OS X provides exactly that many and doesn't optimize out unused samplers (GLSL representation of texture image units).
Audit texture image unit usage on OS X and refactor shaders so that we don't rely on the shader compiler to optimize out unused samplers.
Test:
Run viewer against old intel GPUs and intel macbooks.
Various crashes and bugs can be attributed to running out of texture image units. OpenGL guarantees we get at least 16, and OS X provides exactly that many and doesn't optimize out unused samplers (GLSL representation of texture image units).
Audit texture image unit usage on OS X and refactor shaders so that we don't rely on the shader compiler to optimize out unused samplers.
Test: