{"action":"created","comment":{"url":"https://api.github.com/repos/pixijs/pixi.js/pulls/comments/85754564","pull_request_review_id":6449370,"id":85754564,"diff_hunk":"@@ -108,16 +109,13 @@ export default class SpriteRenderer extends ObjectRenderer\n         // step 2: check the maximum number of if statements the shader can have too..\n         this.MAX_TEXTURES = checkMaxIfStatmentsInShader(this.MAX_TEXTURES, gl);\n \n-        this.shaders = new Array(this.MAX_TEXTURES);\n-        this.shaders[0] = generateMultiTextureShader(gl, 1);\n-        this.shaders[1] = generateMultiTextureShader(gl, 2);\n+        const shader = this.shader = generateMultiTextureShader(gl, this.MAX_TEXTURES);\n \n         // create a couple of buffers\n         this.indexBuffer = glCore.GLBuffer.createIndexBuffer(gl, this.indices, gl.STATIC_DRAW);\n \n         // we use the second shader as the first one depending on your browser may omit aTextureId\n         // as it is not used by the shader so is optimized out.","path":"src/core/sprites/webgl/SpriteRenderer.js","position":30,"original_position":30,"commit_id":"5205103ef489460a278bf88877d5174bbc9235f7","original_commit_id":"5205103ef489460a278bf88877d5174bbc9235f7","user":{"login":"englercj","id":944497,"avatar_url":"https://avatars.githubusercontent.com/u/944497?v=3","gravatar_id":"","url":"https://api.github.com/users/englercj","html_url":"https://github.com/englercj","followers_url":"https://api.github.com/users/englercj/followers","following_url":"https://api.github.com/users/englercj/following{/other_user}","gists_url":"https://api.github.com/users/englercj/gists{/gist_id}","starred_url":"https://api.github.com/users/englercj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/englercj/subscriptions","organizations_url":"https://api.github.com/users/englercj/orgs","repos_url":"https://api.github.com/users/englercj/repos","events_url":"https://api.github.com/users/englercj/events{/privacy}","received_events_url":"https://api.github.com/users/englercj/received_events","type":"User","site_admin":false},"body":"comment relevant anymore?","created_at":"2016-10-31T14:53:47Z","updated_at":"2016-10-31T14:53:47Z","html_url":"https://github.com/pixijs/pixi.js/pull/3201#discussion_r85754564","pull_request_url":"https://api.github.com/repos/pixijs/pixi.js/pulls/3201","_links":{"self":{"href":"https://api.github.com/repos/pixijs/pixi.js/pulls/comments/85754564"},"html":{"href":"https://github.com/pixijs/pixi.js/pull/3201#discussion_r85754564"},"pull_request":{"href":"https://api.github.com/repos/pixijs/pixi.js/pulls/3201"}}},"pull_request":{"url":"https://api.github.com/repos/pixijs/pixi.js/pulls/3201","id":90892496,"html_url":"https://github.com/pixijs/pixi.js/pull/3201","diff_url":"https://github.com/pixijs/pixi.js/pull/3201.diff","patch_url":"https://github.com/pixijs/pixi.js/pull/3201.patch","issue_url":"https://api.github.com/repos/pixijs/pixi.js/issues/3201","number":3201,"state":"open","locked":false,"title":"Dev texture states cacheing","user":{"login":"GoodBoyDigital","id":3112434,"avatar_url":"https://avatars.githubusercontent.com/u/3112434?v=3","gravatar_id":"","url":"https://api.github.com/users/GoodBoyDigital","html_url":"https://github.com/GoodBoyDigital","followers_url":"https://api.github.com/users/GoodBoyDigital/followers","following_url":"https://api.github.com/users/GoodBoyDigital/following{/other_user}","gists_url":"https://api.github.com/users/GoodBoyDigital/gists{/gist_id}","starred_url":"https://api.github.com/users/GoodBoyDigital/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoodBoyDigital/subscriptions","organizations_url":"https://api.github.com/users/GoodBoyDigital/orgs","repos_url":"https://api.github.com/users/GoodBoyDigital/repos","events_url":"https://api.github.com/users/GoodBoyDigital/events{/privacy}","received_events_url":"https://api.github.com/users/GoodBoyDigital/received_events","type":"User","site_admin":false},"body":"Evening All! So this turned out to be more complicated than I thought - but finally here we are :)\n\nThe idea here is that we basically cache textures when they are bound - so if a texture is at a location already it is not bound again saving on GPU calls.\n\nTaking the a step further I modified the sprite batch algorithm to try to reuse textures that are already currently bound.\n\nThe results mean that un less you have lots of textures in your scene we get a lot less GPU calls binding textures and locations (often none!)\n\nThis PR is not 100% complete (I have a small bit to do with filters left), but I wanted peeps to get eyes on for feedback!\n\nCheers!\n","created_at":"2016-10-25T21:10:48Z","updated_at":"2016-10-31T15:01:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"856c1a91c3f645afd846d84c7241492d1913156f","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/pixijs/pixi.js/pulls/3201/commits","review_comments_url":"https://api.github.com/repos/pixijs/pixi.js/pulls/3201/comments","review_comment_url":"https://api.github.com/repos/pixijs/pixi.js/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pixijs/pixi.js/issues/3201/comments","statuses_url":"https://api.github.com/repos/pixijs/pixi.js/statuses/5205103ef489460a278bf88877d5174bbc9235f7","head":{"label":"pixijs:dev-texture-states","ref":"dev-texture-states","sha":"5205103ef489460a278bf88877d5174bbc9235f7","user":{"login":"pixijs","id":5406849,"avatar_url":"https://avatars.githubusercontent.com/u/5406849?v=3","gravatar_id":"","url":"https://api.github.com/users/pixijs","html_url":"https://github.com/pixijs","followers_url":"https://api.github.com/users/pixijs/followers","following_url":"https://api.github.com/users/pixijs/following{/other_user}","gists_url":"https://api.github.com/users/pixijs/gists{/gist_id}","starred_url":"https://api.github.com/users/pixijs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pixijs/subscriptions","organizations_url":"https://api.github.com/users/pixijs/orgs","repos_url":"https://api.github.com/users/pixijs/repos","events_url":"https://api.github.com/users/pixijs/events{/privacy}","received_events_url":"https://api.github.com/users/pixijs/received_events","type":"Organization","site_admin":false},"repo":{"id":7741856,"name":"pixi.js","full_name":"pixijs/pixi.js","owner":{"login":"pixijs","id":5406849,"avatar_url":"https://avatars.githubusercontent.com/u/5406849?v=3","gravatar_id":"","url":"https://api.github.com/users/pixijs","html_url":"https://github.com/pixijs","followers_url":"https://api.github.com/users/pixijs/followers","following_url":"https://api.github.com/users/pixijs/following{/other_user}","gists_url":"https://api.github.com/users/pixijs/gists{/gist_id}","starred_url":"https://api.github.com/users/pixijs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pixijs/subscriptions","organizations_url":"https://api.github.com/users/pixijs/orgs","repos_url":"https://api.github.com/users/pixijs/repos","events_url":"https://api.github.com/users/pixijs/events{/privacy}","received_events_url":"https://api.github.com/users/pixijs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pixijs/pixi.js","description":"Super fast HTML 5 2D rendering engine that uses webGL with canvas fallback","fork":false,"url":"https://api.github.com/repos/pixijs/pixi.js","forks_url":"https://api.github.com/repos/pixijs/pixi.js/forks","keys_url":"https://api.github.com/repos/pixijs/pixi.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pixijs/pixi.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pixijs/pixi.js/teams","hooks_url":"https://api.github.com/repos/pixijs/pixi.js/hooks","issue_events_url":"https://api.github.com/repos/pixijs/pixi.js/issues/events{/number}","events_url":"https://api.github.com/repos/pixijs/pixi.js/events","assignees_url":"https://api.github.com/repos/pixijs/pixi.js/assignees{/user}","branches_url":"https://api.github.com/repos/pixijs/pixi.js/branches{/branch}","tags_url":"https://api.github.com/repos/pixijs/pixi.js/tags","blobs_url":"https://api.github.com/repos/pixijs/pixi.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pixijs/pixi.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pixijs/pixi.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/pixijs/pixi.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pixijs/pixi.js/statuses/{sha}","languages_url":"https://api.github.com/repos/pixijs/pixi.js/languages","stargazers_url":"https://api.github.com/repos/pixijs/pixi.js/stargazers","contributors_url":"https://api.github.com/repos/pixijs/pixi.js/contributors","subscribers_url":"https://api.github.com/repos/pixijs/pixi.js/subscribers","subscription_url":"https://api.github.com/repos/pixijs/pixi.js/subscription","commits_url":"https://api.github.com/repos/pixijs/pixi.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/pixijs/pixi.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/pixijs/pixi.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/pixijs/pixi.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/pixijs/pixi.js/contents/{+path}","compare_url":"https://api.github.com/repos/pixijs/pixi.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pixijs/pixi.js/merges","archive_url":"https://api.github.com/repos/pixijs/pixi.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pixijs/pixi.js/downloads","issues_url":"https://api.github.com/repos/pixijs/pixi.js/issues{/number}","pulls_url":"https://api.github.com/repos/pixijs/pixi.js/pulls{/number}","milestones_url":"https://api.github.com/repos/pixijs/pixi.js/milestones{/number}","notifications_url":"https://api.github.com/repos/pixijs/pixi.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pixijs/pixi.js/labels{/name}","releases_url":"https://api.github.com/repos/pixijs/pixi.js/releases{/id}","deployments_url":"https://api.github.com/repos/pixijs/pixi.js/deployments","created_at":"2013-01-21T22:40:50Z","updated_at":"2016-10-31T14:38:38Z","pushed_at":"2016-10-31T15:00:25Z","git_url":"git://github.com/pixijs/pixi.js.git","ssh_url":"git@github.com:pixijs/pixi.js.git","clone_url":"https://github.com/pixijs/pixi.js.git","svn_url":"https://github.com/pixijs/pixi.js","homepage":null,"size":88565,"stargazers_count":11970,"watchers_count":11970,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2252,"mirror_url":null,"open_issues_count":175,"forks":2252,"open_issues":175,"watchers":11970,"default_branch":"master"}},"base":{"label":"pixijs:dev","ref":"dev","sha":"4acafd79ff32b9db2bb1c439b7906d85d3f2ef27","user":{"login":"pixijs","id":5406849,"avatar_url":"https://avatars.githubusercontent.com/u/5406849?v=3","gravatar_id":"","url":"https://api.github.com/users/pixijs","html_url":"https://github.com/pixijs","followers_url":"https://api.github.com/users/pixijs/followers","following_url":"https://api.github.com/users/pixijs/following{/other_user}","gists_url":"https://api.github.com/users/pixijs/gists{/gist_id}","starred_url":"https://api.github.com/users/pixijs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pixijs/subscriptions","organizations_url":"https://api.github.com/users/pixijs/orgs","repos_url":"https://api.github.com/users/pixijs/repos","events_url":"https://api.github.com/users/pixijs/events{/privacy}","received_events_url":"https://api.github.com/users/pixijs/received_events","type":"Organization","site_admin":false},"repo":{"id":7741856,"name":"pixi.js","full_name":"pixijs/pixi.js","owner":{"login":"pixijs","id":5406849,"avatar_url":"https://avatars.githubusercontent.com/u/5406849?v=3","gravatar_id":"","url":"https://api.github.com/users/pixijs","html_url":"https://github.com/pixijs","followers_url":"https://api.github.com/users/pixijs/followers","following_url":"https://api.github.com/users/pixijs/following{/other_user}","gists_url":"https://api.github.com/users/pixijs/gists{/gist_id}","starred_url":"https://api.github.com/users/pixijs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pixijs/subscriptions","organizations_url":"https://api.github.com/users/pixijs/orgs","repos_url":"https://api.github.com/users/pixijs/repos","events_url":"https://api.github.com/users/pixijs/events{/privacy}","received_events_url":"https://api.github.com/users/pixijs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pixijs/pixi.js","description":"Super fast HTML 5 2D rendering engine that uses webGL with canvas fallback","fork":false,"url":"https://api.github.com/repos/pixijs/pixi.js","forks_url":"https://api.github.com/repos/pixijs/pixi.js/forks","keys_url":"https://api.github.com/repos/pixijs/pixi.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pixijs/pixi.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pixijs/pixi.js/teams","hooks_url":"https://api.github.com/repos/pixijs/pixi.js/hooks","issue_events_url":"https://api.github.com/repos/pixijs/pixi.js/issues/events{/number}","events_url":"https://api.github.com/repos/pixijs/pixi.js/events","assignees_url":"https://api.github.com/repos/pixijs/pixi.js/assignees{/user}","branches_url":"https://api.github.com/repos/pixijs/pixi.js/branches{/branch}","tags_url":"https://api.github.com/repos/pixijs/pixi.js/tags","blobs_url":"https://api.github.com/repos/pixijs/pixi.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pixijs/pixi.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pixijs/pixi.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/pixijs/pixi.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pixijs/pixi.js/statuses/{sha}","languages_url":"https://api.github.com/repos/pixijs/pixi.js/languages","stargazers_url":"https://api.github.com/repos/pixijs/pixi.js/stargazers","contributors_url":"https://api.github.com/repos/pixijs/pixi.js/contributors","subscribers_url":"https://api.github.com/repos/pixijs/pixi.js/subscribers","subscription_url":"https://api.github.com/repos/pixijs/pixi.js/subscription","commits_url":"https://api.github.com/repos/pixijs/pixi.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/pixijs/pixi.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/pixijs/pixi.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/pixijs/pixi.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/pixijs/pixi.js/contents/{+path}","compare_url":"https://api.github.com/repos/pixijs/pixi.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pixijs/pixi.js/merges","archive_url":"https://api.github.com/repos/pixijs/pixi.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pixijs/pixi.js/downloads","issues_url":"https://api.github.com/repos/pixijs/pixi.js/issues{/number}","pulls_url":"https://api.github.com/repos/pixijs/pixi.js/pulls{/number}","milestones_url":"https://api.github.com/repos/pixijs/pixi.js/milestones{/number}","notifications_url":"https://api.github.com/repos/pixijs/pixi.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pixijs/pixi.js/labels{/name}","releases_url":"https://api.github.com/repos/pixijs/pixi.js/releases{/id}","deployments_url":"https://api.github.com/repos/pixijs/pixi.js/deployments","created_at":"2013-01-21T22:40:50Z","updated_at":"2016-10-31T14:38:38Z","pushed_at":"2016-10-31T15:00:25Z","git_url":"git://github.com/pixijs/pixi.js.git","ssh_url":"git@github.com:pixijs/pixi.js.git","clone_url":"https://github.com/pixijs/pixi.js.git","svn_url":"https://github.com/pixijs/pixi.js","homepage":null,"size":88565,"stargazers_count":11970,"watchers_count":11970,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2252,"mirror_url":null,"open_issues_count":175,"forks":2252,"open_issues":175,"watchers":11970,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pixijs/pixi.js/pulls/3201"},"html":{"href":"https://github.com/pixijs/pixi.js/pull/3201"},"issue":{"href":"https://api.github.com/repos/pixijs/pixi.js/issues/3201"},"comments":{"href":"https://api.github.com/repos/pixijs/pixi.js/issues/3201/comments"},"review_comments":{"href":"https://api.github.com/repos/pixijs/pixi.js/pulls/3201/comments"},"review_comment":{"href":"https://api.github.com/repos/pixijs/pixi.js/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pixijs/pixi.js/pulls/3201/commits"},"statuses":{"href":"https://api.github.com/repos/pixijs/pixi.js/statuses/5205103ef489460a278bf88877d5174bbc9235f7"}}}}
{"actor":{"display_login":"englercj"}}