[opengl] Fix instantiation bug with MatrixStack, add some tests.