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

Side by Side Diff: src/gpu/gl/builders/GrGLProgramBuilder.cpp

Issue 1438003003: Move all ShaderBuilder files to GLSL (Closed) Base URL: https://skia.googlesource.com/skia.git@glslProgBuild
Patch Set: nits Created 5 years, 1 month 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/gl/builders/GrGLProgramBuilder.h ('k') | src/gpu/gl/builders/GrGLShaderBuilder.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 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 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 for (int t = 0; t < numTextures; ++t) { 349 for (int t = 0; t < numTextures; ++t) {
350 name.printf("Sampler%d", t); 350 name.printf("Sampler%d", t);
351 localSamplerUniforms[t] = this->addUniform(GrGLProgramBuilder::kFragment _Visibility, 351 localSamplerUniforms[t] = this->addUniform(GrGLProgramBuilder::kFragment _Visibility,
352 kSampler2D_GrSLType, kDefault _GrSLPrecision, 352 kSampler2D_GrSLType, kDefault _GrSLPrecision,
353 name.c_str()); 353 name.c_str());
354 SkNEW_APPEND_TO_TARRAY(outSamplers, GrGLSLTextureSampler, 354 SkNEW_APPEND_TO_TARRAY(outSamplers, GrGLSLTextureSampler,
355 (localSamplerUniforms[t], processor.textureAccess (t))); 355 (localSamplerUniforms[t], processor.textureAccess (t)));
356 } 356 }
357 } 357 }
358 358
359 bool GrGLProgramBuilder::compileAndAttachShaders(GrGLShaderBuilder& shader, 359 bool GrGLProgramBuilder::compileAndAttachShaders(GrGLSLShaderBuilder& shader,
360 GrGLuint programId, 360 GrGLuint programId,
361 GrGLenum type, 361 GrGLenum type,
362 SkTDArray<GrGLuint>* shaderIds) { 362 SkTDArray<GrGLuint>* shaderIds) {
363 GrGLGpu* gpu = this->gpu(); 363 GrGLGpu* gpu = this->gpu();
364 GrGLuint shaderId = GrGLCompileAndAttachShader(gpu->glContext(), 364 GrGLuint shaderId = GrGLCompileAndAttachShader(gpu->glContext(),
365 programId, 365 programId,
366 type, 366 type,
367 shader.fCompilerStrings.begin (), 367 shader.fCompilerStrings.begin (),
368 shader.fCompilerStringLengths .begin(), 368 shader.fCompilerStringLengths .begin(),
369 shader.fCompilerStrings.count (), 369 shader.fCompilerStrings.count (),
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 int count = fUniforms.count(); 435 int count = fUniforms.count();
436 for (int i = 0; i < count; ++i) { 436 for (int i = 0; i < count; ++i) {
437 GL_CALL(BindUniformLocation(programID, i, fUniforms[i].fVariable.c_s tr())); 437 GL_CALL(BindUniformLocation(programID, i, fUniforms[i].fVariable.c_s tr()));
438 fUniforms[i].fLocation = i; 438 fUniforms[i].fLocation = i;
439 } 439 }
440 } 440 }
441 441
442 const GrGLCaps& caps = this->gpu()->glCaps(); 442 const GrGLCaps& caps = this->gpu()->glCaps();
443 if (fFS.hasCustomColorOutput() && caps.bindFragDataLocationSupport()) { 443 if (fFS.hasCustomColorOutput() && caps.bindFragDataLocationSupport()) {
444 GL_CALL(BindFragDataLocation(programID, 0, 444 GL_CALL(BindFragDataLocation(programID, 0,
445 GrGLFragmentShaderBuilder::DeclaredColorOut putName())); 445 GrGLSLFragmentShaderBuilder::DeclaredColorO utputName()));
446 } 446 }
447 if (fFS.hasSecondaryOutput() && caps.glslCaps()->mustDeclareFragmentShaderOu tput()) { 447 if (fFS.hasSecondaryOutput() && caps.glslCaps()->mustDeclareFragmentShaderOu tput()) {
448 GL_CALL(BindFragDataLocationIndexed(programID, 0, 1, 448 GL_CALL(BindFragDataLocationIndexed(programID, 0, 1,
449 GrGLFragmentShaderBuilder::DeclaredSecondary ColorOutputName())); 449 GrGLSLFragmentShaderBuilder::DeclaredSecondary ColorOutputName()));
450 } 450 }
451 451
452 // handle NVPR separable varyings 452 // handle NVPR separable varyings
453 if (!fGpu->glCaps().shaderCaps()->pathRenderingSupport() || 453 if (!fGpu->glCaps().shaderCaps()->pathRenderingSupport() ||
454 !fGpu->glPathRendering()->shouldBindFragmentInputs()) { 454 !fGpu->glPathRendering()->shouldBindFragmentInputs()) {
455 return; 455 return;
456 } 456 }
457 int count = fSeparableVaryingInfos.count(); 457 int count = fSeparableVaryingInfos.count();
458 for (int i = 0; i < count; ++i) { 458 for (int i = 0; i < count; ++i) {
459 GL_CALL(BindFragmentInputLocation(programID, 459 GL_CALL(BindFragmentInputLocation(programID,
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 } 531 }
532 532
533 //////////////////////////////////////////////////////////////////////////////// /////////////////// 533 //////////////////////////////////////////////////////////////////////////////// ///////////////////
534 534
535 GrGLInstalledFragProcs::~GrGLInstalledFragProcs() { 535 GrGLInstalledFragProcs::~GrGLInstalledFragProcs() {
536 int numProcs = fProcs.count(); 536 int numProcs = fProcs.count();
537 for (int i = 0; i < numProcs; ++i) { 537 for (int i = 0; i < numProcs; ++i) {
538 delete fProcs[i]; 538 delete fProcs[i];
539 } 539 }
540 } 540 }
OLDNEW
« no previous file with comments | « src/gpu/gl/builders/GrGLProgramBuilder.h ('k') | src/gpu/gl/builders/GrGLShaderBuilder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698