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

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

Issue 1462123003: Create GrGLSLVaryingHandler class for program building (Closed) Base URL: https://skia.googlesource.com/skia.git@putCapsOnArgs
Patch Set: fix release builder Created 5 years 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/GrGLSLShaderBuilder.h ('k') | src/gpu/glsl/GrGLSLVarying.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 "glsl/GrGLSLShaderBuilder.h" 8 #include "glsl/GrGLSLShaderBuilder.h"
9 #include "glsl/GrGLSLCaps.h" 9 #include "glsl/GrGLSLCaps.h"
10 #include "glsl/GrGLSLShaderVar.h" 10 #include "glsl/GrGLSLShaderVar.h"
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 } 183 }
184 184
185 void GrGLSLShaderBuilder::finalize(uint32_t visibility) { 185 void GrGLSLShaderBuilder::finalize(uint32_t visibility) {
186 SkASSERT(!fFinalized); 186 SkASSERT(!fFinalized);
187 this->versionDecl() = fProgramBuilder->glslCaps()->versionDeclString(); 187 this->versionDecl() = fProgramBuilder->glslCaps()->versionDeclString();
188 this->compileAndAppendLayoutQualifiers(); 188 this->compileAndAppendLayoutQualifiers();
189 SkASSERT(visibility); 189 SkASSERT(visibility);
190 fProgramBuilder->appendUniformDecls((GrGLSLProgramBuilder::ShaderVisibility) visibility, 190 fProgramBuilder->appendUniformDecls((GrGLSLProgramBuilder::ShaderVisibility) visibility,
191 &this->uniforms()); 191 &this->uniforms());
192 this->appendDecls(fInputs, &this->inputs()); 192 this->appendDecls(fInputs, &this->inputs());
193 // We should not have any outputs in the fragment shader when using version 1.10
194 SkASSERT(GrGLSLProgramBuilder::kFragment_Visibility != visibility ||
195 k110_GrGLSLGeneration != fProgramBuilder->glslCaps()->generation() ||
196 fOutputs.empty());
197 this->appendDecls(fOutputs, &this->outputs()); 193 this->appendDecls(fOutputs, &this->outputs());
198 this->onFinalize(); 194 this->onFinalize();
199 // append the 'footer' to code 195 // append the 'footer' to code
200 this->code().append("}"); 196 this->code().append("}");
201 197
202 for (int i = 0; i <= fCodeIndex; i++) { 198 for (int i = 0; i <= fCodeIndex; i++) {
203 fCompilerStrings[i] = fShaderStrings[i].c_str(); 199 fCompilerStrings[i] = fShaderStrings[i].c_str();
204 fCompilerStringLengths[i] = (int)fShaderStrings[i].size(); 200 fCompilerStringLengths[i] = (int)fShaderStrings[i].size();
205 } 201 }
206 202
207 fFinalized = true; 203 fFinalized = true;
208 } 204 }
209 205
OLDNEW
« no previous file with comments | « src/gpu/glsl/GrGLSLShaderBuilder.h ('k') | src/gpu/glsl/GrGLSLVarying.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698