OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 "GrGLProgramBuilder.h" | 8 #include "GrGLProgramBuilder.h" |
9 | 9 |
10 #include "GrAutoLocaleSetter.h" | 10 #include "GrAutoLocaleSetter.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 GrSLType samplerType = get_sampler_type(processor.textureAccess(t)); | 90 GrSLType samplerType = get_sampler_type(processor.textureAccess(t)); |
91 localSamplerUniforms[t] = fUniformHandler.addUniform(kFragment_GrShaderF
lag, samplerType, | 91 localSamplerUniforms[t] = fUniformHandler.addUniform(kFragment_GrShaderF
lag, samplerType, |
92 kDefault_GrSLPrecis
ion, name.c_str()); | 92 kDefault_GrSLPrecis
ion, name.c_str()); |
93 outSamplers->emplace_back(localSamplerUniforms[t], processor.textureAcce
ss(t)); | 93 outSamplers->emplace_back(localSamplerUniforms[t], processor.textureAcce
ss(t)); |
94 if (kSamplerExternal_GrSLType == samplerType) { | 94 if (kSamplerExternal_GrSLType == samplerType) { |
95 const char* externalFeatureString = this->glslCaps()->externalTextur
eExtensionString(); | 95 const char* externalFeatureString = this->glslCaps()->externalTextur
eExtensionString(); |
96 // We shouldn't ever create a GrGLTexture that requires external sam
pler type | 96 // We shouldn't ever create a GrGLTexture that requires external sam
pler type |
97 SkASSERT(externalFeatureString); | 97 SkASSERT(externalFeatureString); |
98 fFS.addFeature(1 << GrGLSLFragmentShaderBuilder::kExternalTexture_GL
SLPrivateFeature, | 98 fFS.addFeature(1 << GrGLSLFragmentShaderBuilder::kExternalTexture_GL
SLPrivateFeature, |
99 externalFeatureString); | 99 externalFeatureString); |
| 100 } else if (kSampler2DRect_GrSLType == samplerType) { |
| 101 const char* rectangleFeatureString = |
| 102 this->glslCaps()->rectangleTextureExtensionString(); |
| 103 fFS.addFeature(1 << GrGLSLFragmentShaderBuilder::kRectangleTexture_G
LSLPrivateFeature, |
| 104 rectangleFeatureString); |
100 } | 105 } |
101 } | 106 } |
102 } | 107 } |
103 | 108 |
104 bool GrGLProgramBuilder::compileAndAttachShaders(GrGLSLShaderBuilder& shader, | 109 bool GrGLProgramBuilder::compileAndAttachShaders(GrGLSLShaderBuilder& shader, |
105 GrGLuint programId, | 110 GrGLuint programId, |
106 GrGLenum type, | 111 GrGLenum type, |
107 SkTDArray<GrGLuint>* shaderIds)
{ | 112 SkTDArray<GrGLuint>* shaderIds)
{ |
108 GrGLGpu* gpu = this->gpu(); | 113 GrGLGpu* gpu = this->gpu(); |
109 GrGLuint shaderId = GrGLCompileAndAttachShader(gpu->glContext(), | 114 GrGLuint shaderId = GrGLCompileAndAttachShader(gpu->glContext(), |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 fUniformHandles, | 267 fUniformHandles, |
263 programID, | 268 programID, |
264 fUniformHandler.fUniforms, | 269 fUniformHandler.fUniforms, |
265 fVaryingHandler.fPathProcVaryingInfos, | 270 fVaryingHandler.fPathProcVaryingInfos, |
266 fGeometryProcessor, | 271 fGeometryProcessor, |
267 fXferProcessor, | 272 fXferProcessor, |
268 fFragmentProcessors, | 273 fFragmentProcessors, |
269 &fSamplerUniforms); | 274 &fSamplerUniforms); |
270 } | 275 } |
271 | 276 |
OLD | NEW |