GL cleanup and optimizations. - #1972
Conversation
|
Running try builds now to check that no regressions are present.. |
|
Please comment here to ping me after tests passed. |
|
Overnight, OSX ran the default and other suites and passed, and Linux ran the browser suite and passed as well, so all looks good. |
|
You removed quotes on You can now remove Why are matrix and matrixStack initialized to arrays of 16 zeros? Should be nulls since they will be references to objects (numbers tell the js engine to expect it to stay an array of numbers, which can confuse it), and why 16? Also, can't we initialize it to null in the JSON object definition, then set it to the right size in the initializer? Same with I see you removed the unsafe check on |
|
Please test this on BananaBread, with and without closure, to verify it does not regress anything. |
|
One other thing missing here is |
|
Oh, I was puzzled about the I used |
…as key to FFP matrix file. This allows using arrays instead of maps to store the file, and avoids unnecessary string operations.
…r identical shader programs.
…ase, currently bound buffers do not need to be tracked.
… and always enable that optimization.
…tly using the global name GLImmediate over the GL.immediate form.
…ring global WebGL context in the variable GLctx in addition to Module.ctx.
…ith GLImmediate.matrix array that contains emulated modelview,projection and texture matrices. Restore compressedTexImage2D symbols to be closure-friendly.
…pace. Replace all 'this.xxx' with 'GLImmediate.xxx' when this==GLImmediate, to avoid throwing off Closure minification pass.
|
Ok, updated the pull request. Works with Bananabread with closure on. How does it look now? |
|
I don't have time to look at it right now, but let's merge it in, will take a look later. I'm sure it's fine though. |
Optimizes GL emulation layer to avoid last detected duplicate redundant calls to GL. Cleans up GL library a bit by using 'GLImmediate' and 'GLctx' global names instead of routing though GL. and Module.
Still has a minor cleanup pending for used #ifdef macros, which needs #1969. A few places would like to use #if defined(FULL_ES2) || defined(LEGACY_GL_EMULATION) but the code had to duplicate that since the support for that isn't present.