OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 #ifndef GrGLShaderVar_DEFINED | 8 #ifndef GrGLShaderVar_DEFINED |
9 #define GrGLShaderVar_DEFINED | 9 #define GrGLShaderVar_DEFINED |
10 | 10 |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 /** | 152 /** |
153 * Write a declaration of this variable to out. | 153 * Write a declaration of this variable to out. |
154 */ | 154 */ |
155 void appendDecl(const GrGLContextInfo& ctxInfo, SkString* out) const { | 155 void appendDecl(const GrGLContextInfo& ctxInfo, SkString* out) const { |
156 if (kUpperLeft_Origin == fOrigin) { | 156 if (kUpperLeft_Origin == fOrigin) { |
157 // this is the only place where we specify a layout modifier. If we
use other layout | 157 // this is the only place where we specify a layout modifier. If we
use other layout |
158 // modifiers in the future then they should be placed in a list. | 158 // modifiers in the future then they should be placed in a list. |
159 out->append("layout(origin_upper_left) "); | 159 out->append("layout(origin_upper_left) "); |
160 } | 160 } |
161 if (this->getTypeModifier() != kNone_TypeModifier) { | 161 if (this->getTypeModifier() != kNone_TypeModifier) { |
162 out->append(TypeModifierString(this->getTypeModifier(), | 162 out->append(TypeModifierString(this->getTypeModifier(), ctxInfo.glslG
eneration())); |
163 ctxInfo.glslGeneration())); | |
164 out->append(" "); | 163 out->append(" "); |
165 } | 164 } |
166 out->append(PrecisionString(fPrecision, ctxInfo.standard())); | 165 out->append(PrecisionString(fPrecision, ctxInfo.standard())); |
167 GrSLType effectiveType = this->getType(); | 166 GrSLType effectiveType = this->getType(); |
168 if (this->isArray()) { | 167 if (this->isArray()) { |
169 if (this->isUnsizedArray()) { | 168 if (this->isUnsizedArray()) { |
170 out->appendf("%s %s[]", | 169 out->appendf("%s %s[]", |
171 GrGLSLTypeString(effectiveType), | 170 GrGLSLTypeString(effectiveType), |
172 this->getName().c_str()); | 171 this->getName().c_str()); |
173 } else { | 172 } else { |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 | 243 |
245 Origin fOrigin; | 244 Origin fOrigin; |
246 /// Work around driver bugs on some hardware that don't correctly | 245 /// Work around driver bugs on some hardware that don't correctly |
247 /// support uniform float [] | 246 /// support uniform float [] |
248 bool fUseUniformFloatArrays; | 247 bool fUseUniformFloatArrays; |
249 | 248 |
250 typedef GrShaderVar INHERITED; | 249 typedef GrShaderVar INHERITED; |
251 }; | 250 }; |
252 | 251 |
253 #endif | 252 #endif |
OLD | NEW |