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

Unified Diff: src/gpu/glsl/GrGLSLFragmentShaderBuilder.h

Issue 1734163002: Replace fWillReadFragmentPosition with a bitfield (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 10 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
Index: src/gpu/glsl/GrGLSLFragmentShaderBuilder.h
diff --git a/src/gpu/glsl/GrGLSLFragmentShaderBuilder.h b/src/gpu/glsl/GrGLSLFragmentShaderBuilder.h
index b9816af71a2a014ea8eb1388443078993c8fa4a5..05185eb0359c7b81defee4d3b38d3807c2499aae 100644
--- a/src/gpu/glsl/GrGLSLFragmentShaderBuilder.h
+++ b/src/gpu/glsl/GrGLSLFragmentShaderBuilder.h
@@ -10,6 +10,7 @@
#include "GrGLSLShaderBuilder.h"
+#include "GrProcessor.h"
#include "glsl/GrGLSLProcessorTypes.h"
class GrRenderTarget;
@@ -171,14 +172,16 @@ private:
const char* getPrimaryColorOutputName() const;
const char* getSecondaryColorOutputName() const;
+#ifdef SK_DEBUG
// As GLSLProcessors emit code, there are some conditions we need to verify. We use the below
// state to track this. The reset call is called per processor emitted.
+ bool usedBuiltInState() const { return fUsedBuiltInState; }
bool hasReadDstColor() const { return fHasReadDstColor; }
- bool hasReadFragmentPosition() const { return fHasReadFragmentPosition; }
- void reset() {
+ void resetVerification() {
+ fUsedBuiltInState = GrProcessor::kNone_BuiltInState;
fHasReadDstColor = false;
- fHasReadFragmentPosition = false;
}
+#endif
static const char* DeclaredColorOutputName() { return "fsColorOut"; }
static const char* DeclaredSecondaryColorOutputName() { return "fsSecondaryColorOut"; }
@@ -226,10 +229,12 @@ private:
bool fHasSecondaryOutput;
bool fHasInitializedSampleMask;
+#ifdef SK_DEBUG
// some state to verify shaders and effects are consistent, this is reset between effects by
// the program creator
+ GrProcessor::BuiltInState fUsedBuiltInState;
bool fHasReadDstColor;
- bool fHasReadFragmentPosition;
+#endif
friend class GrGLSLProgramBuilder;
friend class GrGLProgramBuilder;

Powered by Google App Engine
This is Rietveld 408576698