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

Unified Diff: src/gpu/gl/GrGLProgramDesc.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/gl/GrGLGpu.cpp ('k') | src/gpu/glsl/GrGLSLFragmentShaderBuilder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « src/gpu/gl/GrGLGpu.cpp ('k') | src/gpu/glsl/GrGLSLFragmentShaderBuilder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698