diff options
author | egdaniel <egdaniel@google.com> | 2014-09-17 08:25:05 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-09-17 08:25:05 -0700 |
commit | a7dc0a83f0b59424a61e01bf3435cd7957e84e35 (patch) | |
tree | 1cc755e80acf10963d420916cdf88bf362150c57 /src/gpu/GrOptDrawState.h | |
parent | f96ba02513eadd9fa24d75396ec9f2d6682e464c (diff) |
Calculate stage stats in GrOptDrawState
BUG=skia:
R=bsalomon@google.com
Author: egdaniel@google.com
Review URL: https://codereview.chromium.org/545693004
Diffstat (limited to 'src/gpu/GrOptDrawState.h')
-rw-r--r-- | src/gpu/GrOptDrawState.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/gpu/GrOptDrawState.h b/src/gpu/GrOptDrawState.h index 457f035423..9c9bf94597 100644 --- a/src/gpu/GrOptDrawState.h +++ b/src/gpu/GrOptDrawState.h @@ -23,6 +23,11 @@ public: bool inputColorIsUsed() const { return fInputColorIsUsed; } bool inputCoverageIsUsed() const { return fInputCoverageIsUsed; } + bool readsDst() const { return fReadsDst; } + bool readsFragPosition() const { return fReadsFragPosition; } + bool requiresVertexShader() const { return fRequiresVertexShader; } + bool requiresLocalCoordAttrib() const { return fRequiresLocalCoordAttrib; } + private: /** * Constructs and optimized drawState out of a GrRODrawState. @@ -61,11 +66,23 @@ private: */ void adjustFromBlendOpts(); + /** + * Loop over the effect stages to determine various info like what data they will read and what + * shaders they require. + */ + void getStageStats(); + // These flags are needed to protect the code from creating an unused uniform color/coverage // which will cause shader compiler errors. bool fInputColorIsUsed; bool fInputCoverageIsUsed; + // These flags give aggregated info on the effect stages that are used when building programs. + bool fReadsDst; + bool fReadsFragPosition; + bool fRequiresVertexShader; + bool fRequiresLocalCoordAttrib; + SkAutoSTArray<4, GrVertexAttrib> fOptVA; BlendOptFlags fBlendOptFlags; |