Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(60)

Issue 11415161: Texture Draw Calls Coalescing (Closed)

Created:
8 years ago by whunt
Modified:
8 years ago
Reviewers:
danakj, jamesr, shawnsingh
CC:
chromium-reviews, cc-bugs_chromium.org, shawnsingh
Visibility:
Public.

Description

Texture Draw Calls Coalescing This patch batches multiple calls to DrawQuad inside GlRenderer when the calls draw textured quads that have the same texture. These quads differ only in transform for both position and UV. This patch extends the vertex shader used for drawing textures to use one of 8 matrices and UV transforms. By batching up to 8 DrawQuads into a single draw quad, we reduce the number of times many different OpenGL ES state calls are made. The implementation maintains a cache of up to 8 quads that contain the same texture and drawing parameters (e.g. opacity). If a 9th textured quad with the same parameters or a different kind of quad is drawn or any GL state (e.g. scissor rect) is changed or the new finishDrawingQuadList() function is called then the the quads are drawn in a single call and the cache is flushed. BUG=161372 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=170409

Patch Set 1 #

Total comments: 30

Patch Set 2 : Addressing first round of comments. #

Patch Set 3 : addressing Shawn's comments #

Patch Set 4 : Added a fix for a unit test that was incorrectly failing with the new patch. #

Patch Set 5 : "appeasing the trybot gods: added a .cc file to go with gl_renderer_drawcache.h" #

Patch Set 6 : Removed redundant call to activeTexture to pass unit test #

Patch Set 7 : forgot to actually add gl_renderer_drawcache.cc #

Total comments: 23

Patch Set 8 : addressing James' style comments and changing a file name #

Total comments: 7

Patch Set 9 : fixing hacker-case naming #

Patch Set 10 : moved { to line above #

Unified diffs Side-by-side diffs Delta from patch set Stats (+267 lines, -40 lines) Patch
M cc/cc.gyp View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -0 lines 0 comments Download
M cc/direct_renderer.h View 1 chunk +1 line, -0 lines 0 comments Download
M cc/direct_renderer.cc View 2 chunks +5 lines, -0 lines 0 comments Download
M cc/geometry_binding.h View 1 2 3 4 5 6 7 2 chunks +7 lines, -2 lines 0 comments Download
M cc/geometry_binding.cc View 1 2 3 4 5 6 7 8 9 2 chunks +34 lines, -11 lines 0 comments Download
M cc/gl_renderer.h View 1 2 3 4 5 6 7 5 chunks +9 lines, -0 lines 0 comments Download
M cc/gl_renderer.cc View 1 2 3 4 5 6 7 8 9 25 chunks +148 lines, -20 lines 0 comments Download
A cc/gl_renderer_draw_cache.h View 1 2 3 4 5 6 7 1 chunk +42 lines, -0 lines 0 comments Download
A + cc/gl_renderer_draw_cache.cc View 1 2 3 4 5 6 7 8 1 chunk +12 lines, -3 lines 0 comments Download
M cc/gl_renderer_unittest.cc View 1 2 3 2 chunks +2 lines, -0 lines 0 comments Download
M cc/shader.cc View 1 chunk +5 lines, -4 lines 0 comments Download

Messages

Total messages: 16 (0 generated)
whunt
First post of textured draw call coalescing.
8 years ago (2012-11-27 23:43:28 UTC) #1
danakj
https://codereview.chromium.org/11415161/diff/1/cc/gl_renderer.cc File cc/gl_renderer.cc (right): https://codereview.chromium.org/11415161/diff/1/cc/gl_renderer.cc#newcode71 cc/gl_renderer.cc:71: struct Matrix { Is there some reason to not ...
8 years ago (2012-11-27 23:47:47 UTC) #2
jamesr
As you suspect I think it'd be worth moving some of these classes into separate ...
8 years ago (2012-11-28 00:00:37 UTC) #3
whunt
https://codereview.chromium.org/11415161/diff/1/cc/gl_renderer.cc File cc/gl_renderer.cc (right): https://codereview.chromium.org/11415161/diff/1/cc/gl_renderer.cc#newcode63 cc/gl_renderer.cc:63: struct Vector { In truth we no longer need ...
8 years ago (2012-11-28 00:29:07 UTC) #4
danakj
https://codereview.chromium.org/11415161/diff/1/cc/gl_renderer.cc File cc/gl_renderer.cc (right): https://codereview.chromium.org/11415161/diff/1/cc/gl_renderer.cc#newcode71 cc/gl_renderer.cc:71: struct Matrix { On 2012/11/28 00:29:08, whunt wrote: > ...
8 years ago (2012-11-28 00:43:58 UTC) #5
shawnsingh
This is pretty awesome warren =) Here are comments I have so far.... I might ...
8 years ago (2012-11-28 19:44:16 UTC) #6
whunt
https://codereview.chromium.org/11415161/diff/1/cc/direct_renderer.cc File cc/direct_renderer.cc (right): https://codereview.chromium.org/11415161/diff/1/cc/direct_renderer.cc#newcode210 cc/direct_renderer.cc:210: void DirectRenderer::finishDrawingQuadList() DirectRenderer isn't a virtual interface, it's already ...
8 years ago (2012-11-28 22:01:15 UTC) #7
danakj
https://codereview.chromium.org/11415161/diff/1/cc/direct_renderer.cc File cc/direct_renderer.cc (right): https://codereview.chromium.org/11415161/diff/1/cc/direct_renderer.cc#newcode210 cc/direct_renderer.cc:210: void DirectRenderer::finishDrawingQuadList() On 2012/11/28 22:01:15, whunt wrote: > DirectRenderer ...
8 years ago (2012-11-28 22:03:15 UTC) #8
whunt
So this particular method isn't generally useful for any renderers that don't perform any clean ...
8 years ago (2012-11-28 23:18:00 UTC) #9
whunt
Done. It's called "float16" now and has no functionality other than getting uploaded to GL. ...
8 years ago (2012-11-28 23:18:47 UTC) #10
jamesr
This is looking really good. I've left a flotilla of style / nitpick type comments ...
8 years ago (2012-11-29 11:17:11 UTC) #11
whunt
https://codereview.chromium.org/11415161/diff/13001/cc/geometry_binding.cc File cc/geometry_binding.cc (right): https://codereview.chromium.org/11415161/diff/13001/cc/geometry_binding.cc#newcode33 cc/geometry_binding.cc:33: DCHECK(sizeof(Quad) == 24 * sizeof(float)); thanks, was looking for ...
8 years ago (2012-11-29 23:55:06 UTC) #12
jamesr
https://codereview.chromium.org/11415161/diff/5004/cc/geometry_binding.cc File cc/geometry_binding.cc (right): https://codereview.chromium.org/11415161/diff/5004/cc/geometry_binding.cc#newcode39 cc/geometry_binding.cc:39: { { belongs on previous line https://codereview.chromium.org/11415161/diff/5004/cc/gl_renderer.cc File cc/gl_renderer.cc ...
8 years ago (2012-11-30 00:31:21 UTC) #13
jamesr
lgtm
8 years ago (2012-11-30 02:01:42 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/whunt@chromium.org/11415161/10003
8 years ago (2012-11-30 02:01:56 UTC) #15
commit-bot: I haz the power
8 years ago (2012-11-30 05:42:04 UTC) #16
Message was sent while issue was closed.
Change committed as 170409

Powered by Google App Engine
This is Rietveld 408576698