Index: src/gpu/gl/GrGLProgramDesc.cpp |
diff --git a/src/gpu/gl/GrGLProgramDesc.cpp b/src/gpu/gl/GrGLProgramDesc.cpp |
index 789eb6233605fa1de22e288f898e77703aa87858..68020a92d5977accaa513eabb52944a6ffffdec9 100644 |
--- a/src/gpu/gl/GrGLProgramDesc.cpp |
+++ b/src/gpu/gl/GrGLProgramDesc.cpp |
@@ -8,6 +8,7 @@ |
#include "GrProcessor.h" |
#include "GrPipeline.h" |
+#include "GrRenderTargetPriv.h" |
#include "SkChecksum.h" |
#include "gl/GrGLDefines.h" |
#include "gl/GrGLTexture.h" |
@@ -147,15 +148,24 @@ bool GrGLProgramDescBuilder::Build(GrProgramDesc* desc, |
// make sure any padding in the header is zeroed. |
memset(header, 0, kHeaderSize); |
- if (requiredFeatures & GrProcessor::kFragmentPosition_RequiredFeature) { |
- header->fFragPosKey = |
- GrGLSLFragmentShaderBuilder::KeyForFragmentPosition(pipeline.getRenderTarget()); |
+ GrRenderTarget* rt = pipeline.getRenderTarget(); |
+ |
+ if (requiredFeatures & (GrProcessor::kFragmentPosition_RequiredFeature | |
+ GrProcessor::kSampleLocations_RequiredFeature)) { |
+ header->fSurfaceOriginKey = GrGLSLFragmentShaderBuilder::KeyForSurfaceOrigin(rt->origin()); |
+ } else { |
+ header->fSurfaceOriginKey = 0; |
+ } |
+ |
+ if (requiredFeatures & GrProcessor::kSampleLocations_RequiredFeature) { |
+ SkASSERT(pipeline.isHWAntialiasState()); |
+ header->fSamplePatternKey = |
+ rt->renderTargetPriv().getMultisampleSpecs(pipeline.getStencil()).fUniqueID; |
} else { |
- header->fFragPosKey = 0; |
+ header->fSamplePatternKey = 0; |
} |
- header->fOutputSwizzle = |
- glslCaps.configOutputSwizzle(pipeline.getRenderTarget()->config()).asKey(); |
+ header->fOutputSwizzle = glslCaps.configOutputSwizzle(rt->config()).asKey(); |
if (pipeline.ignoresCoverage()) { |
header->fIgnoresCoverage = 1; |