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

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

Issue 1785873003: Implement GL support for buffer textures (Closed) Base URL: https://skia.googlesource.com/skia.git@upload_glTexBuffer
Patch Set: rebase Created 4 years, 9 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/GrGLSL.h ('k') | src/gpu/glsl/GrGLSLShaderBuilder.h » ('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 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 ++fNumFragmentSamplers; 233 ++fNumFragmentSamplers;
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 } else if (kSamplerBuffer_GrSLType == samplerType) {
244 if (const char* extension = this->glslCaps()->bufferTextureExtension String()) {
245 this->addFeature(visibility,
246 1 << GrGLSLShaderBuilder::kBufferTexture_GLSLPr ivateFeature,
247 extension);
248 }
243 } 249 }
244 name.printf("Sampler%d", t); 250 name.printf("Sampler%d", t);
245 localSamplerUniforms[t] = this->uniformHandler()->addUniform(access.getV isibility(), 251 localSamplerUniforms[t] = this->uniformHandler()->addUniform(access.getV isibility(),
246 samplerType , 252 samplerType ,
247 access.getP recision(), 253 access.getP recision(),
248 name.c_str( )); 254 name.c_str( ));
249 outSamplers->emplace_back(localSamplerUniforms[t], access); 255 outSamplers->emplace_back(localSamplerUniforms[t], access);
250 } 256 }
251 } 257 }
252 258
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 delete fFragmentProcessors[i]; 369 delete fFragmentProcessors[i];
364 } 370 }
365 } 371 }
366 372
367 void GrGLSLProgramBuilder::finalizeShaders() { 373 void GrGLSLProgramBuilder::finalizeShaders() {
368 this->varyingHandler()->finalize(); 374 this->varyingHandler()->finalize();
369 fVS.finalize(kVertex_GrShaderFlag); 375 fVS.finalize(kVertex_GrShaderFlag);
370 fFS.finalize(kFragment_GrShaderFlag); 376 fFS.finalize(kFragment_GrShaderFlag);
371 377
372 } 378 }
OLDNEW
« no previous file with comments | « src/gpu/glsl/GrGLSL.h ('k') | src/gpu/glsl/GrGLSLShaderBuilder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698