Chromium Code Reviews| 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) { |