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

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

Issue 1114813002: Add layout qualifiers to GrGLShaderBuilder (Closed) Base URL: https://skia.googlesource.com/skia.git@upload_zzz2_texbar
Patch Set: rebase Created 5 years, 7 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/gl/builders/GrGLShaderBuilder.cpp ('k') | no next file » | 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 "GrGLVertexShaderBuilder.h" 8 #include "GrGLVertexShaderBuilder.h"
9 #include "GrGLProgramBuilder.h" 9 #include "GrGLProgramBuilder.h"
10 #include "../GrGLGpu.h" 10 #include "../GrGLGpu.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 int vaCount = primProc.numAttribs(); 74 int vaCount = primProc.numAttribs();
75 for (int i = 0; i < vaCount; i++) { 75 for (int i = 0; i < vaCount; i++) {
76 GL_CALL(BindAttribLocation(programID, i, primProc.getAttrib(i).fName)); 76 GL_CALL(BindAttribLocation(programID, i, primProc.getAttrib(i).fName));
77 } 77 }
78 return; 78 return;
79 } 79 }
80 80
81 bool 81 bool
82 GrGLVertexBuilder::compileAndAttachShaders(GrGLuint programId, SkTDArray<GrGLuin t>* shaderIds) { 82 GrGLVertexBuilder::compileAndAttachShaders(GrGLuint programId, SkTDArray<GrGLuin t>* shaderIds) {
83 this->versionDecl() = GrGetGLSLVersionDecl(fProgramBuilder->ctxInfo()); 83 this->versionDecl() = GrGetGLSLVersionDecl(fProgramBuilder->ctxInfo());
84 this->compileAndAppendLayoutQualifiers();
84 fProgramBuilder->appendUniformDecls(GrGLProgramBuilder::kVertex_Visibility, &this->uniforms()); 85 fProgramBuilder->appendUniformDecls(GrGLProgramBuilder::kVertex_Visibility, &this->uniforms());
85 this->appendDecls(fInputs, &this->inputs()); 86 this->appendDecls(fInputs, &this->inputs());
86 this->appendDecls(fOutputs, &this->outputs()); 87 this->appendDecls(fOutputs, &this->outputs());
87 return this->finalize(programId, GR_GL_VERTEX_SHADER, shaderIds); 88 return this->finalize(programId, GR_GL_VERTEX_SHADER, shaderIds);
88 } 89 }
89 90
90 bool GrGLVertexBuilder::addAttribute(const GrShaderVar& var) { 91 bool GrGLVertexBuilder::addAttribute(const GrShaderVar& var) {
91 SkASSERT(GrShaderVar::kAttribute_TypeModifier == var.getTypeModifier()); 92 SkASSERT(GrShaderVar::kAttribute_TypeModifier == var.getTypeModifier());
92 for (int i = 0; i < fInputs.count(); ++i) { 93 for (int i = 0; i < fInputs.count(); ++i) {
93 const GrGLShaderVar& attr = fInputs[i]; 94 const GrGLShaderVar& attr = fInputs[i];
94 // if attribute already added, don't add it again 95 // if attribute already added, don't add it again
95 if (attr.getName().equals(var.getName())) { 96 if (attr.getName().equals(var.getName())) {
96 return false; 97 return false;
97 } 98 }
98 } 99 }
99 fInputs.push_back(var); 100 fInputs.push_back(var);
100 return true; 101 return true;
101 } 102 }
OLDNEW
« no previous file with comments | « src/gpu/gl/builders/GrGLShaderBuilder.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698