| 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 = 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 Loading... |
| 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 } |
| OLD | NEW |