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

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

Issue 1344943002: fix up GrGLProgrambuilder precision on varyings (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: tweaks Created 5 years, 3 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/GrGLProgramBuilder.h ('k') | src/gpu/gl/builders/GrGLVertexShaderBuilder.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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 , fXferProcessor(nullptr) 58 , fXferProcessor(nullptr)
59 , fArgs(args) 59 , fArgs(args)
60 , fGpu(gpu) 60 , fGpu(gpu)
61 , fUniforms(kVarsPerBlock) 61 , fUniforms(kVarsPerBlock)
62 , fSamplerUniforms(4) 62 , fSamplerUniforms(4)
63 , fSeparableVaryingInfos(kVarsPerBlock) { 63 , fSeparableVaryingInfos(kVarsPerBlock) {
64 } 64 }
65 65
66 void GrGLProgramBuilder::addVarying(const char* name, 66 void GrGLProgramBuilder::addVarying(const char* name,
67 GrGLVarying* varying, 67 GrGLVarying* varying,
68 GrSLPrecision fsPrecision) { 68 GrSLPrecision precision) {
69 SkASSERT(varying); 69 SkASSERT(varying);
70 if (varying->vsVarying()) { 70 if (varying->vsVarying()) {
71 fVS.addVarying(name, varying); 71 fVS.addVarying(name, precision, varying);
72 } 72 }
73 if (this->primitiveProcessor().willUseGeoShader()) { 73 if (this->primitiveProcessor().willUseGeoShader()) {
74 fGS.addVarying(name, varying); 74 fGS.addVarying(name, precision, varying);
75 } 75 }
76 if (varying->fsVarying()) { 76 if (varying->fsVarying()) {
77 fFS.addVarying(varying, fsPrecision); 77 fFS.addVarying(varying, precision);
78 } 78 }
79 } 79 }
80 80
81 void GrGLProgramBuilder::addPassThroughAttribute(const GrPrimitiveProcessor::Att ribute* input, 81 void GrGLProgramBuilder::addPassThroughAttribute(const GrPrimitiveProcessor::Att ribute* input,
82 const char* output) { 82 const char* output) {
83 GrSLType type = GrVertexAttribTypeToSLType(input->fType); 83 GrSLType type = GrVertexAttribTypeToSLType(input->fType);
84 GrGLVertToFrag v(type); 84 GrGLVertToFrag v(type);
85 this->addVarying(input->fName, &v); 85 this->addVarying(input->fName, &v);
86 fVS.codeAppendf("%s = %s;", v.vsOut(), input->fName); 86 fVS.codeAppendf("%s = %s;", v.vsOut(), input->fName);
87 fFS.codeAppendf("%s = %s;", output, v.fsIn()); 87 fFS.codeAppendf("%s = %s;", output, v.fsIn());
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after
515 } 515 }
516 516
517 //////////////////////////////////////////////////////////////////////////////// /////////////////// 517 //////////////////////////////////////////////////////////////////////////////// ///////////////////
518 518
519 GrGLInstalledFragProcs::~GrGLInstalledFragProcs() { 519 GrGLInstalledFragProcs::~GrGLInstalledFragProcs() {
520 int numProcs = fProcs.count(); 520 int numProcs = fProcs.count();
521 for (int i = 0; i < numProcs; ++i) { 521 for (int i = 0; i < numProcs; ++i) {
522 delete fProcs[i]; 522 delete fProcs[i];
523 } 523 }
524 } 524 }
OLDNEW
« no previous file with comments | « src/gpu/gl/builders/GrGLProgramBuilder.h ('k') | src/gpu/gl/builders/GrGLVertexShaderBuilder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698