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

Unified Diff: src/gpu/gl/GrGLProgramDesc.cpp

Issue 14633007: Key shader on whether frag pos read is relative to top-left or bottom-left (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 7 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/gl/GrGLProgramDesc.cpp
diff --git a/src/gpu/gl/GrGLProgramDesc.cpp b/src/gpu/gl/GrGLProgramDesc.cpp
index a1cd85e9f4afb6d5ad2770fd9ac03a50292ccdca..61f6dd9e1095bfcad00e07143a62d9f83c1953b3 100644
--- a/src/gpu/gl/GrGLProgramDesc.cpp
+++ b/src/gpu/gl/GrGLProgramDesc.cpp
@@ -76,6 +76,7 @@ void GrGLProgramDesc::Build(const GrDrawState& drawState,
}
bool readsDst = false;
+ bool readFragPosition = false;
int lastEnabledStage = -1;
for (int s = 0; s < GrDrawState::kNumStages; ++s) {
@@ -90,6 +91,9 @@ void GrGLProgramDesc::Build(const GrDrawState& drawState,
if (effect->willReadDstColor()) {
readsDst = true;
}
+ if (effect->willReadFragmentPosition()) {
+ readFragPosition = true;
+ }
} else {
desc->fEffectKeys[s] = 0;
}
@@ -107,6 +111,13 @@ void GrGLProgramDesc::Build(const GrDrawState& drawState,
desc->fDstRead = 0;
}
+ if (readFragPosition) {
+ desc->fFragPos = GrGLShaderBuilder::KeyForFragmentPosition(drawState.getRenderTarget(),
+ gpu->glCaps());
+ } else {
robertphillips 2013/05/10 13:53:58 Use 'kNoFragPosRead_FragPosKey' here?
bsalomon 2013/05/13 15:16:49 It's private. I think in the long run the desc sho
+ desc->fFragPos = 0;
+ }
+
desc->fCoverageOutput = kModulate_CoverageOutput;
// Currently the experimental GS will only work with triangle prims (and it doesn't do anything

Powered by Google App Engine
This is Rietveld 408576698