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

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

Issue 1734163002: Replace fWillReadFragmentPosition with a bitfield (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: BuiltInState -> RequiredFeatures 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
« no previous file with comments | « src/gpu/glsl/GrGLSLFragmentShaderBuilder.h ('k') | src/gpu/glsl/GrGLSLProgramBuilder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp
diff --git a/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp b/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp
index 44db57e68d840067e7cd6da474b026bb60e84366..bd0108407f076d5fce9ee45e2dcba8c80939107a 100644
--- a/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp
+++ b/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp
@@ -74,10 +74,16 @@ GrGLSLFragmentShaderBuilder::GrGLSLFragmentShaderBuilder(GrGLSLProgramBuilder* p
, fHasCustomColorOutput(false)
, fCustomColorOutputIndex(-1)
, fHasSecondaryOutput(false)
- , fHasInitializedSampleMask(false)
- , fHasReadDstColor(false)
- , fHasReadFragmentPosition(false) {
+ , fHasInitializedSampleMask(false) {
fSubstageIndices.push_back(0);
+#ifdef SK_DEBUG
+ fUsedProcessorFeatures = GrProcessor::kNone_RequiredFeatures;
+ fHasReadDstColor = false;
+#endif
+}
+
+bool GrGLSLFragmentShaderBuilder::hasFragmentPosition() const {
+ return 0 != fProgramBuilder->header().fFragPosKey;
}
bool GrGLSLFragmentShaderBuilder::enableFeature(GLSLFeature feature) {
@@ -123,7 +129,8 @@ SkString GrGLSLFragmentShaderBuilder::ensureFSCoords2D(const GrGLSLTransformedCo
}
const char* GrGLSLFragmentShaderBuilder::fragmentPosition() {
- fHasReadFragmentPosition = true;
+ SkASSERT(this->hasFragmentPosition());
+ SkDEBUGCODE(fUsedProcessorFeatures |= GrProcessor::kFragmentPosition_RequiredFeature;)
const GrGLSLCaps* glslCaps = fProgramBuilder->glslCaps();
// We only declare "gl_FragCoord" when we're in the case where we want to use layout qualifiers
@@ -212,7 +219,7 @@ void GrGLSLFragmentShaderBuilder::overrideSampleCoverage(const char* mask) {
}
const char* GrGLSLFragmentShaderBuilder::dstColor() {
- fHasReadDstColor = true;
+ SkDEBUGCODE(fHasReadDstColor = true;)
const char* override = fProgramBuilder->primitiveProcessor().getDestColorOverride();
if (override != nullptr) {
« no previous file with comments | « src/gpu/glsl/GrGLSLFragmentShaderBuilder.h ('k') | src/gpu/glsl/GrGLSLProgramBuilder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698