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

Side by Side 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: move into GrProcessor 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 #include "GrVkProgramDesc.h" 7 #include "GrVkProgramDesc.h"
8 8
9 //#include "GrVkProcessor.h" 9 //#include "GrVkProcessor.h"
10 #include "GrProcessor.h" 10 #include "GrProcessor.h"
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 requiredFeatures |= xp.requiredFeatures(); 127 requiredFeatures |= xp.requiredFeatures();
128 128
129 // --------DO NOT MOVE HEADER ABOVE THIS LINE------------------------------- ------------------- 129 // --------DO NOT MOVE HEADER ABOVE THIS LINE------------------------------- -------------------
130 // Because header is a pointer into the dynamic array, we can't push any new data into the key 130 // Because header is a pointer into the dynamic array, we can't push any new data into the key
131 // below here. 131 // below here.
132 KeyHeader* header = vkDesc->atOffset<KeyHeader, kHeaderOffset>(); 132 KeyHeader* header = vkDesc->atOffset<KeyHeader, kHeaderOffset>();
133 133
134 // make sure any padding in the header is zeroed. 134 // make sure any padding in the header is zeroed.
135 memset(header, 0, kHeaderSize); 135 memset(header, 0, kHeaderSize);
136 136
137 GrRenderTarget* rt = pipeline.getRenderTarget();
138
137 if (requiredFeatures & GrProcessor::kFragmentPosition_RequiredFeature) { 139 if (requiredFeatures & GrProcessor::kFragmentPosition_RequiredFeature) {
138 header->fFragPosKey = 140 header->fFragPosKey = GrGLSLFragmentShaderBuilder::KeyForFragmentPositio n(rt);
139 GrGLSLFragmentShaderBuilder::KeyForFragmentPosition(pipeline.getRend erTarget());
140 } else { 141 } else {
141 header->fFragPosKey = 0; 142 header->fFragPosKey = 0;
142 } 143 }
143 144
144 header->fOutputSwizzle = 145 header->fOutputSwizzle = glslCaps.configOutputSwizzle(rt->config()).asKey();
145 glslCaps.configOutputSwizzle(pipeline.getRenderTarget()->config()).asKey ();
146 146
147 if (pipeline.ignoresCoverage()) { 147 if (pipeline.ignoresCoverage()) {
148 header->fIgnoresCoverage = 1; 148 header->fIgnoresCoverage = 1;
149 } else { 149 } else {
150 header->fIgnoresCoverage = 0; 150 header->fIgnoresCoverage = 0;
151 } 151 }
152 152
153 header->fSnapVerticesToPixelCenters = pipeline.snapVerticesToPixelCenters(); 153 header->fSnapVerticesToPixelCenters = pipeline.snapVerticesToPixelCenters();
154 header->fColorEffectCnt = pipeline.numColorFragmentProcessors(); 154 header->fColorEffectCnt = pipeline.numColorFragmentProcessors();
155 header->fCoverageEffectCnt = pipeline.numCoverageFragmentProcessors(); 155 header->fCoverageEffectCnt = pipeline.numCoverageFragmentProcessors();
156
157 if (requiredFeatures & GrProcessor::kSampleLocations_RequiredFeature) {
158 SkASSERT(pipeline.isHWAntialiasState());
159 header->fSamplePatternKey =
160 rt->renderTargetPriv().getSamplePatternID(pipeline.getStencil());
161 } else {
162 header->fSamplePatternKey = 0;
163 }
164
156 vkDesc->finalize(); 165 vkDesc->finalize();
157 return true; 166 return true;
158 } 167 }
OLDNEW
« src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp ('K') | « src/gpu/glsl/GrGLSLProgramBuilder.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698