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

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: address comments 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
« no previous file with comments | « src/gpu/gl/GrGLProgramDesc.h ('k') | src/gpu/gl/GrGLShaderBuilder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLProgramDesc.cpp
diff --git a/src/gpu/gl/GrGLProgramDesc.cpp b/src/gpu/gl/GrGLProgramDesc.cpp
index a1cd85e9f4afb6d5ad2770fd9ac03a50292ccdca..532923a19c0d4c3e6907bf761441423896abaffd 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;
}
@@ -101,10 +105,17 @@ void GrGLProgramDesc::Build(const GrDrawState& drawState,
if (NULL != dstCopy) {
dstCopyTexture = dstCopy->texture();
}
- desc->fDstRead = GrGLShaderBuilder::KeyForDstRead(dstCopyTexture, gpu->glCaps());
- GrAssert(0 != desc->fDstRead);
+ desc->fDstReadKey = GrGLShaderBuilder::KeyForDstRead(dstCopyTexture, gpu->glCaps());
+ GrAssert(0 != desc->fDstReadKey);
+ } else {
+ desc->fDstReadKey = 0;
+ }
+
+ if (readFragPosition) {
+ desc->fFragPosKey = GrGLShaderBuilder::KeyForFragmentPosition(drawState.getRenderTarget(),
+ gpu->glCaps());
} else {
- desc->fDstRead = 0;
+ desc->fFragPosKey = 0;
}
desc->fCoverageOutput = kModulate_CoverageOutput;
« no previous file with comments | « src/gpu/gl/GrGLProgramDesc.h ('k') | src/gpu/gl/GrGLShaderBuilder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698