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

Issue 6709075: Pass the GrCustomStage and key to GrGLProgramStage emitCode. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 8 months ago by bsalomon
Modified:
11 years, 8 months ago
Reviewers:
robertphillips, TomH
CC:
skia-review_googlegroups.com
Base URL:
http://skia.googlecode.com/svn/trunk/
Visibility:
Public.

Description

Pass the GrCustomStage and key to GrGLProgramStage emitCode. The key computation may encode some analysis that emitCode may be able to skip by examining the key. Committed: https://code.google.com/p/skia/source/detail?r=6075

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+14 lines, -1 line) Patch
M src/gpu/gl/GrGLProgram.cpp View 1 chunk +7 lines, -1 line 0 comments Download
M src/gpu/gl/GrGLProgramStage.h View 3 chunks +7 lines, -0 lines 0 comments Download

Messages

Total messages: 4
bsalomon
11 years, 8 months ago (2012-10-23 20:16:41 UTC) #1
robertphillips
LGTM
11 years, 8 months ago (2012-10-23 21:36:36 UTC) #2
TomH
Isn't that some awkward coupling? Do we really save so much by skipping recomputing?
11 years, 8 months ago (2012-10-23 21:38:24 UTC) #3
bsalomon
11 years, 8 months ago (2012-10-24 13:08:46 UTC) #4
On 2012/10/23 21:38:24, TomH wrote:
> Isn't that some awkward coupling? Do we really save so much by skipping
> recomputing?

The coupling is only within an object of the same type:
static StageKey GrGLProgramStageSubclass::GenKey() and
void GrGLProgramStageSubclass::emitCode()

The texture matrix helper class I'm working on has to contribute to its host's
key. It looks at two matrices and does some checks on their typemasks to see
what shortcuts can be taken (both identity, both translate only, neither had
persp, or one/both have persp).  It also looks at the texture to check whether
it needs y-reversal.

It's not terribly expensive but it felt better to me to extract the relevant
aspects of the matrices and texture once and then pass that to emitCode() rather
than passing the matrices and texture to emitCode(). The matrices/texture are
specific to the current draw and will be different for future draws that use the
generated program. The key seems like it is the enum that describes the code to
generate for all like matrices/texture combinations.
Sign in to reply to this message.

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