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 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 const char* externalFeatureString = this->glslCaps()->externalTextur
eExtensionString(); | 233 const char* externalFeatureString = this->glslCaps()->externalTextur
eExtensionString(); |
234 // We shouldn't ever create a GrGLTexture that requires external sam
pler type | 234 // We shouldn't ever create a GrGLTexture that requires external sam
pler type |
235 SkASSERT(externalFeatureString); | 235 SkASSERT(externalFeatureString); |
236 this->addFeature(visibility, | 236 this->addFeature(visibility, |
237 1 << GrGLSLShaderBuilder::kExternalTexture_GLSLPriv
ateFeature, | 237 1 << GrGLSLShaderBuilder::kExternalTexture_GLSLPriv
ateFeature, |
238 externalFeatureString); | 238 externalFeatureString); |
239 } | 239 } |
240 name.printf("Sampler%d", t); | 240 name.printf("Sampler%d", t); |
241 localSamplerUniforms[t] = this->uniformHandler()->addUniform(access.getV
isibility(), | 241 localSamplerUniforms[t] = this->uniformHandler()->addUniform(access.getV
isibility(), |
242 samplerType
, | 242 samplerType
, |
243 kDefault_Gr
SLPrecision, | 243 access.getP
recision(), |
244 name.c_str(
)); | 244 name.c_str(
)); |
245 outSamplers->emplace_back(localSamplerUniforms[t], access); | 245 outSamplers->emplace_back(localSamplerUniforms[t], access); |
246 } | 246 } |
247 } | 247 } |
248 | 248 |
249 void GrGLSLProgramBuilder::emitFSOutputSwizzle(bool hasSecondaryOutput) { | 249 void GrGLSLProgramBuilder::emitFSOutputSwizzle(bool hasSecondaryOutput) { |
250 // Swizzle the fragment shader outputs if necessary. | 250 // Swizzle the fragment shader outputs if necessary. |
251 GrSwizzle swizzle; | 251 GrSwizzle swizzle; |
252 swizzle.setFromKey(this->desc().header().fOutputSwizzle); | 252 swizzle.setFromKey(this->desc().header().fOutputSwizzle); |
253 if (swizzle != GrSwizzle::RGBA()) { | 253 if (swizzle != GrSwizzle::RGBA()) { |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 delete fFragmentProcessors[i]; | 359 delete fFragmentProcessors[i]; |
360 } | 360 } |
361 } | 361 } |
362 | 362 |
363 void GrGLSLProgramBuilder::finalizeShaders() { | 363 void GrGLSLProgramBuilder::finalizeShaders() { |
364 this->varyingHandler()->finalize(); | 364 this->varyingHandler()->finalize(); |
365 fVS.finalize(kVertex_GrShaderFlag); | 365 fVS.finalize(kVertex_GrShaderFlag); |
366 fFS.finalize(kFragment_GrShaderFlag); | 366 fFS.finalize(kFragment_GrShaderFlag); |
367 | 367 |
368 } | 368 } |
OLD | NEW |