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

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

Issue 522303004: Add option to add precision to varyings in shader (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Change param to fsPrecision Created 6 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
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 "GrGLFragmentShaderBuilder.h" 8 #include "GrGLFragmentShaderBuilder.h"
9 #include "GrGLShaderStringBuilder.h" 9 #include "GrGLShaderStringBuilder.h"
10 #include "GrGLProgramBuilder.h" 10 #include "GrGLProgramBuilder.h"
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 "1.0);\n", kCoordName, rtHeightName); 188 "1.0);\n", kCoordName, rtHeightName);
189 fSetupFragPosition = true; 189 fSetupFragPosition = true;
190 } 190 }
191 SkASSERT(fProgramBuilder->fUniformHandles.fRTHeightUni.isValid()); 191 SkASSERT(fProgramBuilder->fUniformHandles.fRTHeightUni.isValid());
192 return kCoordName; 192 return kCoordName;
193 } 193 }
194 } 194 }
195 195
196 void GrGLFragmentShaderBuilder::addVarying(GrSLType type, 196 void GrGLFragmentShaderBuilder::addVarying(GrSLType type,
197 const char* name, 197 const char* name,
198 const char** fsInName) { 198 const char** fsInName,
199 fInputs.push_back().set(type, GrGLShaderVar::kVaryingIn_TypeModifier, name); 199 GrGLShaderVar::Precision fsPrecision) {
200 fInputs.push_back().set(type, GrGLShaderVar::kVaryingIn_TypeModifier, name, fsPrecision);
200 if (fsInName) { 201 if (fsInName) {
201 *fsInName = name; 202 *fsInName = name;
202 } 203 }
203 } 204 }
204 205
205 void GrGLFragmentShaderBuilder::bindProgramLocations(GrGLuint programId) { 206 void GrGLFragmentShaderBuilder::bindProgramLocations(GrGLuint programId) {
206 GrGpuGL* gpu = fProgramBuilder->gpu(); 207 GrGpuGL* gpu = fProgramBuilder->gpu();
207 if (fHasCustomColorOutput) { 208 if (fHasCustomColorOutput) {
208 GL_CALL(BindFragDataLocation(programId, 0, declared_color_output_name()) ); 209 GL_CALL(BindFragDataLocation(programId, 0, declared_color_output_name()) );
209 } 210 }
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 dual_source_output_name()); 343 dual_source_output_name());
343 fHasSecondaryOutput = true; 344 fHasSecondaryOutput = true;
344 } 345 }
345 return dual_source_output_name(); 346 return dual_source_output_name();
346 } 347 }
347 348
348 const char* GrGLFragmentShaderBuilder::getColorOutputName() const { 349 const char* GrGLFragmentShaderBuilder::getColorOutputName() const {
349 return fHasCustomColorOutput ? declared_color_output_name() : "gl_FragColor" ; 350 return fHasCustomColorOutput ? declared_color_output_name() : "gl_FragColor" ;
350 } 351 }
351 352
OLDNEW
« no previous file with comments | « src/gpu/gl/builders/GrGLFragmentShaderBuilder.h ('k') | src/gpu/gl/builders/GrGLProgramBuilder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698