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

Unified Diff: src/gpu/vk/GrVkProgramDesc.cpp

Issue 1717393002: Add "sample locations" feature to GrProcessor (Closed) Base URL: https://skia.googlesource.com/skia.git@upload_getmultisamp
Patch Set: vk stubs Created 4 years, 9 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/vk/GrVkGpu.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « src/gpu/vk/GrVkGpu.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698