Fix test failures in Chrome

This fixes #1002 (and #1047, but there are separate issues for unrelated failures on Mac and AMD).

This fix was tested in Chrome and Firefox and in release and debug.  I also went through all the Sandcastle examples.

This fix is part of #1031 (CC @gbeatty), but is incomplete since we are still researching what will be done offline vs. at runtime.  So this is not as fast or robust as the final shader pipeline will be, and it temporarily does not allow explicitly declaring automatic uniforms, which no one does anyway.