OLD | NEW |
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 Loading... |
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 = GrPixelConfigPrecision(access.getTexture()->co
nfig()); |
244 name.printf("Sampler%d", t); | 245 name.printf("Sampler%d", t); |
245 localSamplerUniforms[t] = this->uniformHandler()->addUniform(access.getV
isibility(), | 246 localSamplerUniforms[t] = this->uniformHandler()->addUniform(access.getV
isibility(), |
246 samplerType
, | 247 samplerType
, |
247 access.getP
recision(), | 248 precision, |
248 name.c_str(
)); | 249 name.c_str(
)); |
249 outSamplers->emplace_back(localSamplerUniforms[t], access); | 250 outSamplers->emplace_back(localSamplerUniforms[t], access); |
250 } | 251 } |
251 } | 252 } |
252 | 253 |
253 void GrGLSLProgramBuilder::emitFSOutputSwizzle(bool hasSecondaryOutput) { | 254 void GrGLSLProgramBuilder::emitFSOutputSwizzle(bool hasSecondaryOutput) { |
254 // Swizzle the fragment shader outputs if necessary. | 255 // Swizzle the fragment shader outputs if necessary. |
255 GrSwizzle swizzle; | 256 GrSwizzle swizzle; |
256 swizzle.setFromKey(this->desc().header().fOutputSwizzle); | 257 swizzle.setFromKey(this->desc().header().fOutputSwizzle); |
257 if (swizzle != GrSwizzle::RGBA()) { | 258 if (swizzle != GrSwizzle::RGBA()) { |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 delete fFragmentProcessors[i]; | 364 delete fFragmentProcessors[i]; |
364 } | 365 } |
365 } | 366 } |
366 | 367 |
367 void GrGLSLProgramBuilder::finalizeShaders() { | 368 void GrGLSLProgramBuilder::finalizeShaders() { |
368 this->varyingHandler()->finalize(); | 369 this->varyingHandler()->finalize(); |
369 fVS.finalize(kVertex_GrShaderFlag); | 370 fVS.finalize(kVertex_GrShaderFlag); |
370 fFS.finalize(kFragment_GrShaderFlag); | 371 fFS.finalize(kFragment_GrShaderFlag); |
371 | 372 |
372 } | 373 } |
OLD | NEW |