Index: src/gpu/vk/GrVkProgramDesc.cpp |
diff --git a/src/gpu/vk/GrVkProgramDesc.cpp b/src/gpu/vk/GrVkProgramDesc.cpp |
index 32357cdfcc22ca80b770698a464a8bc3c121afb1..74e6bbb59d0c72b929cf30a7bf311150b7de6e66 100644 |
--- a/src/gpu/vk/GrVkProgramDesc.cpp |
+++ b/src/gpu/vk/GrVkProgramDesc.cpp |
@@ -9,6 +9,7 @@ |
//#include "GrVkProcessor.h" |
#include "GrProcessor.h" |
#include "GrPipeline.h" |
+#include "GrRenderTargetPriv.h" |
#include "GrVkGpu.h" |
#include "GrVkUtil.h" |
#include "SkChecksum.h" |
@@ -134,15 +135,24 @@ bool GrVkProgramDescBuilder::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; |