OLD | NEW |
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 "GrGLShaderBuilder.h" | 8 #include "GrGLShaderBuilder.h" |
9 #include "GrGLProgramBuilder.h" | 9 #include "GrGLProgramBuilder.h" |
10 #include "GrGLShaderStringBuilder.h" | 10 #include "GrGLShaderStringBuilder.h" |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 append_texture_lookup(&this->code(), | 166 append_texture_lookup(&this->code(), |
167 fProgramBuilder->gpu(), | 167 fProgramBuilder->gpu(), |
168 samplerName, | 168 samplerName, |
169 coordName, | 169 coordName, |
170 configComponentMask, | 170 configComponentMask, |
171 swizzle, | 171 swizzle, |
172 kVec2f_GrSLType); | 172 kVec2f_GrSLType); |
173 } | 173 } |
174 | 174 |
175 void GrGLShaderBuilder::addLayoutQualifier(const char* param, InterfaceQualifier
interface) { | 175 void GrGLShaderBuilder::addLayoutQualifier(const char* param, InterfaceQualifier
interface) { |
176 SkASSERT(fProgramBuilder->gpu()->glslGeneration() >= k330_GrGLSLGeneration); | 176 SkASSERT(fProgramBuilder->gpu()->glslGeneration() >= k330_GrGLSLGeneration |
| |
| 177 fProgramBuilder->gpu()->glCaps().glslCaps()->mustEnableAdvBlendEqs(
)); |
177 fLayoutParams[interface].push_back() = param; | 178 fLayoutParams[interface].push_back() = param; |
178 } | 179 } |
179 | 180 |
180 void GrGLShaderBuilder::compileAndAppendLayoutQualifiers() { | 181 void GrGLShaderBuilder::compileAndAppendLayoutQualifiers() { |
181 static const char* interfaceQualifierNames[] = { | 182 static const char* interfaceQualifierNames[] = { |
182 "out" | 183 "out" |
183 }; | 184 }; |
184 | 185 |
185 for (int interface = 0; interface <= kLastInterfaceQualifier; ++interface) { | 186 for (int interface = 0; interface <= kLastInterfaceQualifier; ++interface) { |
186 const SkTArray<SkString>& params = fLayoutParams[interface]; | 187 const SkTArray<SkString>& params = fLayoutParams[interface]; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 fFinalized = true; | 222 fFinalized = true; |
222 | 223 |
223 if (!shaderId) { | 224 if (!shaderId) { |
224 return false; | 225 return false; |
225 } | 226 } |
226 | 227 |
227 *shaderIds->append() = shaderId; | 228 *shaderIds->append() = shaderId; |
228 | 229 |
229 return true; | 230 return true; |
230 } | 231 } |
OLD | NEW |