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

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

Issue 14998007: Make GrGLShaderBuilder check whether GrEffect advertised that it would require the dst color or frag (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: cleanup 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.cpp ('k') | tests/GLProgramsTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLShaderBuilder.cpp
diff --git a/src/gpu/gl/GrGLShaderBuilder.cpp b/src/gpu/gl/GrGLShaderBuilder.cpp
index c1732b20e766b3b32016b6efe57344f3eb9f5afa..d9ffc00ee22ceab1001400f568b49b2d939b1304 100644
--- a/src/gpu/gl/GrGLShaderBuilder.cpp
+++ b/src/gpu/gl/GrGLShaderBuilder.cpp
@@ -230,6 +230,14 @@ void GrGLShaderBuilder::nameVariable(SkString* out, char prefix, const char* nam
}
const char* GrGLShaderBuilder::dstColor() {
+ if (fCodeStage.inStageCode()) {
+ const GrEffectRef& effect = *fCodeStage.effectStage()->getEffect();
+ if (!effect->willReadDstColor()) {
+ GrPrintf("GrGLEffect asked for dst color but its generating GrEffect "
Stephen White 2013/05/09 01:33:46 Maybe this should assert instead of printing? It
+ "did not request access.");
robertphillips 2013/05/09 13:16:11 Is there something better we could do in this case
+ return NULL;
+ }
+ }
static const char kFBFetchColorName[] = "gl_LastFragData[0]";
GrGLCaps::FBFetchType fetchType = fCtxInfo.caps()->fbFetchType();
if (GrGLCaps::kEXT_FBFetchType == fetchType) {
@@ -457,6 +465,14 @@ void GrGLShaderBuilder::addVarying(GrSLType type,
}
const char* GrGLShaderBuilder::fragmentPosition() {
+ if (fCodeStage.inStageCode()) {
+ const GrEffectRef& effect = *fCodeStage.effectStage()->getEffect();
+ if (!effect->willReadFragmentPosition()) {
+ GrPrintf("GrGLEffect asked for frag position but its generating GrEffect "
Stephen White 2013/05/09 01:33:46 Same here.
+ "did not request access.");
+ return NULL;
+ }
+ }
#if 1
if (fCtxInfo.caps()->fragCoordConventionsSupport()) {
if (!fSetupFragPosition) {
« no previous file with comments | « src/gpu/gl/GrGLProgramDesc.cpp ('k') | tests/GLProgramsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698