Lines Matching defs:uni
13 #define ASSERT_ARRAY_UPLOAD_IN_BOUNDS(UNI, OFFSET, COUNT) \
14 GrAssert(offset + arrayCount <= uni.fArrayCount || \
15 (0 == offset && 1 == arrayCount && GrGLShaderVar::kNonArray == uni.fArrayCount))
19 Uniform& uni = fUniforms.push_back();
21 uni.fArrayCount = arrayCount;
22 uni.fType = type;
23 uni.fVSLocation = kUnusedUniform;
24 uni.fFSLocation = kUnusedUniform;
29 const Uniform& uni = fUniforms[handle_to_index(u)];
30 GrAssert(uni.fType == kSampler2D_GrSLType);
31 GrAssert(GrGLShaderVar::kNonArray == uni.fArrayCount);
35 // GrAssert(kUnusedUniform != uni.fFSLocation || kUnusedUniform != uni.fVSLocation);
36 if (kUnusedUniform != uni.fFSLocation) {
37 GR_GL_CALL(fContext.interface(), Uniform1i(uni.fFSLocation, texUnit));
39 if (kUnusedUniform != uni.fVSLocation && uni.fVSLocation != uni.fFSLocation) {
40 GR_GL_CALL(fContext.interface(), Uniform1i(uni.fVSLocation, texUnit));
45 const Uniform& uni = fUniforms[handle_to_index(u)];
46 GrAssert(uni.fType == kFloat_GrSLType);
47 GrAssert(GrGLShaderVar::kNonArray == uni.fArrayCount);
48 GrAssert(kUnusedUniform != uni.fFSLocation || kUnusedUniform != uni.fVSLocation);
49 if (kUnusedUniform != uni.fFSLocation) {
50 GR_GL_CALL(fContext.interface(), Uniform1f(uni.fFSLocation, v0));
52 if (kUnusedUniform != uni.fVSLocation && uni.fVSLocation != uni.fFSLocation) {
53 GR_GL_CALL(fContext.interface(), Uniform1f(uni.fVSLocation, v0));
61 const Uniform& uni = fUniforms[handle_to_index(u)];
62 GrAssert(uni.fType == kFloat_GrSLType);
64 ASSERT_ARRAY_UPLOAD_IN_BOUNDS(uni, offset, arrayCount);
68 //GrAssert(kUnusedUniform != uni.fFSLocation || kUnusedUniform != uni.fVSLocation);
69 if (kUnusedUniform != uni.fFSLocation) {
70 GR_GL_CALL(fContext.interface(), Uniform1fv(uni.fFSLocation + offset, arrayCount, v));
72 if (kUnusedUniform != uni.fVSLocation && uni.fVSLocation != uni.fFSLocation) {
73 GR_GL_CALL(fContext.interface(), Uniform1fv(uni.fVSLocation + offset, arrayCount, v));
78 const Uniform& uni = fUniforms[handle_to_index(u)];
79 GrAssert(uni.fType == kVec2f_GrSLType);
80 GrAssert(GrGLShaderVar::kNonArray == uni.fArrayCount);
81 GrAssert(kUnusedUniform != uni.fFSLocation || kUnusedUniform != uni.fVSLocation);
82 if (kUnusedUniform != uni.fFSLocation) {
83 GR_GL_CALL(fContext.interface(), Uniform2f(uni.fFSLocation, v0, v1));
85 if (kUnusedUniform != uni.fVSLocation && uni.fVSLocation != uni.fFSLocation) {
86 GR_GL_CALL(fContext.interface(), Uniform2f(uni.fVSLocation, v0, v1));
94 const Uniform& uni = fUniforms[handle_to_index(u)];
95 GrAssert(uni.fType == kVec2f_GrSLType);
97 ASSERT_ARRAY_UPLOAD_IN_BOUNDS(uni, offset, arrayCount);
98 GrAssert(kUnusedUniform != uni.fFSLocation || kUnusedUniform != uni.fVSLocation);
99 if (kUnusedUniform != uni.fFSLocation) {
100 GR_GL_CALL(fContext.interface(), Uniform2fv(uni.fFSLocation + offset, arrayCount, v));
102 if (kUnusedUniform != uni.fVSLocation && uni.fVSLocation != uni.fFSLocation) {
103 GR_GL_CALL(fContext.interface(), Uniform2fv(uni.fVSLocation + offset, arrayCount, v));
108 const Uniform& uni = fUniforms[handle_to_index(u)];
109 GrAssert(uni.fType == kVec3f_GrSLType);
110 GrAssert(GrGLShaderVar::kNonArray == uni.fArrayCount);
111 GrAssert(kUnusedUniform != uni.fFSLocation || kUnusedUniform != uni.fVSLocation);
112 if (kUnusedUniform != uni.fFSLocation) {
113 GR_GL_CALL(fContext.interface(), Uniform3f(uni.fFSLocation, v0, v1, v2));
115 if (kUnusedUniform != uni.fVSLocation && uni.fVSLocation != uni.fFSLocation) {
116 GR_GL_CALL(fContext.interface(), Uniform3f(uni.fVSLocation, v0, v1, v2));
124 const Uniform& uni = fUniforms[handle_to_index(u)];
125 GrAssert(uni.fType == kVec3f_GrSLType);
127 ASSERT_ARRAY_UPLOAD_IN_BOUNDS(uni, offset, arrayCount);
128 GrAssert(kUnusedUniform != uni.fFSLocation || kUnusedUniform != uni.fVSLocation);
129 if (kUnusedUniform != uni.fFSLocation) {
130 GR_GL_CALL(fContext.interface(), Uniform3fv(uni.fFSLocation + offset, arrayCount, v));
132 if (kUnusedUniform != uni.fVSLocation && uni.fVSLocation != uni.fFSLocation) {
133 GR_GL_CALL(fContext.interface(), Uniform3fv(uni.fVSLocation + offset, arrayCount, v));
142 const Uniform& uni = fUniforms[handle_to_index(u)];
143 GrAssert(uni.fType == kVec4f_GrSLType);
144 GrAssert(GrGLShaderVar::kNonArray == uni.fArrayCount);
145 GrAssert(kUnusedUniform != uni.fFSLocation || kUnusedUniform != uni.fVSLocation);
146 if (kUnusedUniform != uni.fFSLocation) {
147 GR_GL_CALL(fContext.interface(), Uniform4f(uni.fFSLocation, v0, v1, v2, v3));
149 if (kUnusedUniform != uni.fVSLocation && uni.fVSLocation != uni.fFSLocation) {
150 GR_GL_CALL(fContext.interface(), Uniform4f(uni.fVSLocation, v0, v1, v2, v3));
158 const Uniform& uni = fUniforms[handle_to_index(u)];
159 GrAssert(uni.fType == kVec4f_GrSLType);
161 GrAssert(kUnusedUniform != uni.fFSLocation || kUnusedUniform != uni.fVSLocation);
162 if (kUnusedUniform != uni.fFSLocation) {
163 GR_GL_CALL(fContext.interface(), Uniform4fv(uni.fFSLocation + offset, arrayCount, v));
165 if (kUnusedUniform != uni.fVSLocation && uni.fVSLocation != uni.fFSLocation) {
166 GR_GL_CALL(fContext.interface(), Uniform4fv(uni.fVSLocation + offset, arrayCount, v));
171 const Uniform& uni = fUniforms[handle_to_index(u)];
172 GrAssert(uni.fType == kMat33f_GrSLType);
173 GrAssert(GrGLShaderVar::kNonArray == uni.fArrayCount);
175 // GrAssert(kUnusedUniform != uni.fFSLocation || kUnusedUniform != uni.fVSLocation);
176 if (kUnusedUniform != uni.fFSLocation) {
177 GR_GL_CALL(fContext.interface(), UniformMatrix3fv(uni.fFSLocation, 1, false, matrix));
179 if (kUnusedUniform != uni.fVSLocation && uni.fVSLocation != uni.fFSLocation) {
180 GR_GL_CALL(fContext.interface(), UniformMatrix3fv(uni.fVSLocation, 1, false, matrix));
185 const Uniform& uni = fUniforms[handle_to_index(u)];
186 GrAssert(uni.fType == kMat44f_GrSLType);
187 GrAssert(GrGLShaderVar::kNonArray == uni.fArrayCount);
188 GrAssert(kUnusedUniform != uni.fFSLocation || kUnusedUniform != uni.fVSLocation);
189 if (kUnusedUniform != uni.fFSLocation) {
190 GR_GL_CALL(fContext.interface(), UniformMatrix4fv(uni.fFSLocation, 1, false, matrix));
192 if (kUnusedUniform != uni.fVSLocation && uni.fVSLocation != uni.fFSLocation) {
193 GR_GL_CALL(fContext.interface(), UniformMatrix4fv(uni.fVSLocation, 1, false, matrix));
201 const Uniform& uni = fUniforms[handle_to_index(u)];
202 GrAssert(uni.fType == kMat33f_GrSLType);
204 ASSERT_ARRAY_UPLOAD_IN_BOUNDS(uni, offset, arrayCount);
205 GrAssert(kUnusedUniform != uni.fFSLocation || kUnusedUniform != uni.fVSLocation);
206 if (kUnusedUniform != uni.fFSLocation) {
208 UniformMatrix3fv(uni.fFSLocation + offset, arrayCount, false, matrices));
210 if (kUnusedUniform != uni.fVSLocation && uni.fVSLocation != uni.fFSLocation) {
212 UniformMatrix3fv(uni.fVSLocation + offset, arrayCount, false, matrices));
220 const Uniform& uni = fUniforms[handle_to_index(u)];
221 GrAssert(uni.fType == kMat44f_GrSLType);
223 ASSERT_ARRAY_UPLOAD_IN_BOUNDS(uni, offset, arrayCount);
224 GrAssert(kUnusedUniform != uni.fFSLocation || kUnusedUniform != uni.fVSLocation);
225 if (kUnusedUniform != uni.fFSLocation) {
227 UniformMatrix4fv(uni.fFSLocation + offset, arrayCount, false, matrices));
229 if (kUnusedUniform != uni.fVSLocation && uni.fVSLocation != uni.fFSLocation) {
231 UniformMatrix4fv(uni.fVSLocation + offset, arrayCount, false, matrices));