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

Unified Diff: src/gpu/GrOptDrawState.h

Issue 545693004: Calculate stage stats in GrOptDrawState (Closed) Base URL: https://skia.googlesource.com/skia.git@connectOpt2
Patch Set: Nit Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/gpu/GrOptDrawState.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrOptDrawState.h
diff --git a/src/gpu/GrOptDrawState.h b/src/gpu/GrOptDrawState.h
index 457f0354239fc8eb96d4cbc2196f103ca4dd9a88..9c9bf94597ef712d3d0b8f6735f5f5601cc9616e 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;
« no previous file with comments | « no previous file | src/gpu/GrOptDrawState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698