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

Issue 5244063: Save offset from lookupAttributes in prepareVertexData

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

Description

Save offset from lookupAttributes in prepareVertexData Avoids calling lookupAttributes twice per attribute. BUG= TEST=

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+29 lines, -15 lines) Patch
M src/libGLESv2/VertexDataManager.cpp View 3 chunks +29 lines, -15 lines 0 comments Download

Messages

Total messages: 4
John Bauman
12 years, 6 months ago (2011-10-13 00:29:41 UTC) #1
nicolas
Frankly this makes it quite hard to understand the code (which already wasn't exactly trivial ...
12 years, 6 months ago (2011-10-13 13:21:27 UTC) #2
John Bauman
On 2011/10/13 13:21:27, nicolas wrote: > Frankly this makes it quite hard to understand the ...
12 years, 6 months ago (2011-10-13 18:00:11 UTC) #3
nicolas
12 years, 6 months ago (2011-10-25 19:00:56 UTC) #4
On 2011/10/13 18:00:11, John Bauman wrote:
> Currently the static buffer still works if the attribute number changes but
the
> actual attribute remains the same, for example if two passes use the same
> attributes but skip some and bind the others in a different order. It'd be
nice
> to keep that.

Sure, it's definitely worth keeping support for that. But the most typical case
will use the attributes in the exact same order for every draw. So if the cache
was a fixed array instead, with entries stored at the attribute index that was
used when the static buffer was created, then you could simply start the search
from the attribute index instead of always from the start of the STL vector that
is currently used.

I also noticed that the element type can only be 16-bit, the size is 0-4 (3
bits), stride is limited to 255 (8 bits), and normalized is a boolean. So you
could potentially store the whole element format in one 32-bit variable, instead
of the current 4 x 32-bit variables. That should speed up the comparison itself.

Anyhow, is there still a need to optimize lookupAttributes, now that other major
hotspots have been optimized?
Sign in to reply to this message.

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