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

Side by Side Diff: src/gpu/glsl/GrGLSLProgramBuilder.cpp

Issue 1846963004: Infer sampler precision from pixel config (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: ... and gcc doesn't like the enums Created 4 years, 8 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
« no previous file with comments | « src/gpu/glsl/GrGLSLCaps.cpp ('k') | src/gpu/vk/GrVkCaps.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 7
8 #include "glsl/GrGLSLProgramBuilder.h" 8 #include "glsl/GrGLSLProgramBuilder.h"
9 9
10 #include "GrPipeline.h" 10 #include "GrPipeline.h"
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 } 234 }
235 GrSLType samplerType = access.getTexture()->samplerType(); 235 GrSLType samplerType = access.getTexture()->samplerType();
236 if (kSamplerExternal_GrSLType == samplerType) { 236 if (kSamplerExternal_GrSLType == samplerType) {
237 const char* externalFeatureString = this->glslCaps()->externalTextur eExtensionString(); 237 const char* externalFeatureString = this->glslCaps()->externalTextur eExtensionString();
238 // We shouldn't ever create a GrGLTexture that requires external sam pler type 238 // We shouldn't ever create a GrGLTexture that requires external sam pler type
239 SkASSERT(externalFeatureString); 239 SkASSERT(externalFeatureString);
240 this->addFeature(visibility, 240 this->addFeature(visibility,
241 1 << GrGLSLShaderBuilder::kExternalTexture_GLSLPriv ateFeature, 241 1 << GrGLSLShaderBuilder::kExternalTexture_GLSLPriv ateFeature,
242 externalFeatureString); 242 externalFeatureString);
243 } 243 }
244 GrSLPrecision precision = this->glslCaps()->samplerPrecision(access.getT exture()->config(),
245 visibility) ;
244 name.printf("Sampler%d", t); 246 name.printf("Sampler%d", t);
245 localSamplerUniforms[t] = this->uniformHandler()->addUniform(access.getV isibility(), 247 localSamplerUniforms[t] = this->uniformHandler()->addUniform(visibility,
246 samplerType , 248 samplerType ,
247 access.getP recision(), 249 precision,
248 name.c_str( )); 250 name.c_str( ));
249 outSamplers->emplace_back(localSamplerUniforms[t], access); 251 outSamplers->emplace_back(localSamplerUniforms[t], access);
250 } 252 }
251 } 253 }
252 254
253 void GrGLSLProgramBuilder::emitFSOutputSwizzle(bool hasSecondaryOutput) { 255 void GrGLSLProgramBuilder::emitFSOutputSwizzle(bool hasSecondaryOutput) {
254 // Swizzle the fragment shader outputs if necessary. 256 // Swizzle the fragment shader outputs if necessary.
255 GrSwizzle swizzle; 257 GrSwizzle swizzle;
256 swizzle.setFromKey(this->desc().header().fOutputSwizzle); 258 swizzle.setFromKey(this->desc().header().fOutputSwizzle);
257 if (swizzle != GrSwizzle::RGBA()) { 259 if (swizzle != GrSwizzle::RGBA()) {
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 delete fFragmentProcessors[i]; 365 delete fFragmentProcessors[i];
364 } 366 }
365 } 367 }
366 368
367 void GrGLSLProgramBuilder::finalizeShaders() { 369 void GrGLSLProgramBuilder::finalizeShaders() {
368 this->varyingHandler()->finalize(); 370 this->varyingHandler()->finalize();
369 fVS.finalize(kVertex_GrShaderFlag); 371 fVS.finalize(kVertex_GrShaderFlag);
370 fFS.finalize(kFragment_GrShaderFlag); 372 fFS.finalize(kFragment_GrShaderFlag);
371 373
372 } 374 }
OLDNEW
« no previous file with comments | « src/gpu/glsl/GrGLSLCaps.cpp ('k') | src/gpu/vk/GrVkCaps.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698