diff options
author | Jukka Jylänki <jujjyl@gmail.com> | 2013-11-25 14:52:10 +0200 |
---|---|---|
committer | Jukka Jylänki <jujjyl@gmail.com> | 2013-11-26 23:24:59 +0200 |
commit | dd027e1b49bc1a55e9378ff7f56b1adbded25bb2 (patch) | |
tree | 5fafd6ffdf51c3b395a66bcc173dcb1dc254b71c /src | |
parent | 7b59b3f05e3c297d00194b3865f1cef9b7904c85 (diff) |
Simplify the key state used for identifying used vertex attribute set. The function CKeyView.next() shows up as one of the hottest in profiles, so merging multiple key identifiers to one helps performance.
Diffstat (limited to 'src')
-rw-r--r-- | src/library_gl.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/library_gl.js b/src/library_gl.js index 5d58caf7..5ea93162 100644 --- a/src/library_gl.js +++ b/src/library_gl.js @@ -3314,10 +3314,11 @@ var LibraryGL = { var keyView = cacheMap.getStaticKeyView().reset(); // By attrib state: + var enabledAttributesKey = 0; for (var i = 0; i < attributes.length; i++) { - var attribute = attributes[i]; - keyView.next(attribute.name); + enabledAttributesKey |= 1 << attributes[i].name; } + keyView.next(enabledAttributesKey); // By fog state: var fogParam = 0; |