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

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

Issue 1610853002: Add ability to add general layout qualifiers GrGLSLShaderVar (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: review update Created 4 years, 11 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 | « no previous file | src/gpu/glsl/GrGLSLShaderVar.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 "GrGLSLFragmentShaderBuilder.h" 8 #include "GrGLSLFragmentShaderBuilder.h"
9 #include "GrRenderTarget.h" 9 #include "GrRenderTarget.h"
10 #include "glsl/GrGLSL.h" 10 #include "glsl/GrGLSL.h"
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 } else if (const char* extension = glslCaps->fragCoordConventionsExtensionSt ring()) { 122 } else if (const char* extension = glslCaps->fragCoordConventionsExtensionSt ring()) {
123 if (!fSetupFragPosition) { 123 if (!fSetupFragPosition) {
124 if (glslCaps->generation() < k150_GrGLSLGeneration) { 124 if (glslCaps->generation() < k150_GrGLSLGeneration) {
125 this->addFeature(1 << kFragCoordConventions_GLSLPrivateFeature, 125 this->addFeature(1 << kFragCoordConventions_GLSLPrivateFeature,
126 extension); 126 extension);
127 } 127 }
128 fInputs.push_back().set(kVec4f_GrSLType, 128 fInputs.push_back().set(kVec4f_GrSLType,
129 GrGLSLShaderVar::kIn_TypeModifier, 129 GrGLSLShaderVar::kIn_TypeModifier,
130 "gl_FragCoord", 130 "gl_FragCoord",
131 kDefault_GrSLPrecision, 131 kDefault_GrSLPrecision,
132 GrGLSLShaderVar::kUpperLeft_Origin); 132 "origin_upper_left");
133 fSetupFragPosition = true; 133 fSetupFragPosition = true;
134 } 134 }
135 return "gl_FragCoord"; 135 return "gl_FragCoord";
136 } else { 136 } else {
137 static const char* kTempName = "tmpXYFragCoord"; 137 static const char* kTempName = "tmpXYFragCoord";
138 static const char* kCoordName = "fragCoordYDown"; 138 static const char* kCoordName = "fragCoordYDown";
139 if (!fSetupFragPosition) { 139 if (!fSetupFragPosition) {
140 const char* rtHeightName; 140 const char* rtHeightName;
141 141
142 fProgramBuilder->addRTHeightUniform("RTHeight", &rtHeightName); 142 fProgramBuilder->addRTHeightUniform("RTHeight", &rtHeightName);
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 } 249 }
250 250
251 void GrGLSLFragmentBuilder::onAfterChildProcEmitCode() { 251 void GrGLSLFragmentBuilder::onAfterChildProcEmitCode() {
252 SkASSERT(fSubstageIndices.count() >= 2); 252 SkASSERT(fSubstageIndices.count() >= 2);
253 fSubstageIndices.pop_back(); 253 fSubstageIndices.pop_back();
254 fSubstageIndices.back()++; 254 fSubstageIndices.back()++;
255 int removeAt = fMangleString.findLastOf('_'); 255 int removeAt = fMangleString.findLastOf('_');
256 fMangleString.remove(removeAt, fMangleString.size() - removeAt); 256 fMangleString.remove(removeAt, fMangleString.size() - removeAt);
257 } 257 }
258 258
OLDNEW
« no previous file with comments | « no previous file | src/gpu/glsl/GrGLSLShaderVar.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698