Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(481)

Issue 4964057: Avoid resending lots of D3D state (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 12 months ago by John Bauman
Modified:
13 years, 11 months ago
Reviewers:
dgkoch, nicolas
CC:
angleproject-review_googlegroups.com, colton_google.com
Base URL:
https://angleproject.googlecode.com/svn/trunk
Visibility:
Public.

Description

Avoid resending lots of D3D state This change uses trivial caching to determines whether to reset shaders, the viewport, and the currently set vertex declaration. It also caches the render target desc to avoid rereading that. Serial numbers are added to vertex and index buffers, so resending those can be avoided. These changes can give a big speedup (30% has been measured) on simple content, particularly when used directly or through pepper/native client. BUG= TEST=bunch of pages using webgl Committed: http://code.google.com/p/angleproject/source/detail?r=743

Patch Set 1 #

Patch Set 2 : fix vertex decls #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+129 lines, -26 lines) Patch
M src/libGLESv2/Context.h View 2 chunks +17 lines, -0 lines 0 comments Download
M src/libGLESv2/Context.cpp View 1 11 chunks +68 lines, -25 lines 4 comments Download
M src/libGLESv2/IndexDataManager.h View 3 chunks +6 lines, -0 lines 0 comments Download
M src/libGLESv2/IndexDataManager.cpp View 6 chunks +15 lines, -0 lines 0 comments Download
M src/libGLESv2/VertexDataManager.h View 2 chunks +6 lines, -0 lines 0 comments Download
M src/libGLESv2/VertexDataManager.cpp View 7 chunks +17 lines, -1 line 0 comments Download

Messages

Total messages: 4
John Bauman
13 years, 12 months ago (2011-08-31 21:10:45 UTC) #1
dgkoch
One question about the vertex declarations, but otherwise I think it looks good. http://codereview.appspot.com/4964057/diff/1001/src/libGLESv2/Context.cpp File ...
13 years, 11 months ago (2011-09-01 21:02:59 UTC) #2
John Bauman
http://codereview.appspot.com/4964057/diff/1001/src/libGLESv2/Context.cpp File src/libGLESv2/Context.cpp (right): http://codereview.appspot.com/4964057/diff/1001/src/libGLESv2/Context.cpp#newcode3755 src/libGLESv2/Context.cpp:3755: device->SetStreamSource(i, attributes[i].vertexBuffer, attributes[i].offset, attributes[i].stride); On 2011/09/01 21:03:00, dgkoch wrote: ...
13 years, 11 months ago (2011-09-01 21:08:09 UTC) #3
dgkoch
13 years, 11 months ago (2011-09-01 23:19:35 UTC) #4
On 2011/09/01 21:08:09, John Bauman wrote:
> http://codereview.appspot.com/4964057/diff/1001/src/libGLESv2/Context.cpp
> File src/libGLESv2/Context.cpp (right):
> 
>
http://codereview.appspot.com/4964057/diff/1001/src/libGLESv2/Context.cpp#new...
> src/libGLESv2/Context.cpp:3755: device->SetStreamSource(i,
> attributes[i].vertexBuffer, attributes[i].offset, attributes[i].stride);
> On 2011/09/01 21:03:00, dgkoch wrote:
> > tab character?
> oops.
> 
>
http://codereview.appspot.com/4964057/diff/1001/src/libGLESv2/Context.cpp#new...
> src/libGLESv2/Context.cpp:3783: mLastSetVDecl = entry->vertexDeclaration;
> On 2011/09/01 21:03:00, dgkoch wrote:
> > shouldn't we be using serials here (in case we get the same pointer for a
new
> > declaration after freeing a previous one)?
> 
> We only free an entry in a cache to add a new decl, so in that case the new
decl
> will be mLastSetVDecl and we don't have to worry about it.

ok. LGTM then, provided you've tested it thoroughly..
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b