blob: ef2f59e664c17755932b3eaf0ab5b1c70fc95aa1 [file] [log] [blame]
bsalomon@google.comdbbc4e22012-07-25 17:48:39 +00001/*
2 * Copyright 2012 Google Inc.
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
kkinnunenec56e452014-08-25 22:21:16 -07008#include "gl/GrGLPathRendering.h"
bsalomon@google.comdbbc4e22012-07-25 17:48:39 +00009#include "gl/GrGLUniformHandle.h"
jvanverth39edf762014-12-22 11:44:19 -080010#include "gl/GrGLGpu.h"
bsalomon@google.comd8b5fac2012-11-01 17:02:46 +000011#include "SkMatrix.h"
bsalomon@google.comdbbc4e22012-07-25 17:48:39 +000012
commit-bot@chromium.orgd3baf202013-11-07 22:06:08 +000013#define ASSERT_ARRAY_UPLOAD_IN_BOUNDS(UNI, COUNT) \
14 SkASSERT(arrayCount <= uni.fArrayCount || \
15 (1 == arrayCount && GrGLShaderVar::kNonArray == uni.fArrayCount))
16
bsalomon861e1032014-12-16 07:33:49 -080017GrGLProgramDataManager::GrGLProgramDataManager(GrGLGpu* gpu, const UniformInfoArray& uniforms)
joshualitt47bb3822014-10-07 16:43:25 -070018 : fGpu(gpu) {
19 int count = uniforms.count();
kkinnunendddc18a2014-08-03 23:19:46 -070020 fUniforms.push_back_n(count);
21 for (int i = 0; i < count; i++) {
22 Uniform& uniform = fUniforms[i];
joshualitt47bb3822014-10-07 16:43:25 -070023 const UniformInfo& builderUniform = uniforms[i];
kkinnunendddc18a2014-08-03 23:19:46 -070024 SkASSERT(GrGLShaderVar::kNonArray == builderUniform.fVariable.getArrayCount() ||
25 builderUniform.fVariable.getArrayCount() > 0);
26 SkDEBUGCODE(
27 uniform.fArrayCount = builderUniform.fVariable.getArrayCount();
28 uniform.fType = builderUniform.fVariable.getType();
29 );
30 // TODO: Move the Xoom uniform array in both FS and VS bug workaround here.
bsalomon@google.comdbbc4e22012-07-25 17:48:39 +000031
joshualitt30ba4362014-08-21 20:18:45 -070032 if (GrGLProgramBuilder::kVertex_Visibility & builderUniform.fVisibility) {
kkinnunendddc18a2014-08-03 23:19:46 -070033 uniform.fVSLocation = builderUniform.fLocation;
34 } else {
35 uniform.fVSLocation = kUnusedUniform;
joshualitt47bb3822014-10-07 16:43:25 -070036 }
joshualitt30ba4362014-08-21 20:18:45 -070037 if (GrGLProgramBuilder::kFragment_Visibility & builderUniform.fVisibility) {
kkinnunendddc18a2014-08-03 23:19:46 -070038 uniform.fFSLocation = builderUniform.fLocation;
39 } else {
40 uniform.fFSLocation = kUnusedUniform;
41 }
42 }
bsalomon@google.comdbbc4e22012-07-25 17:48:39 +000043}
44
kkinnunen7510b222014-07-30 00:04:16 -070045void GrGLProgramDataManager::setSampler(UniformHandle u, GrGLint texUnit) const {
kkinnunendddc18a2014-08-03 23:19:46 -070046 const Uniform& uni = fUniforms[u.toProgramDataIndex()];
tfarina@chromium.orgf6de4752013-08-17 00:02:59 +000047 SkASSERT(uni.fType == kSampler2D_GrSLType);
48 SkASSERT(GrGLShaderVar::kNonArray == uni.fArrayCount);
bsalomon@google.com0982d352012-07-31 15:33:25 +000049 // FIXME: We still insert a single sampler uniform for every stage. If the shader does not
50 // reference the sampler then the compiler may have optimized it out. Uncomment this assert
51 // once stages insert their own samplers.
joshualittaf2d56d2015-05-11 06:21:34 -070052 // this->printUnused(uni);
bsalomon@google.comdbbc4e22012-07-25 17:48:39 +000053 if (kUnusedUniform != uni.fFSLocation) {
commit-bot@chromium.org9188a152013-09-05 18:28:24 +000054 GR_GL_CALL(fGpu->glInterface(), Uniform1i(uni.fFSLocation, texUnit));
bsalomon@google.comdbbc4e22012-07-25 17:48:39 +000055 }
56 if (kUnusedUniform != uni.fVSLocation && uni.fVSLocation != uni.fFSLocation) {
commit-bot@chromium.org9188a152013-09-05 18:28:24 +000057 GR_GL_CALL(fGpu->glInterface(), Uniform1i(uni.fVSLocation, texUnit));
bsalomon@google.comdbbc4e22012-07-25 17:48:39 +000058 }
59}
60
kkinnunen7510b222014-07-30 00:04:16 -070061void GrGLProgramDataManager::set1f(UniformHandle u, GrGLfloat v0) const {
kkinnunendddc18a2014-08-03 23:19:46 -070062 const Uniform& uni = fUniforms[u.toProgramDataIndex()];
tfarina@chromium.orgf6de4752013-08-17 00:02:59 +000063 SkASSERT(uni.fType == kFloat_GrSLType);
64 SkASSERT(GrGLShaderVar::kNonArray == uni.fArrayCount);
joshualitt7d022d62015-05-12 12:03:50 -070065 SkDEBUGCODE(this->printUnused(uni);)
bsalomon@google.comdbbc4e22012-07-25 17:48:39 +000066 if (kUnusedUniform != uni.fFSLocation) {
commit-bot@chromium.org9188a152013-09-05 18:28:24 +000067 GR_GL_CALL(fGpu->glInterface(), Uniform1f(uni.fFSLocation, v0));
bsalomon@google.comdbbc4e22012-07-25 17:48:39 +000068 }
69 if (kUnusedUniform != uni.fVSLocation && uni.fVSLocation != uni.fFSLocation) {
commit-bot@chromium.org9188a152013-09-05 18:28:24 +000070 GR_GL_CALL(fGpu->glInterface(), Uniform1f(uni.fVSLocation, v0));
bsalomon@google.comdbbc4e22012-07-25 17:48:39 +000071 }
72}
73
kkinnunen7510b222014-07-30 00:04:16 -070074void GrGLProgramDataManager::set1fv(UniformHandle u,
75 int arrayCount,
76 const GrGLfloat v[]) const {
kkinnunendddc18a2014-08-03 23:19:46 -070077 const Uniform& uni = fUniforms[u.toProgramDataIndex()];
tfarina@chromium.orgf6de4752013-08-17 00:02:59 +000078 SkASSERT(uni.fType == kFloat_GrSLType);
79 SkASSERT(arrayCount > 0);
commit-bot@chromium.orgd3baf202013-11-07 22:06:08 +000080 ASSERT_ARRAY_UPLOAD_IN_BOUNDS(uni, arrayCount);
bsalomon@google.comdbbc4e22012-07-25 17:48:39 +000081 // This assert fires in some instances of the two-pt gradient for its VSParams.
82 // Once the uniform manager is responsible for inserting the duplicate uniform
83 // arrays in VS and FS driver bug workaround, this can be enabled.
joshualittaf2d56d2015-05-11 06:21:34 -070084 // this->printUni(uni);
bsalomon@google.comdbbc4e22012-07-25 17:48:39 +000085 if (kUnusedUniform != uni.fFSLocation) {
commit-bot@chromium.orgd3baf202013-11-07 22:06:08 +000086 GR_GL_CALL(fGpu->glInterface(), Uniform1fv(uni.fFSLocation, arrayCount, v));
bsalomon@google.comdbbc4e22012-07-25 17:48:39 +000087 }
88 if (kUnusedUniform != uni.fVSLocation && uni.fVSLocation != uni.fFSLocation) {
commit-bot@chromium.orgd3baf202013-11-07 22:06:08 +000089 GR_GL_CALL(fGpu->glInterface(), Uniform1fv(uni.fVSLocation, arrayCount, v));
bsalomon@google.comdbbc4e22012-07-25 17:48:39 +000090 }
91}
92
kkinnunen7510b222014-07-30 00:04:16 -070093void GrGLProgramDataManager::set2f(UniformHandle u, GrGLfloat v0, GrGLfloat v1) const {
kkinnunendddc18a2014-08-03 23:19:46 -070094 const Uniform& uni = fUniforms[u.toProgramDataIndex()];
tfarina@chromium.orgf6de4752013-08-17 00:02:59 +000095 SkASSERT(uni.fType == kVec2f_GrSLType);
96 SkASSERT(GrGLShaderVar::kNonArray == uni.fArrayCount);
joshualitt7d022d62015-05-12 12:03:50 -070097 SkDEBUGCODE(this->printUnused(uni);)
bsalomon@google.comdbbc4e22012-07-25 17:48:39 +000098 if (kUnusedUniform != uni.fFSLocation) {
commit-bot@chromium.org9188a152013-09-05 18:28:24 +000099 GR_GL_CALL(fGpu->glInterface(), Uniform2f(uni.fFSLocation, v0, v1));
bsalomon@google.comdbbc4e22012-07-25 17:48:39 +0000100 }
101 if (kUnusedUniform != uni.fVSLocation && uni.fVSLocation != uni.fFSLocation) {
commit-bot@chromium.org9188a152013-09-05 18:28:24 +0000102 GR_GL_CALL(fGpu->glInterface(), Uniform2f(uni.fVSLocation, v0, v1));
bsalomon@google.comdbbc4e22012-07-25 17:48:39 +0000103 }
104}
105
kkinnunen7510b222014-07-30 00:04:16 -0700106void GrGLProgramDataManager::set2fv(UniformHandle u,
107 int arrayCount,
108 const GrGLfloat v[]) const {
kkinnunendddc18a2014-08-03 23:19:46 -0700109 const Uniform& uni = fUniforms[u.toProgramDataIndex()];
tfarina@chromium.orgf6de4752013-08-17 00:02:59 +0000110 SkASSERT(uni.fType == kVec2f_GrSLType);
111 SkASSERT(arrayCount > 0);
commit-bot@chromium.orgd3baf202013-11-07 22:06:08 +0000112 ASSERT_ARRAY_UPLOAD_IN_BOUNDS(uni, arrayCount);
joshualitt7d022d62015-05-12 12:03:50 -0700113 SkDEBUGCODE(this->printUnused(uni);)
bsalomon@google.comdbbc4e22012-07-25 17:48:39 +0000114 if (kUnusedUniform != uni.fFSLocation) {
commit-bot@chromium.orgd3baf202013-11-07 22:06:08 +0000115 GR_GL_CALL(fGpu->glInterface(), Uniform2fv(uni.fFSLocation, arrayCount, v));
bsalomon@google.comdbbc4e22012-07-25 17:48:39 +0000116 }
117 if (kUnusedUniform != uni.fVSLocation && uni.fVSLocation != uni.fFSLocation) {
commit-bot@chromium.orgd3baf202013-11-07 22:06:08 +0000118 GR_GL_CALL(fGpu->glInterface(), Uniform2fv(uni.fVSLocation, arrayCount, v));
bsalomon@google.comdbbc4e22012-07-25 17:48:39 +0000119 }
120}
121
kkinnunen7510b222014-07-30 00:04:16 -0700122void GrGLProgramDataManager::set3f(UniformHandle u, GrGLfloat v0, GrGLfloat v1, GrGLfloat v2) const {
kkinnunendddc18a2014-08-03 23:19:46 -0700123 const Uniform& uni = fUniforms[u.toProgramDataIndex()];
tfarina@chromium.orgf6de4752013-08-17 00:02:59 +0000124 SkASSERT(uni.fType == kVec3f_GrSLType);
125 SkASSERT(GrGLShaderVar::kNonArray == uni.fArrayCount);
joshualitt7d022d62015-05-12 12:03:50 -0700126 SkDEBUGCODE(this->printUnused(uni);)
bsalomon@google.comdbbc4e22012-07-25 17:48:39 +0000127 if (kUnusedUniform != uni.fFSLocation) {
commit-bot@chromium.org9188a152013-09-05 18:28:24 +0000128 GR_GL_CALL(fGpu->glInterface(), Uniform3f(uni.fFSLocation, v0, v1, v2));
bsalomon@google.comdbbc4e22012-07-25 17:48:39 +0000129 }
130 if (kUnusedUniform != uni.fVSLocation && uni.fVSLocation != uni.fFSLocation) {
commit-bot@chromium.org9188a152013-09-05 18:28:24 +0000131 GR_GL_CALL(fGpu->glInterface(), Uniform3f(uni.fVSLocation, v0, v1, v2));
bsalomon@google.comdbbc4e22012-07-25 17:48:39 +0000132 }
133}
134
kkinnunen7510b222014-07-30 00:04:16 -0700135void GrGLProgramDataManager::set3fv(UniformHandle u,
136 int arrayCount,
137 const GrGLfloat v[]) const {
kkinnunendddc18a2014-08-03 23:19:46 -0700138 const Uniform& uni = fUniforms[u.toProgramDataIndex()];
tfarina@chromium.orgf6de4752013-08-17 00:02:59 +0000139 SkASSERT(uni.fType == kVec3f_GrSLType);
140 SkASSERT(arrayCount > 0);
commit-bot@chromium.orgd3baf202013-11-07 22:06:08 +0000141 ASSERT_ARRAY_UPLOAD_IN_BOUNDS(uni, arrayCount);
joshualitt7d022d62015-05-12 12:03:50 -0700142 SkDEBUGCODE(this->printUnused(uni);)
bsalomon@google.comdbbc4e22012-07-25 17:48:39 +0000143 if (kUnusedUniform != uni.fFSLocation) {
commit-bot@chromium.orgd3baf202013-11-07 22:06:08 +0000144 GR_GL_CALL(fGpu->glInterface(), Uniform3fv(uni.fFSLocation, arrayCount, v));
bsalomon@google.comdbbc4e22012-07-25 17:48:39 +0000145 }
146 if (kUnusedUniform != uni.fVSLocation && uni.fVSLocation != uni.fFSLocation) {
commit-bot@chromium.orgd3baf202013-11-07 22:06:08 +0000147 GR_GL_CALL(fGpu->glInterface(), Uniform3fv(uni.fVSLocation, arrayCount, v));
bsalomon@google.comdbbc4e22012-07-25 17:48:39 +0000148 }
149}
150
kkinnunen7510b222014-07-30 00:04:16 -0700151void GrGLProgramDataManager::set4f(UniformHandle u,
152 GrGLfloat v0,
153 GrGLfloat v1,
154 GrGLfloat v2,
155 GrGLfloat v3) const {
kkinnunendddc18a2014-08-03 23:19:46 -0700156 const Uniform& uni = fUniforms[u.toProgramDataIndex()];
tfarina@chromium.orgf6de4752013-08-17 00:02:59 +0000157 SkASSERT(uni.fType == kVec4f_GrSLType);
158 SkASSERT(GrGLShaderVar::kNonArray == uni.fArrayCount);
joshualitt7d022d62015-05-12 12:03:50 -0700159 SkDEBUGCODE(this->printUnused(uni);)
bsalomon@google.comdbbc4e22012-07-25 17:48:39 +0000160 if (kUnusedUniform != uni.fFSLocation) {
commit-bot@chromium.org9188a152013-09-05 18:28:24 +0000161 GR_GL_CALL(fGpu->glInterface(), Uniform4f(uni.fFSLocation, v0, v1, v2, v3));
bsalomon@google.comdbbc4e22012-07-25 17:48:39 +0000162 }
163 if (kUnusedUniform != uni.fVSLocation && uni.fVSLocation != uni.fFSLocation) {
commit-bot@chromium.org9188a152013-09-05 18:28:24 +0000164 GR_GL_CALL(fGpu->glInterface(), Uniform4f(uni.fVSLocation, v0, v1, v2, v3));
bsalomon@google.comdbbc4e22012-07-25 17:48:39 +0000165 }
166}
167
kkinnunen7510b222014-07-30 00:04:16 -0700168void GrGLProgramDataManager::set4fv(UniformHandle u,
169 int arrayCount,
170 const GrGLfloat v[]) const {
kkinnunendddc18a2014-08-03 23:19:46 -0700171 const Uniform& uni = fUniforms[u.toProgramDataIndex()];
tfarina@chromium.orgf6de4752013-08-17 00:02:59 +0000172 SkASSERT(uni.fType == kVec4f_GrSLType);
173 SkASSERT(arrayCount > 0);
commit-bot@chromium.orgd3baf202013-11-07 22:06:08 +0000174 ASSERT_ARRAY_UPLOAD_IN_BOUNDS(uni, arrayCount);
joshualitt7d022d62015-05-12 12:03:50 -0700175 SkDEBUGCODE(this->printUnused(uni);)
bsalomon@google.comdbbc4e22012-07-25 17:48:39 +0000176 if (kUnusedUniform != uni.fFSLocation) {
commit-bot@chromium.orgd3baf202013-11-07 22:06:08 +0000177 GR_GL_CALL(fGpu->glInterface(), Uniform4fv(uni.fFSLocation, arrayCount, v));
bsalomon@google.comdbbc4e22012-07-25 17:48:39 +0000178 }
179 if (kUnusedUniform != uni.fVSLocation && uni.fVSLocation != uni.fFSLocation) {
commit-bot@chromium.orgd3baf202013-11-07 22:06:08 +0000180 GR_GL_CALL(fGpu->glInterface(), Uniform4fv(uni.fVSLocation, arrayCount, v));
bsalomon@google.comdbbc4e22012-07-25 17:48:39 +0000181 }
182}
183
kkinnunen7510b222014-07-30 00:04:16 -0700184void GrGLProgramDataManager::setMatrix3f(UniformHandle u, const GrGLfloat matrix[]) const {
kkinnunendddc18a2014-08-03 23:19:46 -0700185 const Uniform& uni = fUniforms[u.toProgramDataIndex()];
tfarina@chromium.orgf6de4752013-08-17 00:02:59 +0000186 SkASSERT(uni.fType == kMat33f_GrSLType);
187 SkASSERT(GrGLShaderVar::kNonArray == uni.fArrayCount);
joshualitt7d022d62015-05-12 12:03:50 -0700188 SkDEBUGCODE(this->printUnused(uni);)
bsalomon@google.comdbbc4e22012-07-25 17:48:39 +0000189 if (kUnusedUniform != uni.fFSLocation) {
commit-bot@chromium.org9188a152013-09-05 18:28:24 +0000190 GR_GL_CALL(fGpu->glInterface(), UniformMatrix3fv(uni.fFSLocation, 1, false, matrix));
bsalomon@google.comdbbc4e22012-07-25 17:48:39 +0000191 }
192 if (kUnusedUniform != uni.fVSLocation && uni.fVSLocation != uni.fFSLocation) {
commit-bot@chromium.org9188a152013-09-05 18:28:24 +0000193 GR_GL_CALL(fGpu->glInterface(), UniformMatrix3fv(uni.fVSLocation, 1, false, matrix));
bsalomon@google.comdbbc4e22012-07-25 17:48:39 +0000194 }
195}
196
kkinnunen7510b222014-07-30 00:04:16 -0700197void GrGLProgramDataManager::setMatrix4f(UniformHandle u, const GrGLfloat matrix[]) const {
kkinnunendddc18a2014-08-03 23:19:46 -0700198 const Uniform& uni = fUniforms[u.toProgramDataIndex()];
tfarina@chromium.orgf6de4752013-08-17 00:02:59 +0000199 SkASSERT(uni.fType == kMat44f_GrSLType);
200 SkASSERT(GrGLShaderVar::kNonArray == uni.fArrayCount);
joshualitt7d022d62015-05-12 12:03:50 -0700201 SkDEBUGCODE(this->printUnused(uni);)
bsalomon@google.comdbbc4e22012-07-25 17:48:39 +0000202 if (kUnusedUniform != uni.fFSLocation) {
commit-bot@chromium.org9188a152013-09-05 18:28:24 +0000203 GR_GL_CALL(fGpu->glInterface(), UniformMatrix4fv(uni.fFSLocation, 1, false, matrix));
bsalomon@google.comdbbc4e22012-07-25 17:48:39 +0000204 }
205 if (kUnusedUniform != uni.fVSLocation && uni.fVSLocation != uni.fFSLocation) {
commit-bot@chromium.org9188a152013-09-05 18:28:24 +0000206 GR_GL_CALL(fGpu->glInterface(), UniformMatrix4fv(uni.fVSLocation, 1, false, matrix));
bsalomon@google.comdbbc4e22012-07-25 17:48:39 +0000207 }
208}
209
kkinnunen7510b222014-07-30 00:04:16 -0700210void GrGLProgramDataManager::setMatrix3fv(UniformHandle u,
211 int arrayCount,
212 const GrGLfloat matrices[]) const {
kkinnunendddc18a2014-08-03 23:19:46 -0700213 const Uniform& uni = fUniforms[u.toProgramDataIndex()];
tfarina@chromium.orgf6de4752013-08-17 00:02:59 +0000214 SkASSERT(uni.fType == kMat33f_GrSLType);
215 SkASSERT(arrayCount > 0);
commit-bot@chromium.orgd3baf202013-11-07 22:06:08 +0000216 ASSERT_ARRAY_UPLOAD_IN_BOUNDS(uni, arrayCount);
joshualitt7d022d62015-05-12 12:03:50 -0700217 SkDEBUGCODE(this->printUnused(uni);)
bsalomon@google.comdbbc4e22012-07-25 17:48:39 +0000218 if (kUnusedUniform != uni.fFSLocation) {
commit-bot@chromium.org9188a152013-09-05 18:28:24 +0000219 GR_GL_CALL(fGpu->glInterface(),
commit-bot@chromium.orgd3baf202013-11-07 22:06:08 +0000220 UniformMatrix3fv(uni.fFSLocation, arrayCount, false, matrices));
bsalomon@google.comdbbc4e22012-07-25 17:48:39 +0000221 }
222 if (kUnusedUniform != uni.fVSLocation && uni.fVSLocation != uni.fFSLocation) {
commit-bot@chromium.org9188a152013-09-05 18:28:24 +0000223 GR_GL_CALL(fGpu->glInterface(),
commit-bot@chromium.orgd3baf202013-11-07 22:06:08 +0000224 UniformMatrix3fv(uni.fVSLocation, arrayCount, false, matrices));
bsalomon@google.comdbbc4e22012-07-25 17:48:39 +0000225 }
226}
227
kkinnunen7510b222014-07-30 00:04:16 -0700228void GrGLProgramDataManager::setMatrix4fv(UniformHandle u,
229 int arrayCount,
230 const GrGLfloat matrices[]) const {
kkinnunendddc18a2014-08-03 23:19:46 -0700231 const Uniform& uni = fUniforms[u.toProgramDataIndex()];
tfarina@chromium.orgf6de4752013-08-17 00:02:59 +0000232 SkASSERT(uni.fType == kMat44f_GrSLType);
233 SkASSERT(arrayCount > 0);
commit-bot@chromium.orgd3baf202013-11-07 22:06:08 +0000234 ASSERT_ARRAY_UPLOAD_IN_BOUNDS(uni, arrayCount);
joshualitt7d022d62015-05-12 12:03:50 -0700235 SkDEBUGCODE(this->printUnused(uni);)
bsalomon@google.comdbbc4e22012-07-25 17:48:39 +0000236 if (kUnusedUniform != uni.fFSLocation) {
commit-bot@chromium.org9188a152013-09-05 18:28:24 +0000237 GR_GL_CALL(fGpu->glInterface(),
commit-bot@chromium.orgd3baf202013-11-07 22:06:08 +0000238 UniformMatrix4fv(uni.fFSLocation, arrayCount, false, matrices));
bsalomon@google.comdbbc4e22012-07-25 17:48:39 +0000239 }
240 if (kUnusedUniform != uni.fVSLocation && uni.fVSLocation != uni.fFSLocation) {
commit-bot@chromium.org9188a152013-09-05 18:28:24 +0000241 GR_GL_CALL(fGpu->glInterface(),
commit-bot@chromium.orgd3baf202013-11-07 22:06:08 +0000242 UniformMatrix4fv(uni.fVSLocation, arrayCount, false, matrices));
bsalomon@google.comdbbc4e22012-07-25 17:48:39 +0000243 }
244}
245
kkinnunen7510b222014-07-30 00:04:16 -0700246void GrGLProgramDataManager::setSkMatrix(UniformHandle u, const SkMatrix& matrix) const {
bsalomon@google.comd8b5fac2012-11-01 17:02:46 +0000247 GrGLfloat mt[] = {
248 matrix.get(SkMatrix::kMScaleX),
249 matrix.get(SkMatrix::kMSkewY),
250 matrix.get(SkMatrix::kMPersp0),
251 matrix.get(SkMatrix::kMSkewX),
252 matrix.get(SkMatrix::kMScaleY),
253 matrix.get(SkMatrix::kMPersp1),
254 matrix.get(SkMatrix::kMTransX),
255 matrix.get(SkMatrix::kMTransY),
256 matrix.get(SkMatrix::kMPersp2),
257 };
258 this->setMatrix3f(u, mt);
259}
joshualittaf2d56d2015-05-11 06:21:34 -0700260
261#ifdef SK_DEBUG
262void GrGLProgramDataManager::printUnused(const Uniform& uni) const {
263 if (kUnusedUniform == uni.fFSLocation && kUnusedUniform == uni.fVSLocation) {
joshualitt7d022d62015-05-12 12:03:50 -0700264 GrContextDebugf(fGpu->getContext(), "Unused uniform in shader\n");
joshualittaf2d56d2015-05-11 06:21:34 -0700265 }
266}
267#endif