aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrProgramDesc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/GrProgramDesc.cpp')
-rw-r--r--src/gpu/GrProgramDesc.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/gpu/GrProgramDesc.cpp b/src/gpu/GrProgramDesc.cpp
index c3d61985de..9c0add66e6 100644
--- a/src/gpu/GrProgramDesc.cpp
+++ b/src/gpu/GrProgramDesc.cpp
@@ -169,6 +169,7 @@ bool GrProgramDesc::Build(GrProgramDesc* desc,
desc->key().reset();
return false;
}
+ GrProcessor::RequiredFeatures requiredFeatures = primProc.requiredFeatures();
for (int i = 0; i < pipeline.numFragmentProcessors(); ++i) {
const GrFragmentProcessor& fp = pipeline.getFragmentProcessor(i);
@@ -176,6 +177,7 @@ bool GrProgramDesc::Build(GrProgramDesc* desc,
desc->key().reset();
return false;
}
+ requiredFeatures |= fp.requiredFeatures();
}
const GrXferProcessor& xp = pipeline.getXferProcessor();
@@ -190,6 +192,7 @@ bool GrProgramDesc::Build(GrProgramDesc* desc,
desc->key().reset();
return false;
}
+ requiredFeatures |= xp.requiredFeatures();
// --------DO NOT MOVE HEADER ABOVE THIS LINE--------------------------------------------------
// Because header is a pointer into the dynamic array, we can't push any new data into the key
@@ -201,6 +204,16 @@ bool GrProgramDesc::Build(GrProgramDesc* desc,
GrRenderTargetProxy* proxy = pipeline.proxy();
+ if (requiredFeatures & GrProcessor::kSampleLocations_RequiredFeature) {
+ SkASSERT(pipeline.isHWAntialiasState());
+
+ GrRenderTarget* rt = pipeline.renderTarget();
+ header->fSamplePatternKey =
+ rt->renderTargetPriv().getMultisampleSpecs(pipeline).fUniqueID;
+ } else {
+ header->fSamplePatternKey = 0;
+ }
+
header->fOutputSwizzle = shaderCaps.configOutputSwizzle(proxy->config()).asKey();
header->fSnapVerticesToPixelCenters = pipeline.snapVerticesToPixelCenters();