Ethan Nicholas | 5843012 | 2020-04-14 09:54:02 -0400 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright 2020 Google LLC |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
| 8 | #include "src/gpu/glsl/GrGLSLUniformHandler.h" |
| 9 | |
| 10 | #include "src/gpu/glsl/GrGLSL.h" |
| 11 | #include "src/gpu/glsl/GrGLSLShaderBuilder.h" |
| 12 | |
| 13 | void GrGLSLUniformHandler::writeUniformMappings(GrFragmentProcessor* owner, |
| 14 | GrGLSLShaderBuilder* b) { |
| 15 | for (int i = this->numUniforms() - 1; i >= 0; i--) { |
| 16 | UniformInfo& u = this->uniform(i); |
| 17 | if (u.fOwner == owner) { |
| 18 | u.fVisibility |= kVertex_GrShaderFlag; |
| 19 | b->codeAppendf("%s %s = %s;\n", GrGLSLTypeString(u.fVariable.getType()), |
| 20 | u.fRawName.c_str(), u.fVariable.getName().c_str()); |
| 21 | } |
| 22 | } |
| 23 | } |