1 /*
2 * Mesa 3-D graphics library
3 *
4 * Copyright (C) 2004-2008 Brian Paul All Rights Reserved.
5 * Copyright (C) 2009-2010 VMware, Inc. All Rights Reserved.
6 * Copyright © 2010 Intel Corporation
7 *
8 * Permission is hereby granted, free of charge, to any person obtaining a
9 * copy of this software and associated documentation files (the "Software"),
10 * to deal in the Software without restriction, including without limitation
11 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
12 * and/or sell copies of the Software, and to permit persons to whom the
13 * Software is furnished to do so, subject to the following conditions:
14 *
15 * The above copyright notice and this permission notice shall be included
16 * in all copies or substantial portions of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
21 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
22 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
23 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
24 * OTHER DEALINGS IN THE SOFTWARE.
25 */
26
27 /**
28 * \file uniforms.c
29 * Functions related to GLSL uniform variables.
30 * \author Brian Paul
31 */
32
33 /**
34 * XXX things to do:
35 * 1. Check that the right error code is generated for all _mesa_error() calls.
36 * 2. Insert FLUSH_VERTICES calls in various places
37 */
38
39 #include "util/glheader.h"
40 #include "main/context.h"
41 #include "main/shaderapi.h"
42 #include "main/shaderobj.h"
43 #include "main/uniforms.h"
44 #include "main/enums.h"
45 #include "compiler/glsl/ir_uniform.h"
46 #include "compiler/glsl_types.h"
47 #include "program/program.h"
48 #include "util/bitscan.h"
49 #include "api_exec_decl.h"
50
51 #include "state_tracker/st_context.h"
52
53 /**
54 * Update the vertex/fragment program's TexturesUsed array.
55 *
56 * This needs to be called after glUniform(set sampler var) is called.
57 * A call to glUniform(samplerVar, value) causes a sampler to point to a
58 * particular texture unit. We know the sampler's texture target
59 * (1D/2D/3D/etc) from compile time but the sampler's texture unit is
60 * set by glUniform() calls.
61 *
62 * So, scan the program->SamplerUnits[] and program->SamplerTargets[]
63 * information to update the prog->TexturesUsed[] values.
64 * Each value of TexturesUsed[unit] is one of zero, TEXTURE_1D_INDEX,
65 * TEXTURE_2D_INDEX, TEXTURE_3D_INDEX, etc.
66 * We'll use that info for state validation before rendering.
67 */
68 static inline void
update_single_shader_texture_used(struct gl_shader_program * shProg,struct gl_program * prog,GLuint unit,GLuint target)69 update_single_shader_texture_used(struct gl_shader_program *shProg,
70 struct gl_program *prog,
71 GLuint unit, GLuint target)
72 {
73 gl_shader_stage prog_stage =
74 _mesa_program_enum_to_shader_stage(prog->Target);
75
76 assert(unit < ARRAY_SIZE(prog->TexturesUsed));
77 assert(target < NUM_TEXTURE_TARGETS);
78
79 /* From section 7.10 (Samplers) of the OpenGL 4.5 spec:
80 *
81 * "It is not allowed to have variables of different sampler types pointing
82 * to the same texture image unit within a program object."
83 */
84 unsigned stages_mask = shProg->data->linked_stages;
85 while (stages_mask) {
86 const int stage = u_bit_scan(&stages_mask);
87
88 /* Skip validation if we are yet to update textures used in this
89 * stage.
90 */
91 if (prog_stage < stage)
92 break;
93
94 struct gl_program *glprog = shProg->_LinkedShaders[stage]->Program;
95 if (glprog->TexturesUsed[unit] & ~(1 << target))
96 shProg->SamplersValidated = GL_FALSE;
97 }
98
99 prog->TexturesUsed[unit] |= (1 << target);
100 }
101
102 void
_mesa_update_shader_textures_used(struct gl_shader_program * shProg,struct gl_program * prog)103 _mesa_update_shader_textures_used(struct gl_shader_program *shProg,
104 struct gl_program *prog)
105 {
106 GLbitfield mask = prog->SamplersUsed;
107 ASSERTED gl_shader_stage prog_stage =
108 _mesa_program_enum_to_shader_stage(prog->Target);
109 GLuint s;
110
111 assert(shProg->_LinkedShaders[prog_stage]);
112
113 memset(prog->TexturesUsed, 0, sizeof(prog->TexturesUsed));
114 prog->ShadowSamplers = prog->shader_program->_LinkedShaders[prog_stage]->shadow_samplers;
115
116 while (mask) {
117 s = u_bit_scan(&mask);
118
119 update_single_shader_texture_used(shProg, prog,
120 prog->SamplerUnits[s],
121 prog->sh.SamplerTargets[s]);
122 }
123
124 if (unlikely(prog->sh.HasBoundBindlessSampler)) {
125 /* Loop over bindless samplers bound to texture units.
126 */
127 for (s = 0; s < prog->sh.NumBindlessSamplers; s++) {
128 struct gl_bindless_sampler *sampler = &prog->sh.BindlessSamplers[s];
129
130 if (!sampler->bound)
131 continue;
132
133 update_single_shader_texture_used(shProg, prog, sampler->unit,
134 sampler->target);
135 }
136 }
137 }
138
139 /**
140 * Connect a piece of driver storage with a part of a uniform
141 *
142 * \param uni The uniform with which the storage will be associated
143 * \param element_stride Byte-stride between array elements.
144 * \sa gl_uniform_driver_storage::element_stride.
145 * \param vector_stride Byte-stride between vectors (in a matrix).
146 * \sa gl_uniform_driver_storage::vector_stride.
147 * \param format Conversion from native format to driver format
148 * required by the driver.
149 * \param data Location to dump the data.
150 */
151 void
_mesa_uniform_attach_driver_storage(struct gl_uniform_storage * uni,unsigned element_stride,unsigned vector_stride,enum gl_uniform_driver_format format,void * data)152 _mesa_uniform_attach_driver_storage(struct gl_uniform_storage *uni,
153 unsigned element_stride,
154 unsigned vector_stride,
155 enum gl_uniform_driver_format format,
156 void *data)
157 {
158 uni->driver_storage =
159 realloc(uni->driver_storage,
160 sizeof(struct gl_uniform_driver_storage)
161 * (uni->num_driver_storage + 1));
162
163 uni->driver_storage[uni->num_driver_storage].element_stride = element_stride;
164 uni->driver_storage[uni->num_driver_storage].vector_stride = vector_stride;
165 uni->driver_storage[uni->num_driver_storage].format = format;
166 uni->driver_storage[uni->num_driver_storage].data = data;
167
168 uni->num_driver_storage++;
169 }
170
171 /**
172 * Sever all connections with all pieces of driver storage for all uniforms
173 *
174 * \warning
175 * This function does \b not release any of the \c data pointers
176 * previously passed in to \c _mesa_uniform_attach_driver_stoarge.
177 */
178 void
_mesa_uniform_detach_all_driver_storage(struct gl_uniform_storage * uni)179 _mesa_uniform_detach_all_driver_storage(struct gl_uniform_storage *uni)
180 {
181 free(uni->driver_storage);
182 uni->driver_storage = NULL;
183 uni->num_driver_storage = 0;
184 }
185
186 void GLAPIENTRY
_mesa_Uniform1f(GLint location,GLfloat v0)187 _mesa_Uniform1f(GLint location, GLfloat v0)
188 {
189 GET_CURRENT_CONTEXT(ctx);
190 _mesa_uniform(location, 1, &v0, ctx, ctx->_Shader->ActiveProgram, GLSL_TYPE_FLOAT, 1);
191 }
192
193 void GLAPIENTRY
_mesa_Uniform2f(GLint location,GLfloat v0,GLfloat v1)194 _mesa_Uniform2f(GLint location, GLfloat v0, GLfloat v1)
195 {
196 GET_CURRENT_CONTEXT(ctx);
197 GLfloat v[2];
198 v[0] = v0;
199 v[1] = v1;
200 _mesa_uniform(location, 1, v, ctx, ctx->_Shader->ActiveProgram, GLSL_TYPE_FLOAT, 2);
201 }
202
203 void GLAPIENTRY
_mesa_Uniform3f(GLint location,GLfloat v0,GLfloat v1,GLfloat v2)204 _mesa_Uniform3f(GLint location, GLfloat v0, GLfloat v1, GLfloat v2)
205 {
206 GET_CURRENT_CONTEXT(ctx);
207 GLfloat v[3];
208 v[0] = v0;
209 v[1] = v1;
210 v[2] = v2;
211 _mesa_uniform(location, 1, v, ctx, ctx->_Shader->ActiveProgram, GLSL_TYPE_FLOAT, 3);
212 }
213
214 void GLAPIENTRY
_mesa_Uniform4f(GLint location,GLfloat v0,GLfloat v1,GLfloat v2,GLfloat v3)215 _mesa_Uniform4f(GLint location, GLfloat v0, GLfloat v1, GLfloat v2,
216 GLfloat v3)
217 {
218 GET_CURRENT_CONTEXT(ctx);
219 GLfloat v[4];
220 v[0] = v0;
221 v[1] = v1;
222 v[2] = v2;
223 v[3] = v3;
224 _mesa_uniform(location, 1, v, ctx, ctx->_Shader->ActiveProgram, GLSL_TYPE_FLOAT, 4);
225 }
226
227 void GLAPIENTRY
_mesa_Uniform1i(GLint location,GLint v0)228 _mesa_Uniform1i(GLint location, GLint v0)
229 {
230 GET_CURRENT_CONTEXT(ctx);
231 _mesa_uniform(location, 1, &v0, ctx, ctx->_Shader->ActiveProgram, GLSL_TYPE_INT, 1);
232 }
233
234 void GLAPIENTRY
_mesa_Uniform2i(GLint location,GLint v0,GLint v1)235 _mesa_Uniform2i(GLint location, GLint v0, GLint v1)
236 {
237 GET_CURRENT_CONTEXT(ctx);
238 GLint v[2];
239 v[0] = v0;
240 v[1] = v1;
241 _mesa_uniform(location, 1, v, ctx, ctx->_Shader->ActiveProgram, GLSL_TYPE_INT, 2);
242 }
243
244 void GLAPIENTRY
_mesa_Uniform3i(GLint location,GLint v0,GLint v1,GLint v2)245 _mesa_Uniform3i(GLint location, GLint v0, GLint v1, GLint v2)
246 {
247 GET_CURRENT_CONTEXT(ctx);
248 GLint v[3];
249 v[0] = v0;
250 v[1] = v1;
251 v[2] = v2;
252 _mesa_uniform(location, 1, v, ctx, ctx->_Shader->ActiveProgram, GLSL_TYPE_INT, 3);
253 }
254
255 void GLAPIENTRY
_mesa_Uniform4i(GLint location,GLint v0,GLint v1,GLint v2,GLint v3)256 _mesa_Uniform4i(GLint location, GLint v0, GLint v1, GLint v2, GLint v3)
257 {
258 GET_CURRENT_CONTEXT(ctx);
259 GLint v[4];
260 v[0] = v0;
261 v[1] = v1;
262 v[2] = v2;
263 v[3] = v3;
264 _mesa_uniform(location, 1, v, ctx, ctx->_Shader->ActiveProgram, GLSL_TYPE_INT, 4);
265 }
266
267 void GLAPIENTRY
_mesa_Uniform1fv(GLint location,GLsizei count,const GLfloat * value)268 _mesa_Uniform1fv(GLint location, GLsizei count, const GLfloat * value)
269 {
270 GET_CURRENT_CONTEXT(ctx);
271 _mesa_uniform(location, count, value, ctx, ctx->_Shader->ActiveProgram, GLSL_TYPE_FLOAT, 1);
272 }
273
274 void GLAPIENTRY
_mesa_Uniform2fv(GLint location,GLsizei count,const GLfloat * value)275 _mesa_Uniform2fv(GLint location, GLsizei count, const GLfloat * value)
276 {
277 GET_CURRENT_CONTEXT(ctx);
278 _mesa_uniform(location, count, value, ctx, ctx->_Shader->ActiveProgram, GLSL_TYPE_FLOAT, 2);
279 }
280
281 void GLAPIENTRY
_mesa_Uniform3fv(GLint location,GLsizei count,const GLfloat * value)282 _mesa_Uniform3fv(GLint location, GLsizei count, const GLfloat * value)
283 {
284 GET_CURRENT_CONTEXT(ctx);
285 _mesa_uniform(location, count, value, ctx, ctx->_Shader->ActiveProgram, GLSL_TYPE_FLOAT, 3);
286 }
287
288 void GLAPIENTRY
_mesa_Uniform4fv(GLint location,GLsizei count,const GLfloat * value)289 _mesa_Uniform4fv(GLint location, GLsizei count, const GLfloat * value)
290 {
291 GET_CURRENT_CONTEXT(ctx);
292 _mesa_uniform(location, count, value, ctx, ctx->_Shader->ActiveProgram, GLSL_TYPE_FLOAT, 4);
293 }
294
295 void GLAPIENTRY
_mesa_Uniform1iv(GLint location,GLsizei count,const GLint * value)296 _mesa_Uniform1iv(GLint location, GLsizei count, const GLint * value)
297 {
298 GET_CURRENT_CONTEXT(ctx);
299 _mesa_uniform(location, count, value, ctx, ctx->_Shader->ActiveProgram, GLSL_TYPE_INT, 1);
300 }
301
302 void GLAPIENTRY
_mesa_Uniform2iv(GLint location,GLsizei count,const GLint * value)303 _mesa_Uniform2iv(GLint location, GLsizei count, const GLint * value)
304 {
305 GET_CURRENT_CONTEXT(ctx);
306 _mesa_uniform(location, count, value, ctx, ctx->_Shader->ActiveProgram, GLSL_TYPE_INT, 2);
307 }
308
309 void GLAPIENTRY
_mesa_Uniform3iv(GLint location,GLsizei count,const GLint * value)310 _mesa_Uniform3iv(GLint location, GLsizei count, const GLint * value)
311 {
312 GET_CURRENT_CONTEXT(ctx);
313 _mesa_uniform(location, count, value, ctx, ctx->_Shader->ActiveProgram, GLSL_TYPE_INT, 3);
314 }
315
316 void GLAPIENTRY
_mesa_Uniform4iv(GLint location,GLsizei count,const GLint * value)317 _mesa_Uniform4iv(GLint location, GLsizei count, const GLint * value)
318 {
319 GET_CURRENT_CONTEXT(ctx);
320 _mesa_uniform(location, count, value, ctx, ctx->_Shader->ActiveProgram, GLSL_TYPE_INT, 4);
321 }
322
323 void GLAPIENTRY
_mesa_UniformHandleui64ARB(GLint location,GLuint64 value)324 _mesa_UniformHandleui64ARB(GLint location, GLuint64 value)
325 {
326 GET_CURRENT_CONTEXT(ctx);
327 _mesa_uniform_handle(location, 1, &value, ctx, ctx->_Shader->ActiveProgram);
328 }
329
330 void GLAPIENTRY
_mesa_UniformHandleui64vARB(GLint location,GLsizei count,const GLuint64 * value)331 _mesa_UniformHandleui64vARB(GLint location, GLsizei count,
332 const GLuint64 *value)
333 {
334 GET_CURRENT_CONTEXT(ctx);
335 _mesa_uniform_handle(location, count, value, ctx,
336 ctx->_Shader->ActiveProgram);
337 }
338
339
340 /** Same as above with direct state access **/
341 void GLAPIENTRY
_mesa_ProgramUniform1f(GLuint program,GLint location,GLfloat v0)342 _mesa_ProgramUniform1f(GLuint program, GLint location, GLfloat v0)
343 {
344 GET_CURRENT_CONTEXT(ctx);
345 struct gl_shader_program *shProg =
346 _mesa_lookup_shader_program_err(ctx, program,
347 "glProgramUniform1f");
348 _mesa_uniform(location, 1, &v0, ctx, shProg, GLSL_TYPE_FLOAT, 1);
349 }
350
351 void GLAPIENTRY
_mesa_ProgramUniform2f(GLuint program,GLint location,GLfloat v0,GLfloat v1)352 _mesa_ProgramUniform2f(GLuint program, GLint location, GLfloat v0, GLfloat v1)
353 {
354 GET_CURRENT_CONTEXT(ctx);
355 GLfloat v[2];
356 struct gl_shader_program *shProg;
357 v[0] = v0;
358 v[1] = v1;
359 shProg = _mesa_lookup_shader_program_err(ctx, program, "glProgramUniform2f");
360 _mesa_uniform(location, 1, v, ctx, shProg, GLSL_TYPE_FLOAT, 2);
361 }
362
363 void GLAPIENTRY
_mesa_ProgramUniform3f(GLuint program,GLint location,GLfloat v0,GLfloat v1,GLfloat v2)364 _mesa_ProgramUniform3f(GLuint program, GLint location, GLfloat v0, GLfloat v1,
365 GLfloat v2)
366 {
367 GET_CURRENT_CONTEXT(ctx);
368 GLfloat v[3];
369 struct gl_shader_program *shProg;
370 v[0] = v0;
371 v[1] = v1;
372 v[2] = v2;
373 shProg = _mesa_lookup_shader_program_err(ctx, program, "glProgramUniform3f");
374 _mesa_uniform(location, 1, v, ctx, shProg, GLSL_TYPE_FLOAT, 3);
375 }
376
377 void GLAPIENTRY
_mesa_ProgramUniform4f(GLuint program,GLint location,GLfloat v0,GLfloat v1,GLfloat v2,GLfloat v3)378 _mesa_ProgramUniform4f(GLuint program, GLint location, GLfloat v0, GLfloat v1,
379 GLfloat v2, GLfloat v3)
380 {
381 GET_CURRENT_CONTEXT(ctx);
382 GLfloat v[4];
383 struct gl_shader_program *shProg;
384 v[0] = v0;
385 v[1] = v1;
386 v[2] = v2;
387 v[3] = v3;
388 shProg = _mesa_lookup_shader_program_err(ctx, program, "glProgramUniform4f");
389 _mesa_uniform(location, 1, v, ctx, shProg, GLSL_TYPE_FLOAT, 4);
390 }
391
392 void GLAPIENTRY
_mesa_ProgramUniform1i(GLuint program,GLint location,GLint v0)393 _mesa_ProgramUniform1i(GLuint program, GLint location, GLint v0)
394 {
395 GET_CURRENT_CONTEXT(ctx);
396 struct gl_shader_program *shProg =
397 _mesa_lookup_shader_program_err(ctx, program,
398 "glProgramUniform1i");
399 _mesa_uniform(location, 1, &v0, ctx, shProg, GLSL_TYPE_INT, 1);
400 }
401
402 void GLAPIENTRY
_mesa_ProgramUniform2i(GLuint program,GLint location,GLint v0,GLint v1)403 _mesa_ProgramUniform2i(GLuint program, GLint location, GLint v0, GLint v1)
404 {
405 GET_CURRENT_CONTEXT(ctx);
406 GLint v[2];
407 struct gl_shader_program *shProg;
408 v[0] = v0;
409 v[1] = v1;
410 shProg = _mesa_lookup_shader_program_err(ctx, program, "glProgramUniform2i");
411 _mesa_uniform(location, 1, v, ctx, shProg, GLSL_TYPE_INT, 2);
412 }
413
414 void GLAPIENTRY
_mesa_ProgramUniform3i(GLuint program,GLint location,GLint v0,GLint v1,GLint v2)415 _mesa_ProgramUniform3i(GLuint program, GLint location, GLint v0, GLint v1,
416 GLint v2)
417 {
418 GET_CURRENT_CONTEXT(ctx);
419 GLint v[3];
420 struct gl_shader_program *shProg;
421 v[0] = v0;
422 v[1] = v1;
423 v[2] = v2;
424 shProg = _mesa_lookup_shader_program_err(ctx, program, "glProgramUniform3i");
425 _mesa_uniform(location, 1, v, ctx, shProg, GLSL_TYPE_INT, 3);
426 }
427
428 void GLAPIENTRY
_mesa_ProgramUniform4i(GLuint program,GLint location,GLint v0,GLint v1,GLint v2,GLint v3)429 _mesa_ProgramUniform4i(GLuint program, GLint location, GLint v0, GLint v1,
430 GLint v2, GLint v3)
431 {
432 GET_CURRENT_CONTEXT(ctx);
433 GLint v[4];
434 struct gl_shader_program *shProg;
435 v[0] = v0;
436 v[1] = v1;
437 v[2] = v2;
438 v[3] = v3;
439 shProg = _mesa_lookup_shader_program_err(ctx, program, "glProgramUniform4i");
440 _mesa_uniform(location, 1, v, ctx, shProg, GLSL_TYPE_INT, 4);
441 }
442
443 void GLAPIENTRY
_mesa_ProgramUniform1fv(GLuint program,GLint location,GLsizei count,const GLfloat * value)444 _mesa_ProgramUniform1fv(GLuint program, GLint location, GLsizei count,
445 const GLfloat * value)
446 {
447 GET_CURRENT_CONTEXT(ctx);
448 struct gl_shader_program *shProg =
449 _mesa_lookup_shader_program_err(ctx, program,
450 "glProgramUniform1fv");
451 _mesa_uniform(location, count, value, ctx, shProg, GLSL_TYPE_FLOAT, 1);
452 }
453
454 void GLAPIENTRY
_mesa_ProgramUniform2fv(GLuint program,GLint location,GLsizei count,const GLfloat * value)455 _mesa_ProgramUniform2fv(GLuint program, GLint location, GLsizei count,
456 const GLfloat * value)
457 {
458 GET_CURRENT_CONTEXT(ctx);
459 struct gl_shader_program *shProg =
460 _mesa_lookup_shader_program_err(ctx, program,
461 "glProgramUniform2fv");
462 _mesa_uniform(location, count, value, ctx, shProg, GLSL_TYPE_FLOAT, 2);
463 }
464
465 void GLAPIENTRY
_mesa_ProgramUniform3fv(GLuint program,GLint location,GLsizei count,const GLfloat * value)466 _mesa_ProgramUniform3fv(GLuint program, GLint location, GLsizei count,
467 const GLfloat * value)
468 {
469 GET_CURRENT_CONTEXT(ctx);
470 struct gl_shader_program *shProg =
471 _mesa_lookup_shader_program_err(ctx, program,
472 "glProgramUniform3fv");
473 _mesa_uniform(location, count, value, ctx, shProg, GLSL_TYPE_FLOAT, 3);
474 }
475
476 void GLAPIENTRY
_mesa_ProgramUniform4fv(GLuint program,GLint location,GLsizei count,const GLfloat * value)477 _mesa_ProgramUniform4fv(GLuint program, GLint location, GLsizei count,
478 const GLfloat * value)
479 {
480 GET_CURRENT_CONTEXT(ctx);
481 struct gl_shader_program *shProg =
482 _mesa_lookup_shader_program_err(ctx, program,
483 "glProgramUniform4fv");
484 _mesa_uniform(location, count, value, ctx, shProg, GLSL_TYPE_FLOAT, 4);
485 }
486
487 void GLAPIENTRY
_mesa_ProgramUniform1iv(GLuint program,GLint location,GLsizei count,const GLint * value)488 _mesa_ProgramUniform1iv(GLuint program, GLint location, GLsizei count,
489 const GLint * value)
490 {
491 GET_CURRENT_CONTEXT(ctx);
492 struct gl_shader_program *shProg =
493 _mesa_lookup_shader_program_err(ctx, program,
494 "glProgramUniform1iv");
495 _mesa_uniform(location, count, value, ctx, shProg, GLSL_TYPE_INT, 1);
496 }
497
498 void GLAPIENTRY
_mesa_ProgramUniform2iv(GLuint program,GLint location,GLsizei count,const GLint * value)499 _mesa_ProgramUniform2iv(GLuint program, GLint location, GLsizei count,
500 const GLint * value)
501 {
502 GET_CURRENT_CONTEXT(ctx);
503 struct gl_shader_program *shProg =
504 _mesa_lookup_shader_program_err(ctx, program,
505 "glProgramUniform2iv");
506 _mesa_uniform(location, count, value, ctx, shProg, GLSL_TYPE_INT, 2);
507 }
508
509 void GLAPIENTRY
_mesa_ProgramUniform3iv(GLuint program,GLint location,GLsizei count,const GLint * value)510 _mesa_ProgramUniform3iv(GLuint program, GLint location, GLsizei count,
511 const GLint * value)
512 {
513 GET_CURRENT_CONTEXT(ctx);
514 struct gl_shader_program *shProg =
515 _mesa_lookup_shader_program_err(ctx, program,
516 "glProgramUniform3iv");
517 _mesa_uniform(location, count, value, ctx, shProg, GLSL_TYPE_INT, 3);
518 }
519
520 void GLAPIENTRY
_mesa_ProgramUniform4iv(GLuint program,GLint location,GLsizei count,const GLint * value)521 _mesa_ProgramUniform4iv(GLuint program, GLint location, GLsizei count,
522 const GLint * value)
523 {
524 GET_CURRENT_CONTEXT(ctx);
525 struct gl_shader_program *shProg =
526 _mesa_lookup_shader_program_err(ctx, program,
527 "glProgramUniform4iv");
528 _mesa_uniform(location, count, value, ctx, shProg, GLSL_TYPE_INT, 4);
529 }
530
531 void GLAPIENTRY
_mesa_ProgramUniformHandleui64ARB(GLuint program,GLint location,GLuint64 value)532 _mesa_ProgramUniformHandleui64ARB(GLuint program, GLint location,
533 GLuint64 value)
534 {
535 GET_CURRENT_CONTEXT(ctx);
536 struct gl_shader_program *shProg =
537 _mesa_lookup_shader_program_err(ctx, program,
538 "glProgramUniformHandleui64ARB");
539 _mesa_uniform_handle(location, 1, &value, ctx, shProg);
540 }
541
542 void GLAPIENTRY
_mesa_ProgramUniformHandleui64vARB(GLuint program,GLint location,GLsizei count,const GLuint64 * values)543 _mesa_ProgramUniformHandleui64vARB(GLuint program, GLint location,
544 GLsizei count, const GLuint64 *values)
545 {
546 GET_CURRENT_CONTEXT(ctx);
547 struct gl_shader_program *shProg =
548 _mesa_lookup_shader_program_err(ctx, program,
549 "glProgramUniformHandleui64vARB");
550 _mesa_uniform_handle(location, count, values, ctx, shProg);
551 }
552
553
554 /** OpenGL 3.0 GLuint-valued functions **/
555 void GLAPIENTRY
_mesa_Uniform1ui(GLint location,GLuint v0)556 _mesa_Uniform1ui(GLint location, GLuint v0)
557 {
558 GET_CURRENT_CONTEXT(ctx);
559 _mesa_uniform(location, 1, &v0, ctx, ctx->_Shader->ActiveProgram, GLSL_TYPE_UINT, 1);
560 }
561
562 void GLAPIENTRY
_mesa_Uniform2ui(GLint location,GLuint v0,GLuint v1)563 _mesa_Uniform2ui(GLint location, GLuint v0, GLuint v1)
564 {
565 GET_CURRENT_CONTEXT(ctx);
566 GLuint v[2];
567 v[0] = v0;
568 v[1] = v1;
569 _mesa_uniform(location, 1, v, ctx, ctx->_Shader->ActiveProgram, GLSL_TYPE_UINT, 2);
570 }
571
572 void GLAPIENTRY
_mesa_Uniform3ui(GLint location,GLuint v0,GLuint v1,GLuint v2)573 _mesa_Uniform3ui(GLint location, GLuint v0, GLuint v1, GLuint v2)
574 {
575 GET_CURRENT_CONTEXT(ctx);
576 GLuint v[3];
577 v[0] = v0;
578 v[1] = v1;
579 v[2] = v2;
580 _mesa_uniform(location, 1, v, ctx, ctx->_Shader->ActiveProgram, GLSL_TYPE_UINT, 3);
581 }
582
583 void GLAPIENTRY
_mesa_Uniform4ui(GLint location,GLuint v0,GLuint v1,GLuint v2,GLuint v3)584 _mesa_Uniform4ui(GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3)
585 {
586 GET_CURRENT_CONTEXT(ctx);
587 GLuint v[4];
588 v[0] = v0;
589 v[1] = v1;
590 v[2] = v2;
591 v[3] = v3;
592 _mesa_uniform(location, 1, v, ctx, ctx->_Shader->ActiveProgram, GLSL_TYPE_UINT, 4);
593 }
594
595 void GLAPIENTRY
_mesa_Uniform1uiv(GLint location,GLsizei count,const GLuint * value)596 _mesa_Uniform1uiv(GLint location, GLsizei count, const GLuint *value)
597 {
598 GET_CURRENT_CONTEXT(ctx);
599 _mesa_uniform(location, count, value, ctx, ctx->_Shader->ActiveProgram, GLSL_TYPE_UINT, 1);
600 }
601
602 void GLAPIENTRY
_mesa_Uniform2uiv(GLint location,GLsizei count,const GLuint * value)603 _mesa_Uniform2uiv(GLint location, GLsizei count, const GLuint *value)
604 {
605 GET_CURRENT_CONTEXT(ctx);
606 _mesa_uniform(location, count, value, ctx, ctx->_Shader->ActiveProgram, GLSL_TYPE_UINT, 2);
607 }
608
609 void GLAPIENTRY
_mesa_Uniform3uiv(GLint location,GLsizei count,const GLuint * value)610 _mesa_Uniform3uiv(GLint location, GLsizei count, const GLuint *value)
611 {
612 GET_CURRENT_CONTEXT(ctx);
613 _mesa_uniform(location, count, value, ctx, ctx->_Shader->ActiveProgram, GLSL_TYPE_UINT, 3);
614 }
615
616 void GLAPIENTRY
_mesa_Uniform4uiv(GLint location,GLsizei count,const GLuint * value)617 _mesa_Uniform4uiv(GLint location, GLsizei count, const GLuint *value)
618 {
619 GET_CURRENT_CONTEXT(ctx);
620 _mesa_uniform(location, count, value, ctx, ctx->_Shader->ActiveProgram, GLSL_TYPE_UINT, 4);
621 }
622
623
624
625 void GLAPIENTRY
_mesa_UniformMatrix2fv(GLint location,GLsizei count,GLboolean transpose,const GLfloat * value)626 _mesa_UniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose,
627 const GLfloat * value)
628 {
629 GET_CURRENT_CONTEXT(ctx);
630 _mesa_uniform_matrix(location, count, transpose, value,
631 ctx, ctx->_Shader->ActiveProgram, 2, 2, GLSL_TYPE_FLOAT);
632 }
633
634 void GLAPIENTRY
_mesa_UniformMatrix3fv(GLint location,GLsizei count,GLboolean transpose,const GLfloat * value)635 _mesa_UniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose,
636 const GLfloat * value)
637 {
638 GET_CURRENT_CONTEXT(ctx);
639 _mesa_uniform_matrix(location, count, transpose, value,
640 ctx, ctx->_Shader->ActiveProgram, 3, 3, GLSL_TYPE_FLOAT);
641 }
642
643 void GLAPIENTRY
_mesa_UniformMatrix4fv(GLint location,GLsizei count,GLboolean transpose,const GLfloat * value)644 _mesa_UniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose,
645 const GLfloat * value)
646 {
647 GET_CURRENT_CONTEXT(ctx);
648 _mesa_uniform_matrix(location, count, transpose, value,
649 ctx, ctx->_Shader->ActiveProgram, 4, 4, GLSL_TYPE_FLOAT);
650 }
651
652 /** Same as above with direct state access **/
653
654 void GLAPIENTRY
_mesa_ProgramUniform1ui(GLuint program,GLint location,GLuint v0)655 _mesa_ProgramUniform1ui(GLuint program, GLint location, GLuint v0)
656 {
657 GET_CURRENT_CONTEXT(ctx);
658 struct gl_shader_program *shProg =
659 _mesa_lookup_shader_program_err(ctx, program,
660 "glProgramUniform1ui");
661 _mesa_uniform(location, 1, &v0, ctx, shProg, GLSL_TYPE_UINT, 1);
662 }
663
664 void GLAPIENTRY
_mesa_ProgramUniform2ui(GLuint program,GLint location,GLuint v0,GLuint v1)665 _mesa_ProgramUniform2ui(GLuint program, GLint location, GLuint v0, GLuint v1)
666 {
667 GET_CURRENT_CONTEXT(ctx);
668 GLuint v[2];
669 struct gl_shader_program *shProg;
670 v[0] = v0;
671 v[1] = v1;
672 shProg = _mesa_lookup_shader_program_err(ctx, program,
673 "glProgramUniform2ui");
674 _mesa_uniform(location, 1, v, ctx, shProg, GLSL_TYPE_UINT, 2);
675 }
676
677 void GLAPIENTRY
_mesa_ProgramUniform3ui(GLuint program,GLint location,GLuint v0,GLuint v1,GLuint v2)678 _mesa_ProgramUniform3ui(GLuint program, GLint location, GLuint v0, GLuint v1,
679 GLuint v2)
680 {
681 GET_CURRENT_CONTEXT(ctx);
682 GLuint v[3];
683 struct gl_shader_program *shProg;
684 v[0] = v0;
685 v[1] = v1;
686 v[2] = v2;
687 shProg = _mesa_lookup_shader_program_err(ctx, program,
688 "glProgramUniform3ui");
689 _mesa_uniform(location, 1, v, ctx, shProg, GLSL_TYPE_UINT, 3);
690 }
691
692 void GLAPIENTRY
_mesa_ProgramUniform4ui(GLuint program,GLint location,GLuint v0,GLuint v1,GLuint v2,GLuint v3)693 _mesa_ProgramUniform4ui(GLuint program, GLint location, GLuint v0, GLuint v1,
694 GLuint v2, GLuint v3)
695 {
696 GET_CURRENT_CONTEXT(ctx);
697 GLuint v[4];
698 struct gl_shader_program *shProg;
699 v[0] = v0;
700 v[1] = v1;
701 v[2] = v2;
702 v[3] = v3;
703 shProg = _mesa_lookup_shader_program_err(ctx, program, "glProgramUniform4ui");
704 _mesa_uniform(location, 1, v, ctx, shProg, GLSL_TYPE_UINT, 4);
705 }
706
707 void GLAPIENTRY
_mesa_ProgramUniform1uiv(GLuint program,GLint location,GLsizei count,const GLuint * value)708 _mesa_ProgramUniform1uiv(GLuint program, GLint location, GLsizei count,
709 const GLuint *value)
710 {
711 GET_CURRENT_CONTEXT(ctx);
712 struct gl_shader_program *shProg =
713 _mesa_lookup_shader_program_err(ctx, program,
714 "glProgramUniform1uiv");
715 _mesa_uniform(location, count, value, ctx, shProg, GLSL_TYPE_UINT, 1);
716 }
717
718 void GLAPIENTRY
_mesa_ProgramUniform2uiv(GLuint program,GLint location,GLsizei count,const GLuint * value)719 _mesa_ProgramUniform2uiv(GLuint program, GLint location, GLsizei count,
720 const GLuint *value)
721 {
722 GET_CURRENT_CONTEXT(ctx);
723 struct gl_shader_program *shProg =
724 _mesa_lookup_shader_program_err(ctx, program,
725 "glProgramUniform2uiv");
726 _mesa_uniform(location, count, value, ctx, shProg, GLSL_TYPE_UINT, 2);
727 }
728
729 void GLAPIENTRY
_mesa_ProgramUniform3uiv(GLuint program,GLint location,GLsizei count,const GLuint * value)730 _mesa_ProgramUniform3uiv(GLuint program, GLint location, GLsizei count,
731 const GLuint *value)
732 {
733 GET_CURRENT_CONTEXT(ctx);
734 struct gl_shader_program *shProg =
735 _mesa_lookup_shader_program_err(ctx, program,
736 "glProgramUniform3uiv");
737 _mesa_uniform(location, count, value, ctx, shProg, GLSL_TYPE_UINT, 3);
738 }
739
740 void GLAPIENTRY
_mesa_ProgramUniform4uiv(GLuint program,GLint location,GLsizei count,const GLuint * value)741 _mesa_ProgramUniform4uiv(GLuint program, GLint location, GLsizei count,
742 const GLuint *value)
743 {
744 GET_CURRENT_CONTEXT(ctx);
745 struct gl_shader_program *shProg =
746 _mesa_lookup_shader_program_err(ctx, program,
747 "glProgramUniform4uiv");
748 _mesa_uniform(location, count, value, ctx, shProg, GLSL_TYPE_UINT, 4);
749 }
750
751
752
753 void GLAPIENTRY
_mesa_ProgramUniformMatrix2fv(GLuint program,GLint location,GLsizei count,GLboolean transpose,const GLfloat * value)754 _mesa_ProgramUniformMatrix2fv(GLuint program, GLint location, GLsizei count,
755 GLboolean transpose, const GLfloat * value)
756 {
757 GET_CURRENT_CONTEXT(ctx);
758 struct gl_shader_program *shProg =
759 _mesa_lookup_shader_program_err(ctx, program,
760 "glProgramUniformMatrix2fv");
761 _mesa_uniform_matrix(location, count, transpose, value, ctx, shProg, 2, 2, GLSL_TYPE_FLOAT);
762 }
763
764 void GLAPIENTRY
_mesa_ProgramUniformMatrix3fv(GLuint program,GLint location,GLsizei count,GLboolean transpose,const GLfloat * value)765 _mesa_ProgramUniformMatrix3fv(GLuint program, GLint location, GLsizei count,
766 GLboolean transpose, const GLfloat * value)
767 {
768 GET_CURRENT_CONTEXT(ctx);
769 struct gl_shader_program *shProg =
770 _mesa_lookup_shader_program_err(ctx, program,
771 "glProgramUniformMatrix3fv");
772 _mesa_uniform_matrix(location, count, transpose, value, ctx, shProg, 3, 3, GLSL_TYPE_FLOAT);
773 }
774
775 void GLAPIENTRY
_mesa_ProgramUniformMatrix4fv(GLuint program,GLint location,GLsizei count,GLboolean transpose,const GLfloat * value)776 _mesa_ProgramUniformMatrix4fv(GLuint program, GLint location, GLsizei count,
777 GLboolean transpose, const GLfloat * value)
778 {
779 GET_CURRENT_CONTEXT(ctx);
780 struct gl_shader_program *shProg =
781 _mesa_lookup_shader_program_err(ctx, program,
782 "glProgramUniformMatrix4fv");
783 _mesa_uniform_matrix(location, count, transpose, value, ctx, shProg, 4, 4, GLSL_TYPE_FLOAT);
784 }
785
786
787 /**
788 * Non-square UniformMatrix are OpenGL 2.1
789 */
790 void GLAPIENTRY
_mesa_UniformMatrix2x3fv(GLint location,GLsizei count,GLboolean transpose,const GLfloat * value)791 _mesa_UniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose,
792 const GLfloat *value)
793 {
794 GET_CURRENT_CONTEXT(ctx);
795 _mesa_uniform_matrix(location, count, transpose, value,
796 ctx, ctx->_Shader->ActiveProgram, 2, 3, GLSL_TYPE_FLOAT);
797 }
798
799 void GLAPIENTRY
_mesa_UniformMatrix3x2fv(GLint location,GLsizei count,GLboolean transpose,const GLfloat * value)800 _mesa_UniformMatrix3x2fv(GLint location, GLsizei count, GLboolean transpose,
801 const GLfloat *value)
802 {
803 GET_CURRENT_CONTEXT(ctx);
804 _mesa_uniform_matrix(location, count, transpose, value,
805 ctx, ctx->_Shader->ActiveProgram, 3, 2, GLSL_TYPE_FLOAT);
806 }
807
808 void GLAPIENTRY
_mesa_UniformMatrix2x4fv(GLint location,GLsizei count,GLboolean transpose,const GLfloat * value)809 _mesa_UniformMatrix2x4fv(GLint location, GLsizei count, GLboolean transpose,
810 const GLfloat *value)
811 {
812 GET_CURRENT_CONTEXT(ctx);
813 _mesa_uniform_matrix(location, count, transpose, value,
814 ctx, ctx->_Shader->ActiveProgram, 2, 4, GLSL_TYPE_FLOAT);
815 }
816
817 void GLAPIENTRY
_mesa_UniformMatrix4x2fv(GLint location,GLsizei count,GLboolean transpose,const GLfloat * value)818 _mesa_UniformMatrix4x2fv(GLint location, GLsizei count, GLboolean transpose,
819 const GLfloat *value)
820 {
821 GET_CURRENT_CONTEXT(ctx);
822 _mesa_uniform_matrix(location, count, transpose, value,
823 ctx, ctx->_Shader->ActiveProgram, 4, 2, GLSL_TYPE_FLOAT);
824 }
825
826 void GLAPIENTRY
_mesa_UniformMatrix3x4fv(GLint location,GLsizei count,GLboolean transpose,const GLfloat * value)827 _mesa_UniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose,
828 const GLfloat *value)
829 {
830 GET_CURRENT_CONTEXT(ctx);
831 _mesa_uniform_matrix(location, count, transpose, value,
832 ctx, ctx->_Shader->ActiveProgram, 3, 4, GLSL_TYPE_FLOAT);
833 }
834
835 void GLAPIENTRY
_mesa_UniformMatrix4x3fv(GLint location,GLsizei count,GLboolean transpose,const GLfloat * value)836 _mesa_UniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose,
837 const GLfloat *value)
838 {
839 GET_CURRENT_CONTEXT(ctx);
840 _mesa_uniform_matrix(location, count, transpose, value,
841 ctx, ctx->_Shader->ActiveProgram, 4, 3, GLSL_TYPE_FLOAT);
842 }
843
844 /** Same as above with direct state access **/
845
846 void GLAPIENTRY
_mesa_ProgramUniformMatrix2x3fv(GLuint program,GLint location,GLsizei count,GLboolean transpose,const GLfloat * value)847 _mesa_ProgramUniformMatrix2x3fv(GLuint program, GLint location, GLsizei count,
848 GLboolean transpose, const GLfloat * value)
849 {
850 GET_CURRENT_CONTEXT(ctx);
851 struct gl_shader_program *shProg =
852 _mesa_lookup_shader_program_err(ctx, program,
853 "glProgramUniformMatrix2x3fv");
854 _mesa_uniform_matrix(location, count, transpose, value, ctx, shProg, 2, 3, GLSL_TYPE_FLOAT);
855 }
856
857 void GLAPIENTRY
_mesa_ProgramUniformMatrix3x2fv(GLuint program,GLint location,GLsizei count,GLboolean transpose,const GLfloat * value)858 _mesa_ProgramUniformMatrix3x2fv(GLuint program, GLint location, GLsizei count,
859 GLboolean transpose, const GLfloat * value)
860 {
861 GET_CURRENT_CONTEXT(ctx);
862 struct gl_shader_program *shProg =
863 _mesa_lookup_shader_program_err(ctx, program,
864 "glProgramUniformMatrix3x2fv");
865 _mesa_uniform_matrix(location, count, transpose, value, ctx, shProg, 3, 2, GLSL_TYPE_FLOAT);
866 }
867
868 void GLAPIENTRY
_mesa_ProgramUniformMatrix2x4fv(GLuint program,GLint location,GLsizei count,GLboolean transpose,const GLfloat * value)869 _mesa_ProgramUniformMatrix2x4fv(GLuint program, GLint location, GLsizei count,
870 GLboolean transpose, const GLfloat * value)
871 {
872 GET_CURRENT_CONTEXT(ctx);
873 struct gl_shader_program *shProg =
874 _mesa_lookup_shader_program_err(ctx, program,
875 "glProgramUniformMatrix2x4fv");
876 _mesa_uniform_matrix(location, count, transpose, value, ctx, shProg, 2, 4, GLSL_TYPE_FLOAT);
877 }
878
879 void GLAPIENTRY
_mesa_ProgramUniformMatrix4x2fv(GLuint program,GLint location,GLsizei count,GLboolean transpose,const GLfloat * value)880 _mesa_ProgramUniformMatrix4x2fv(GLuint program, GLint location, GLsizei count,
881 GLboolean transpose, const GLfloat * value)
882 {
883 GET_CURRENT_CONTEXT(ctx);
884 struct gl_shader_program *shProg =
885 _mesa_lookup_shader_program_err(ctx, program,
886 "glProgramUniformMatrix4x2fv");
887 _mesa_uniform_matrix(location, count, transpose, value, ctx, shProg, 4, 2, GLSL_TYPE_FLOAT);
888 }
889
890 void GLAPIENTRY
_mesa_ProgramUniformMatrix3x4fv(GLuint program,GLint location,GLsizei count,GLboolean transpose,const GLfloat * value)891 _mesa_ProgramUniformMatrix3x4fv(GLuint program, GLint location, GLsizei count,
892 GLboolean transpose, const GLfloat * value)
893 {
894 GET_CURRENT_CONTEXT(ctx);
895 struct gl_shader_program *shProg =
896 _mesa_lookup_shader_program_err(ctx, program,
897 "glProgramUniformMatrix3x4fv");
898 _mesa_uniform_matrix(location, count, transpose, value, ctx, shProg, 3, 4, GLSL_TYPE_FLOAT);
899 }
900
901 void GLAPIENTRY
_mesa_ProgramUniformMatrix4x3fv(GLuint program,GLint location,GLsizei count,GLboolean transpose,const GLfloat * value)902 _mesa_ProgramUniformMatrix4x3fv(GLuint program, GLint location, GLsizei count,
903 GLboolean transpose, const GLfloat * value)
904 {
905 GET_CURRENT_CONTEXT(ctx);
906 struct gl_shader_program *shProg =
907 _mesa_lookup_shader_program_err(ctx, program,
908 "glProgramUniformMatrix4x3fv");
909 _mesa_uniform_matrix(location, count, transpose, value, ctx, shProg, 4, 3, GLSL_TYPE_FLOAT);
910 }
911
912
913 void GLAPIENTRY
_mesa_GetnUniformfvARB(GLuint program,GLint location,GLsizei bufSize,GLfloat * params)914 _mesa_GetnUniformfvARB(GLuint program, GLint location,
915 GLsizei bufSize, GLfloat *params)
916 {
917 GET_CURRENT_CONTEXT(ctx);
918 _mesa_get_uniform(ctx, program, location, bufSize, GLSL_TYPE_FLOAT, params);
919 }
920
921 void GLAPIENTRY
_mesa_GetUniformfv(GLuint program,GLint location,GLfloat * params)922 _mesa_GetUniformfv(GLuint program, GLint location, GLfloat *params)
923 {
924 _mesa_GetnUniformfvARB(program, location, INT_MAX, params);
925 }
926
927
928 void GLAPIENTRY
_mesa_GetnUniformivARB(GLuint program,GLint location,GLsizei bufSize,GLint * params)929 _mesa_GetnUniformivARB(GLuint program, GLint location,
930 GLsizei bufSize, GLint *params)
931 {
932 GET_CURRENT_CONTEXT(ctx);
933 _mesa_get_uniform(ctx, program, location, bufSize, GLSL_TYPE_INT, params);
934 }
935
936 void GLAPIENTRY
_mesa_GetUniformiv(GLuint program,GLint location,GLint * params)937 _mesa_GetUniformiv(GLuint program, GLint location, GLint *params)
938 {
939 _mesa_GetnUniformivARB(program, location, INT_MAX, params);
940 }
941
942
943 /* GL3 */
944 void GLAPIENTRY
_mesa_GetnUniformuivARB(GLuint program,GLint location,GLsizei bufSize,GLuint * params)945 _mesa_GetnUniformuivARB(GLuint program, GLint location,
946 GLsizei bufSize, GLuint *params)
947 {
948 GET_CURRENT_CONTEXT(ctx);
949 _mesa_get_uniform(ctx, program, location, bufSize, GLSL_TYPE_UINT, params);
950 }
951
952 void GLAPIENTRY
_mesa_GetUniformuiv(GLuint program,GLint location,GLuint * params)953 _mesa_GetUniformuiv(GLuint program, GLint location, GLuint *params)
954 {
955 _mesa_GetnUniformuivARB(program, location, INT_MAX, params);
956 }
957
958
959 /* GL4 */
960 void GLAPIENTRY
_mesa_GetnUniformdvARB(GLuint program,GLint location,GLsizei bufSize,GLdouble * params)961 _mesa_GetnUniformdvARB(GLuint program, GLint location,
962 GLsizei bufSize, GLdouble *params)
963 {
964 GET_CURRENT_CONTEXT(ctx);
965
966 _mesa_get_uniform(ctx, program, location, bufSize, GLSL_TYPE_DOUBLE, params);
967 }
968
969 void GLAPIENTRY
_mesa_GetUniformdv(GLuint program,GLint location,GLdouble * params)970 _mesa_GetUniformdv(GLuint program, GLint location, GLdouble *params)
971 {
972 _mesa_GetnUniformdvARB(program, location, INT_MAX, params);
973 }
974
975 void GLAPIENTRY
_mesa_GetnUniformi64vARB(GLuint program,GLint location,GLsizei bufSize,GLint64 * params)976 _mesa_GetnUniformi64vARB(GLuint program, GLint location,
977 GLsizei bufSize, GLint64 *params)
978 {
979 GET_CURRENT_CONTEXT(ctx);
980 _mesa_get_uniform(ctx, program, location, bufSize, GLSL_TYPE_INT64, params);
981 }
982 void GLAPIENTRY
_mesa_GetUniformi64vARB(GLuint program,GLint location,GLint64 * params)983 _mesa_GetUniformi64vARB(GLuint program, GLint location, GLint64 *params)
984 {
985 _mesa_GetnUniformi64vARB(program, location, INT_MAX, params);
986 }
987
988 void GLAPIENTRY
_mesa_GetnUniformui64vARB(GLuint program,GLint location,GLsizei bufSize,GLuint64 * params)989 _mesa_GetnUniformui64vARB(GLuint program, GLint location,
990 GLsizei bufSize, GLuint64 *params)
991 {
992 GET_CURRENT_CONTEXT(ctx);
993 _mesa_get_uniform(ctx, program, location, bufSize, GLSL_TYPE_UINT64, params);
994 }
995
996 void GLAPIENTRY
_mesa_GetUniformui64vARB(GLuint program,GLint location,GLuint64 * params)997 _mesa_GetUniformui64vARB(GLuint program, GLint location, GLuint64 *params)
998 {
999 _mesa_GetnUniformui64vARB(program, location, INT_MAX, params);
1000 }
1001
1002
1003 GLint
_mesa_GetUniformLocation_impl(GLuint programObj,const GLcharARB * name,bool glthread)1004 _mesa_GetUniformLocation_impl(GLuint programObj, const GLcharARB *name,
1005 bool glthread)
1006 {
1007 struct gl_shader_program *shProg;
1008
1009 GET_CURRENT_CONTEXT(ctx);
1010
1011 shProg = _mesa_lookup_shader_program_err_glthread(ctx, programObj, glthread,
1012 "glGetUniformLocation");
1013 if (!shProg || !name)
1014 return -1;
1015
1016 /* Page 80 (page 94 of the PDF) of the OpenGL 2.1 spec says:
1017 *
1018 * "If program has not been successfully linked, the error
1019 * INVALID_OPERATION is generated."
1020 */
1021 if (shProg->data->LinkStatus == LINKING_FAILURE) {
1022 _mesa_error_glthread_safe(ctx, GL_INVALID_OPERATION, glthread,
1023 "glGetUniformLocation(program not linked)");
1024 return -1;
1025 }
1026
1027 return _mesa_program_resource_location(shProg, GL_UNIFORM, name);
1028 }
1029
1030 GLint GLAPIENTRY
_mesa_GetUniformLocation(GLuint programObj,const GLcharARB * name)1031 _mesa_GetUniformLocation(GLuint programObj, const GLcharARB *name)
1032 {
1033 return _mesa_GetUniformLocation_impl(programObj, name, false);
1034 }
1035
1036 GLint GLAPIENTRY
_mesa_GetUniformLocation_no_error(GLuint programObj,const GLcharARB * name)1037 _mesa_GetUniformLocation_no_error(GLuint programObj, const GLcharARB *name)
1038 {
1039 GET_CURRENT_CONTEXT(ctx);
1040
1041 struct gl_shader_program *shProg =
1042 _mesa_lookup_shader_program(ctx, programObj);
1043
1044 return _mesa_program_resource_location(shProg, GL_UNIFORM, name);
1045 }
1046
1047 GLuint GLAPIENTRY
_mesa_GetUniformBlockIndex(GLuint program,const GLchar * uniformBlockName)1048 _mesa_GetUniformBlockIndex(GLuint program,
1049 const GLchar *uniformBlockName)
1050 {
1051 GET_CURRENT_CONTEXT(ctx);
1052 struct gl_shader_program *shProg;
1053
1054 if (!ctx->Extensions.ARB_uniform_buffer_object) {
1055 _mesa_error(ctx, GL_INVALID_OPERATION, "glGetUniformBlockIndex");
1056 return GL_INVALID_INDEX;
1057 }
1058
1059 shProg = _mesa_lookup_shader_program_err(ctx, program,
1060 "glGetUniformBlockIndex");
1061 if (!shProg)
1062 return GL_INVALID_INDEX;
1063
1064 struct gl_program_resource *res =
1065 _mesa_program_resource_find_name(shProg, GL_UNIFORM_BLOCK,
1066 uniformBlockName, NULL);
1067 if (!res)
1068 return GL_INVALID_INDEX;
1069
1070 return _mesa_program_resource_index(shProg, res);
1071 }
1072
1073 void GLAPIENTRY
_mesa_GetUniformIndices(GLuint program,GLsizei uniformCount,const GLchar * const * uniformNames,GLuint * uniformIndices)1074 _mesa_GetUniformIndices(GLuint program,
1075 GLsizei uniformCount,
1076 const GLchar * const *uniformNames,
1077 GLuint *uniformIndices)
1078 {
1079 GET_CURRENT_CONTEXT(ctx);
1080 GLsizei i;
1081 struct gl_shader_program *shProg;
1082
1083 if (!ctx->Extensions.ARB_uniform_buffer_object) {
1084 _mesa_error(ctx, GL_INVALID_OPERATION, "glGetUniformIndices");
1085 return;
1086 }
1087
1088 shProg = _mesa_lookup_shader_program_err(ctx, program,
1089 "glGetUniformIndices");
1090 if (!shProg)
1091 return;
1092
1093 if (uniformCount < 0) {
1094 _mesa_error(ctx, GL_INVALID_VALUE,
1095 "glGetUniformIndices(uniformCount < 0)");
1096 return;
1097 }
1098
1099 for (i = 0; i < uniformCount; i++) {
1100 struct gl_program_resource *res =
1101 _mesa_program_resource_find_name(shProg, GL_UNIFORM, uniformNames[i],
1102 NULL);
1103 uniformIndices[i] = _mesa_program_resource_index(shProg, res);
1104 }
1105 }
1106
1107 static void
uniform_block_binding(struct gl_context * ctx,struct gl_shader_program * shProg,GLuint uniformBlockIndex,GLuint uniformBlockBinding)1108 uniform_block_binding(struct gl_context *ctx, struct gl_shader_program *shProg,
1109 GLuint uniformBlockIndex, GLuint uniformBlockBinding)
1110 {
1111 if (shProg->data->UniformBlocks[uniformBlockIndex].Binding !=
1112 uniformBlockBinding) {
1113
1114 FLUSH_VERTICES(ctx, 0, 0);
1115 ctx->NewDriverState |= ST_NEW_UNIFORM_BUFFER;
1116
1117 shProg->data->UniformBlocks[uniformBlockIndex].Binding =
1118 uniformBlockBinding;
1119 }
1120 }
1121
1122 void GLAPIENTRY
_mesa_UniformBlockBinding_no_error(GLuint program,GLuint uniformBlockIndex,GLuint uniformBlockBinding)1123 _mesa_UniformBlockBinding_no_error(GLuint program, GLuint uniformBlockIndex,
1124 GLuint uniformBlockBinding)
1125 {
1126 GET_CURRENT_CONTEXT(ctx);
1127
1128 struct gl_shader_program *shProg = _mesa_lookup_shader_program(ctx, program);
1129 uniform_block_binding(ctx, shProg, uniformBlockIndex, uniformBlockBinding);
1130 }
1131
1132 void GLAPIENTRY
_mesa_UniformBlockBinding(GLuint program,GLuint uniformBlockIndex,GLuint uniformBlockBinding)1133 _mesa_UniformBlockBinding(GLuint program,
1134 GLuint uniformBlockIndex,
1135 GLuint uniformBlockBinding)
1136 {
1137 GET_CURRENT_CONTEXT(ctx);
1138 struct gl_shader_program *shProg;
1139
1140 if (!ctx->Extensions.ARB_uniform_buffer_object) {
1141 _mesa_error(ctx, GL_INVALID_OPERATION, "glUniformBlockBinding");
1142 return;
1143 }
1144
1145 shProg = _mesa_lookup_shader_program_err(ctx, program,
1146 "glUniformBlockBinding");
1147 if (!shProg)
1148 return;
1149
1150 if (uniformBlockIndex >= shProg->data->NumUniformBlocks) {
1151 _mesa_error(ctx, GL_INVALID_VALUE,
1152 "glUniformBlockBinding(block index %u >= %u)",
1153 uniformBlockIndex, shProg->data->NumUniformBlocks);
1154 return;
1155 }
1156
1157 if (uniformBlockBinding >= ctx->Const.MaxUniformBufferBindings) {
1158 _mesa_error(ctx, GL_INVALID_VALUE,
1159 "glUniformBlockBinding(block binding %u >= %u)",
1160 uniformBlockBinding, ctx->Const.MaxUniformBufferBindings);
1161 return;
1162 }
1163
1164 uniform_block_binding(ctx, shProg, uniformBlockIndex, uniformBlockBinding);
1165 }
1166
1167 static void
shader_storage_block_binding(struct gl_context * ctx,struct gl_shader_program * shProg,GLuint shaderStorageBlockIndex,GLuint shaderStorageBlockBinding)1168 shader_storage_block_binding(struct gl_context *ctx,
1169 struct gl_shader_program *shProg,
1170 GLuint shaderStorageBlockIndex,
1171 GLuint shaderStorageBlockBinding)
1172 {
1173 if (shProg->data->ShaderStorageBlocks[shaderStorageBlockIndex].Binding !=
1174 shaderStorageBlockBinding) {
1175
1176 FLUSH_VERTICES(ctx, 0, 0);
1177 ctx->NewDriverState |= ST_NEW_STORAGE_BUFFER;
1178
1179 shProg->data->ShaderStorageBlocks[shaderStorageBlockIndex].Binding =
1180 shaderStorageBlockBinding;
1181 }
1182 }
1183
1184 void GLAPIENTRY
_mesa_ShaderStorageBlockBinding_no_error(GLuint program,GLuint shaderStorageBlockIndex,GLuint shaderStorageBlockBinding)1185 _mesa_ShaderStorageBlockBinding_no_error(GLuint program,
1186 GLuint shaderStorageBlockIndex,
1187 GLuint shaderStorageBlockBinding)
1188 {
1189 GET_CURRENT_CONTEXT(ctx);
1190
1191 struct gl_shader_program *shProg = _mesa_lookup_shader_program(ctx, program);
1192 shader_storage_block_binding(ctx, shProg, shaderStorageBlockIndex,
1193 shaderStorageBlockBinding);
1194 }
1195
1196 void GLAPIENTRY
_mesa_ShaderStorageBlockBinding(GLuint program,GLuint shaderStorageBlockIndex,GLuint shaderStorageBlockBinding)1197 _mesa_ShaderStorageBlockBinding(GLuint program,
1198 GLuint shaderStorageBlockIndex,
1199 GLuint shaderStorageBlockBinding)
1200 {
1201 GET_CURRENT_CONTEXT(ctx);
1202 struct gl_shader_program *shProg;
1203
1204 if (!ctx->Extensions.ARB_shader_storage_buffer_object) {
1205 _mesa_error(ctx, GL_INVALID_OPERATION, "glShaderStorageBlockBinding");
1206 return;
1207 }
1208
1209 shProg = _mesa_lookup_shader_program_err(ctx, program,
1210 "glShaderStorageBlockBinding");
1211 if (!shProg)
1212 return;
1213
1214 if (shaderStorageBlockIndex >= shProg->data->NumShaderStorageBlocks) {
1215 _mesa_error(ctx, GL_INVALID_VALUE,
1216 "glShaderStorageBlockBinding(block index %u >= %u)",
1217 shaderStorageBlockIndex,
1218 shProg->data->NumShaderStorageBlocks);
1219 return;
1220 }
1221
1222 if (shaderStorageBlockBinding >= ctx->Const.MaxShaderStorageBufferBindings) {
1223 _mesa_error(ctx, GL_INVALID_VALUE,
1224 "glShaderStorageBlockBinding(block binding %u >= %u)",
1225 shaderStorageBlockBinding,
1226 ctx->Const.MaxShaderStorageBufferBindings);
1227 return;
1228 }
1229
1230 shader_storage_block_binding(ctx, shProg, shaderStorageBlockIndex,
1231 shaderStorageBlockBinding);
1232 }
1233
1234 /**
1235 * Generic program resource property query.
1236 */
1237 static void
mesa_bufferiv(struct gl_shader_program * shProg,GLenum type,GLuint index,GLenum pname,GLint * params,const char * caller)1238 mesa_bufferiv(struct gl_shader_program *shProg, GLenum type,
1239 GLuint index, GLenum pname, GLint *params, const char *caller)
1240 {
1241 GET_CURRENT_CONTEXT(ctx);
1242 struct gl_program_resource *res =
1243 _mesa_program_resource_find_index(shProg, type, index);
1244
1245 if (!res) {
1246 _mesa_error(ctx, GL_INVALID_VALUE, "%s(bufferindex %d)", caller, index);
1247 return;
1248 }
1249
1250 switch (pname) {
1251 case GL_UNIFORM_BLOCK_BINDING:
1252 case GL_ATOMIC_COUNTER_BUFFER_BINDING:
1253 _mesa_program_resource_prop(shProg, res, index, GL_BUFFER_BINDING,
1254 params, false, caller);
1255 return;
1256 case GL_UNIFORM_BLOCK_DATA_SIZE:
1257 case GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE:
1258 _mesa_program_resource_prop(shProg, res, index, GL_BUFFER_DATA_SIZE,
1259 params, false, caller);
1260 return;
1261 case GL_UNIFORM_BLOCK_NAME_LENGTH:
1262 _mesa_program_resource_prop(shProg, res, index, GL_NAME_LENGTH,
1263 params, false, caller);
1264 return;
1265 case GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS:
1266 case GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS:
1267 _mesa_program_resource_prop(shProg, res, index, GL_NUM_ACTIVE_VARIABLES,
1268 params, false, caller);
1269 return;
1270 case GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:
1271 case GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES:
1272 _mesa_program_resource_prop(shProg, res, index, GL_ACTIVE_VARIABLES,
1273 params, false, caller);
1274 return;
1275 case GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:
1276 case GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER:
1277 _mesa_program_resource_prop(shProg, res, index,
1278 GL_REFERENCED_BY_VERTEX_SHADER, params,
1279 false, caller);
1280 return;
1281
1282 case GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER:
1283 case GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER:
1284 _mesa_program_resource_prop(shProg, res, index,
1285 GL_REFERENCED_BY_TESS_CONTROL_SHADER, params,
1286 false, caller);
1287 return;
1288
1289 case GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER:
1290 case GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER:
1291 _mesa_program_resource_prop(shProg, res, index,
1292 GL_REFERENCED_BY_TESS_EVALUATION_SHADER, params,
1293 false, caller);
1294 return;
1295
1296 case GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER:
1297 case GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER:
1298 _mesa_program_resource_prop(shProg, res, index,
1299 GL_REFERENCED_BY_GEOMETRY_SHADER, params,
1300 false, caller);
1301 return;
1302 case GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:
1303 case GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER:
1304 _mesa_program_resource_prop(shProg, res, index,
1305 GL_REFERENCED_BY_FRAGMENT_SHADER, params,
1306 false, caller);
1307 return;
1308 case GL_UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER:
1309 case GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER:
1310 _mesa_program_resource_prop(shProg, res, index,
1311 GL_REFERENCED_BY_COMPUTE_SHADER, params,
1312 false, caller);
1313 return;
1314 default:
1315 _mesa_error(ctx, GL_INVALID_ENUM,
1316 "%s(pname 0x%x (%s))", caller, pname,
1317 _mesa_enum_to_string(pname));
1318 return;
1319 }
1320 }
1321
1322
1323 void GLAPIENTRY
_mesa_GetActiveUniformBlockiv(GLuint program,GLuint uniformBlockIndex,GLenum pname,GLint * params)1324 _mesa_GetActiveUniformBlockiv(GLuint program,
1325 GLuint uniformBlockIndex,
1326 GLenum pname,
1327 GLint *params)
1328 {
1329 GET_CURRENT_CONTEXT(ctx);
1330 struct gl_shader_program *shProg;
1331
1332 if (!ctx->Extensions.ARB_uniform_buffer_object) {
1333 _mesa_error(ctx, GL_INVALID_OPERATION, "glGetActiveUniformBlockiv");
1334 return;
1335 }
1336
1337 shProg = _mesa_lookup_shader_program_err(ctx, program,
1338 "glGetActiveUniformBlockiv");
1339 if (!shProg)
1340 return;
1341
1342 mesa_bufferiv(shProg, GL_UNIFORM_BLOCK, uniformBlockIndex, pname, params,
1343 "glGetActiveUniformBlockiv");
1344 }
1345
1346 void GLAPIENTRY
_mesa_GetActiveUniformBlockName(GLuint program,GLuint uniformBlockIndex,GLsizei bufSize,GLsizei * length,GLchar * uniformBlockName)1347 _mesa_GetActiveUniformBlockName(GLuint program,
1348 GLuint uniformBlockIndex,
1349 GLsizei bufSize,
1350 GLsizei *length,
1351 GLchar *uniformBlockName)
1352 {
1353 GET_CURRENT_CONTEXT(ctx);
1354 struct gl_shader_program *shProg;
1355
1356 if (!ctx->Extensions.ARB_uniform_buffer_object) {
1357 _mesa_error(ctx, GL_INVALID_OPERATION, "glGetActiveUniformBlockiv");
1358 return;
1359 }
1360
1361 if (bufSize < 0) {
1362 _mesa_error(ctx, GL_INVALID_VALUE,
1363 "glGetActiveUniformBlockName(bufSize %d < 0)",
1364 bufSize);
1365 return;
1366 }
1367
1368 shProg = _mesa_lookup_shader_program_err(ctx, program,
1369 "glGetActiveUniformBlockiv");
1370 if (!shProg)
1371 return;
1372
1373 if (uniformBlockName)
1374 _mesa_get_program_resource_name(shProg, GL_UNIFORM_BLOCK,
1375 uniformBlockIndex, bufSize, length,
1376 uniformBlockName, false,
1377 "glGetActiveUniformBlockName");
1378 }
1379
1380 void GLAPIENTRY
_mesa_GetActiveUniformName(GLuint program,GLuint uniformIndex,GLsizei bufSize,GLsizei * length,GLchar * uniformName)1381 _mesa_GetActiveUniformName(GLuint program, GLuint uniformIndex,
1382 GLsizei bufSize, GLsizei *length,
1383 GLchar *uniformName)
1384 {
1385 GET_CURRENT_CONTEXT(ctx);
1386 struct gl_shader_program *shProg;
1387
1388 if (!ctx->Extensions.ARB_uniform_buffer_object) {
1389 _mesa_error(ctx, GL_INVALID_OPERATION, "glGetActiveUniformName");
1390 return;
1391 }
1392
1393 if (bufSize < 0) {
1394 _mesa_error(ctx, GL_INVALID_VALUE,
1395 "glGetActiveUniformName(bufSize %d < 0)",
1396 bufSize);
1397 return;
1398 }
1399
1400 shProg = _mesa_lookup_shader_program_err(ctx, program, "glGetActiveUniformName");
1401
1402 if (!shProg)
1403 return;
1404
1405 _mesa_get_program_resource_name(shProg, GL_UNIFORM, uniformIndex, bufSize,
1406 length, uniformName, false,
1407 "glGetActiveUniformName");
1408 }
1409
1410 void GLAPIENTRY
_mesa_GetActiveAtomicCounterBufferiv(GLuint program,GLuint bufferIndex,GLenum pname,GLint * params)1411 _mesa_GetActiveAtomicCounterBufferiv(GLuint program, GLuint bufferIndex,
1412 GLenum pname, GLint *params)
1413 {
1414 GET_CURRENT_CONTEXT(ctx);
1415 struct gl_shader_program *shProg;
1416
1417 if (!ctx->Extensions.ARB_shader_atomic_counters) {
1418 _mesa_error(ctx, GL_INVALID_OPERATION,
1419 "glGetActiveAtomicCounterBufferiv");
1420 return;
1421 }
1422
1423 shProg = _mesa_lookup_shader_program_err(ctx, program,
1424 "glGetActiveAtomicCounterBufferiv");
1425 if (!shProg)
1426 return;
1427
1428 mesa_bufferiv(shProg, GL_ATOMIC_COUNTER_BUFFER, bufferIndex, pname, params,
1429 "glGetActiveAtomicCounterBufferiv");
1430 }
1431
1432 void GLAPIENTRY
_mesa_Uniform1d(GLint location,GLdouble v0)1433 _mesa_Uniform1d(GLint location, GLdouble v0)
1434 {
1435 GET_CURRENT_CONTEXT(ctx);
1436 _mesa_uniform(location, 1, &v0, ctx, ctx->_Shader->ActiveProgram, GLSL_TYPE_DOUBLE, 1);
1437 }
1438
1439 void GLAPIENTRY
_mesa_Uniform2d(GLint location,GLdouble v0,GLdouble v1)1440 _mesa_Uniform2d(GLint location, GLdouble v0, GLdouble v1)
1441 {
1442 GET_CURRENT_CONTEXT(ctx);
1443 GLdouble v[2];
1444 v[0] = v0;
1445 v[1] = v1;
1446 _mesa_uniform(location, 1, v, ctx, ctx->_Shader->ActiveProgram, GLSL_TYPE_DOUBLE, 2);
1447 }
1448
1449 void GLAPIENTRY
_mesa_Uniform3d(GLint location,GLdouble v0,GLdouble v1,GLdouble v2)1450 _mesa_Uniform3d(GLint location, GLdouble v0, GLdouble v1, GLdouble v2)
1451 {
1452 GET_CURRENT_CONTEXT(ctx);
1453 GLdouble v[3];
1454 v[0] = v0;
1455 v[1] = v1;
1456 v[2] = v2;
1457 _mesa_uniform(location, 1, v, ctx, ctx->_Shader->ActiveProgram, GLSL_TYPE_DOUBLE, 3);
1458 }
1459
1460 void GLAPIENTRY
_mesa_Uniform4d(GLint location,GLdouble v0,GLdouble v1,GLdouble v2,GLdouble v3)1461 _mesa_Uniform4d(GLint location, GLdouble v0, GLdouble v1, GLdouble v2,
1462 GLdouble v3)
1463 {
1464 GET_CURRENT_CONTEXT(ctx);
1465 GLdouble v[4];
1466 v[0] = v0;
1467 v[1] = v1;
1468 v[2] = v2;
1469 v[3] = v3;
1470 _mesa_uniform(location, 1, v, ctx, ctx->_Shader->ActiveProgram, GLSL_TYPE_DOUBLE, 4);
1471 }
1472
1473 void GLAPIENTRY
_mesa_Uniform1dv(GLint location,GLsizei count,const GLdouble * value)1474 _mesa_Uniform1dv(GLint location, GLsizei count, const GLdouble * value)
1475 {
1476 GET_CURRENT_CONTEXT(ctx);
1477 _mesa_uniform(location, count, value, ctx, ctx->_Shader->ActiveProgram, GLSL_TYPE_DOUBLE, 1);
1478 }
1479
1480 void GLAPIENTRY
_mesa_Uniform2dv(GLint location,GLsizei count,const GLdouble * value)1481 _mesa_Uniform2dv(GLint location, GLsizei count, const GLdouble * value)
1482 {
1483 GET_CURRENT_CONTEXT(ctx);
1484 _mesa_uniform(location, count, value, ctx, ctx->_Shader->ActiveProgram, GLSL_TYPE_DOUBLE, 2);
1485 }
1486
1487 void GLAPIENTRY
_mesa_Uniform3dv(GLint location,GLsizei count,const GLdouble * value)1488 _mesa_Uniform3dv(GLint location, GLsizei count, const GLdouble * value)
1489 {
1490 GET_CURRENT_CONTEXT(ctx);
1491 _mesa_uniform(location, count, value, ctx, ctx->_Shader->ActiveProgram, GLSL_TYPE_DOUBLE, 3);
1492 }
1493
1494 void GLAPIENTRY
_mesa_Uniform4dv(GLint location,GLsizei count,const GLdouble * value)1495 _mesa_Uniform4dv(GLint location, GLsizei count, const GLdouble * value)
1496 {
1497 GET_CURRENT_CONTEXT(ctx);
1498 _mesa_uniform(location, count, value, ctx, ctx->_Shader->ActiveProgram, GLSL_TYPE_DOUBLE, 4);
1499 }
1500
1501 void GLAPIENTRY
_mesa_UniformMatrix2dv(GLint location,GLsizei count,GLboolean transpose,const GLdouble * value)1502 _mesa_UniformMatrix2dv(GLint location, GLsizei count, GLboolean transpose,
1503 const GLdouble * value)
1504 {
1505 GET_CURRENT_CONTEXT(ctx);
1506 _mesa_uniform_matrix(location, count, transpose, value,
1507 ctx, ctx->_Shader->ActiveProgram, 2, 2, GLSL_TYPE_DOUBLE);
1508 }
1509
1510 void GLAPIENTRY
_mesa_UniformMatrix3dv(GLint location,GLsizei count,GLboolean transpose,const GLdouble * value)1511 _mesa_UniformMatrix3dv(GLint location, GLsizei count, GLboolean transpose,
1512 const GLdouble * value)
1513 {
1514 GET_CURRENT_CONTEXT(ctx);
1515 _mesa_uniform_matrix(location, count, transpose, value,
1516 ctx, ctx->_Shader->ActiveProgram, 3, 3, GLSL_TYPE_DOUBLE);
1517 }
1518
1519 void GLAPIENTRY
_mesa_UniformMatrix4dv(GLint location,GLsizei count,GLboolean transpose,const GLdouble * value)1520 _mesa_UniformMatrix4dv(GLint location, GLsizei count, GLboolean transpose,
1521 const GLdouble * value)
1522 {
1523 GET_CURRENT_CONTEXT(ctx);
1524 _mesa_uniform_matrix(location, count, transpose, value,
1525 ctx, ctx->_Shader->ActiveProgram, 4, 4, GLSL_TYPE_DOUBLE);
1526 }
1527
1528 void GLAPIENTRY
_mesa_UniformMatrix2x3dv(GLint location,GLsizei count,GLboolean transpose,const GLdouble * value)1529 _mesa_UniformMatrix2x3dv(GLint location, GLsizei count, GLboolean transpose,
1530 const GLdouble *value)
1531 {
1532 GET_CURRENT_CONTEXT(ctx);
1533 _mesa_uniform_matrix(location, count, transpose, value,
1534 ctx, ctx->_Shader->ActiveProgram, 2, 3, GLSL_TYPE_DOUBLE);
1535 }
1536
1537 void GLAPIENTRY
_mesa_UniformMatrix3x2dv(GLint location,GLsizei count,GLboolean transpose,const GLdouble * value)1538 _mesa_UniformMatrix3x2dv(GLint location, GLsizei count, GLboolean transpose,
1539 const GLdouble *value)
1540 {
1541 GET_CURRENT_CONTEXT(ctx);
1542 _mesa_uniform_matrix(location, count, transpose, value,
1543 ctx, ctx->_Shader->ActiveProgram, 3, 2, GLSL_TYPE_DOUBLE);
1544 }
1545
1546 void GLAPIENTRY
_mesa_UniformMatrix2x4dv(GLint location,GLsizei count,GLboolean transpose,const GLdouble * value)1547 _mesa_UniformMatrix2x4dv(GLint location, GLsizei count, GLboolean transpose,
1548 const GLdouble *value)
1549 {
1550 GET_CURRENT_CONTEXT(ctx);
1551 _mesa_uniform_matrix(location, count, transpose, value,
1552 ctx, ctx->_Shader->ActiveProgram, 2, 4, GLSL_TYPE_DOUBLE);
1553 }
1554
1555 void GLAPIENTRY
_mesa_UniformMatrix4x2dv(GLint location,GLsizei count,GLboolean transpose,const GLdouble * value)1556 _mesa_UniformMatrix4x2dv(GLint location, GLsizei count, GLboolean transpose,
1557 const GLdouble *value)
1558 {
1559 GET_CURRENT_CONTEXT(ctx);
1560 _mesa_uniform_matrix(location, count, transpose, value,
1561 ctx, ctx->_Shader->ActiveProgram, 4, 2, GLSL_TYPE_DOUBLE);
1562 }
1563
1564 void GLAPIENTRY
_mesa_UniformMatrix3x4dv(GLint location,GLsizei count,GLboolean transpose,const GLdouble * value)1565 _mesa_UniformMatrix3x4dv(GLint location, GLsizei count, GLboolean transpose,
1566 const GLdouble *value)
1567 {
1568 GET_CURRENT_CONTEXT(ctx);
1569 _mesa_uniform_matrix(location, count, transpose, value,
1570 ctx, ctx->_Shader->ActiveProgram, 3, 4, GLSL_TYPE_DOUBLE);
1571 }
1572
1573 void GLAPIENTRY
_mesa_UniformMatrix4x3dv(GLint location,GLsizei count,GLboolean transpose,const GLdouble * value)1574 _mesa_UniformMatrix4x3dv(GLint location, GLsizei count, GLboolean transpose,
1575 const GLdouble *value)
1576 {
1577 GET_CURRENT_CONTEXT(ctx);
1578 _mesa_uniform_matrix(location, count, transpose, value,
1579 ctx, ctx->_Shader->ActiveProgram, 4, 3, GLSL_TYPE_DOUBLE);
1580 }
1581
1582 void GLAPIENTRY
_mesa_ProgramUniform1d(GLuint program,GLint location,GLdouble v0)1583 _mesa_ProgramUniform1d(GLuint program, GLint location, GLdouble v0)
1584 {
1585 GET_CURRENT_CONTEXT(ctx);
1586 struct gl_shader_program *shProg =
1587 _mesa_lookup_shader_program_err(ctx, program,
1588 "glProgramUniform1d");
1589 _mesa_uniform(location, 1, &v0, ctx, shProg, GLSL_TYPE_DOUBLE, 1);
1590 }
1591
1592 void GLAPIENTRY
_mesa_ProgramUniform2d(GLuint program,GLint location,GLdouble v0,GLdouble v1)1593 _mesa_ProgramUniform2d(GLuint program, GLint location, GLdouble v0, GLdouble v1)
1594 {
1595 GET_CURRENT_CONTEXT(ctx);
1596 GLdouble v[2];
1597 struct gl_shader_program *shProg;
1598 v[0] = v0;
1599 v[1] = v1;
1600 shProg = _mesa_lookup_shader_program_err(ctx, program, "glProgramUniform2d");
1601 _mesa_uniform(location, 1, v, ctx, shProg, GLSL_TYPE_DOUBLE, 2);
1602 }
1603
1604 void GLAPIENTRY
_mesa_ProgramUniform3d(GLuint program,GLint location,GLdouble v0,GLdouble v1,GLdouble v2)1605 _mesa_ProgramUniform3d(GLuint program, GLint location, GLdouble v0, GLdouble v1,
1606 GLdouble v2)
1607 {
1608 GET_CURRENT_CONTEXT(ctx);
1609 GLdouble v[3];
1610 struct gl_shader_program *shProg;
1611 v[0] = v0;
1612 v[1] = v1;
1613 v[2] = v2;
1614 shProg = _mesa_lookup_shader_program_err(ctx, program, "glProgramUniform3d");
1615 _mesa_uniform(location, 1, v, ctx, shProg, GLSL_TYPE_DOUBLE, 3);
1616 }
1617
1618 void GLAPIENTRY
_mesa_ProgramUniform4d(GLuint program,GLint location,GLdouble v0,GLdouble v1,GLdouble v2,GLdouble v3)1619 _mesa_ProgramUniform4d(GLuint program, GLint location, GLdouble v0, GLdouble v1,
1620 GLdouble v2, GLdouble v3)
1621 {
1622 GET_CURRENT_CONTEXT(ctx);
1623 GLdouble v[4];
1624 struct gl_shader_program *shProg;
1625 v[0] = v0;
1626 v[1] = v1;
1627 v[2] = v2;
1628 v[3] = v3;
1629 shProg = _mesa_lookup_shader_program_err(ctx, program, "glProgramUniform4d");
1630 _mesa_uniform(location, 1, v, ctx, shProg, GLSL_TYPE_DOUBLE, 4);
1631 }
1632
1633 void GLAPIENTRY
_mesa_ProgramUniform1dv(GLuint program,GLint location,GLsizei count,const GLdouble * value)1634 _mesa_ProgramUniform1dv(GLuint program, GLint location, GLsizei count,
1635 const GLdouble * value)
1636 {
1637 GET_CURRENT_CONTEXT(ctx);
1638 struct gl_shader_program *shProg =
1639 _mesa_lookup_shader_program_err(ctx, program,
1640 "glProgramUniform1dv");
1641 _mesa_uniform(location, count, value, ctx, shProg, GLSL_TYPE_DOUBLE, 1);
1642 }
1643
1644 void GLAPIENTRY
_mesa_ProgramUniform2dv(GLuint program,GLint location,GLsizei count,const GLdouble * value)1645 _mesa_ProgramUniform2dv(GLuint program, GLint location, GLsizei count,
1646 const GLdouble * value)
1647 {
1648 GET_CURRENT_CONTEXT(ctx);
1649 struct gl_shader_program *shProg =
1650 _mesa_lookup_shader_program_err(ctx, program,
1651 "glProgramUniform2dv");
1652 _mesa_uniform(location, count, value, ctx, shProg, GLSL_TYPE_DOUBLE, 2);
1653 }
1654
1655 void GLAPIENTRY
_mesa_ProgramUniform3dv(GLuint program,GLint location,GLsizei count,const GLdouble * value)1656 _mesa_ProgramUniform3dv(GLuint program, GLint location, GLsizei count,
1657 const GLdouble * value)
1658 {
1659 GET_CURRENT_CONTEXT(ctx);
1660 struct gl_shader_program *shProg =
1661 _mesa_lookup_shader_program_err(ctx, program,
1662 "glProgramUniform3dv");
1663 _mesa_uniform(location, count, value, ctx, shProg, GLSL_TYPE_DOUBLE, 3);
1664 }
1665
1666 void GLAPIENTRY
_mesa_ProgramUniform4dv(GLuint program,GLint location,GLsizei count,const GLdouble * value)1667 _mesa_ProgramUniform4dv(GLuint program, GLint location, GLsizei count,
1668 const GLdouble * value)
1669 {
1670 GET_CURRENT_CONTEXT(ctx);
1671 struct gl_shader_program *shProg =
1672 _mesa_lookup_shader_program_err(ctx, program,
1673 "glProgramUniform4dv");
1674 _mesa_uniform(location, count, value, ctx, shProg, GLSL_TYPE_DOUBLE, 4);
1675 }
1676
1677 void GLAPIENTRY
_mesa_ProgramUniformMatrix2dv(GLuint program,GLint location,GLsizei count,GLboolean transpose,const GLdouble * value)1678 _mesa_ProgramUniformMatrix2dv(GLuint program, GLint location, GLsizei count,
1679 GLboolean transpose, const GLdouble * value)
1680 {
1681 GET_CURRENT_CONTEXT(ctx);
1682 struct gl_shader_program *shProg =
1683 _mesa_lookup_shader_program_err(ctx, program,
1684 "glProgramUniformMatrix2dv");
1685 _mesa_uniform_matrix(location, count, transpose, value,
1686 ctx, shProg, 2, 2, GLSL_TYPE_DOUBLE);
1687 }
1688
1689 void GLAPIENTRY
_mesa_ProgramUniformMatrix3dv(GLuint program,GLint location,GLsizei count,GLboolean transpose,const GLdouble * value)1690 _mesa_ProgramUniformMatrix3dv(GLuint program, GLint location, GLsizei count,
1691 GLboolean transpose, const GLdouble * value)
1692 {
1693 GET_CURRENT_CONTEXT(ctx);
1694 struct gl_shader_program *shProg =
1695 _mesa_lookup_shader_program_err(ctx, program,
1696 "glProgramUniformMatrix3dv");
1697 _mesa_uniform_matrix(location, count, transpose, value,
1698 ctx, shProg, 3, 3, GLSL_TYPE_DOUBLE);
1699 }
1700
1701 void GLAPIENTRY
_mesa_ProgramUniformMatrix4dv(GLuint program,GLint location,GLsizei count,GLboolean transpose,const GLdouble * value)1702 _mesa_ProgramUniformMatrix4dv(GLuint program, GLint location, GLsizei count,
1703 GLboolean transpose, const GLdouble * value)
1704 {
1705 GET_CURRENT_CONTEXT(ctx);
1706 struct gl_shader_program *shProg =
1707 _mesa_lookup_shader_program_err(ctx, program,
1708 "glProgramUniformMatrix4dv");
1709 _mesa_uniform_matrix(location, count, transpose, value,
1710 ctx, shProg, 4, 4, GLSL_TYPE_DOUBLE);
1711 }
1712
1713 void GLAPIENTRY
_mesa_ProgramUniformMatrix2x3dv(GLuint program,GLint location,GLsizei count,GLboolean transpose,const GLdouble * value)1714 _mesa_ProgramUniformMatrix2x3dv(GLuint program, GLint location, GLsizei count,
1715 GLboolean transpose, const GLdouble * value)
1716 {
1717 GET_CURRENT_CONTEXT(ctx);
1718 struct gl_shader_program *shProg =
1719 _mesa_lookup_shader_program_err(ctx, program,
1720 "glProgramUniformMatrix2x3dv");
1721 _mesa_uniform_matrix(location, count, transpose, value,
1722 ctx, shProg, 2, 3, GLSL_TYPE_DOUBLE);
1723 }
1724
1725 void GLAPIENTRY
_mesa_ProgramUniformMatrix3x2dv(GLuint program,GLint location,GLsizei count,GLboolean transpose,const GLdouble * value)1726 _mesa_ProgramUniformMatrix3x2dv(GLuint program, GLint location, GLsizei count,
1727 GLboolean transpose, const GLdouble * value)
1728 {
1729 GET_CURRENT_CONTEXT(ctx);
1730 struct gl_shader_program *shProg =
1731 _mesa_lookup_shader_program_err(ctx, program,
1732 "glProgramUniformMatrix3x2dv");
1733 _mesa_uniform_matrix(location, count, transpose, value,
1734 ctx, shProg, 3, 2, GLSL_TYPE_DOUBLE);
1735 }
1736
1737 void GLAPIENTRY
_mesa_ProgramUniformMatrix2x4dv(GLuint program,GLint location,GLsizei count,GLboolean transpose,const GLdouble * value)1738 _mesa_ProgramUniformMatrix2x4dv(GLuint program, GLint location, GLsizei count,
1739 GLboolean transpose, const GLdouble * value)
1740 {
1741 GET_CURRENT_CONTEXT(ctx);
1742 struct gl_shader_program *shProg =
1743 _mesa_lookup_shader_program_err(ctx, program,
1744 "glProgramUniformMatrix2x4dv");
1745 _mesa_uniform_matrix(location, count, transpose, value,
1746 ctx, shProg, 2, 4, GLSL_TYPE_DOUBLE);
1747 }
1748
1749 void GLAPIENTRY
_mesa_ProgramUniformMatrix4x2dv(GLuint program,GLint location,GLsizei count,GLboolean transpose,const GLdouble * value)1750 _mesa_ProgramUniformMatrix4x2dv(GLuint program, GLint location, GLsizei count,
1751 GLboolean transpose, const GLdouble * value)
1752 {
1753 GET_CURRENT_CONTEXT(ctx);
1754 struct gl_shader_program *shProg =
1755 _mesa_lookup_shader_program_err(ctx, program,
1756 "glProgramUniformMatrix4x2dv");
1757 _mesa_uniform_matrix(location, count, transpose, value,
1758 ctx, shProg, 4, 2, GLSL_TYPE_DOUBLE);
1759 }
1760
1761 void GLAPIENTRY
_mesa_ProgramUniformMatrix3x4dv(GLuint program,GLint location,GLsizei count,GLboolean transpose,const GLdouble * value)1762 _mesa_ProgramUniformMatrix3x4dv(GLuint program, GLint location, GLsizei count,
1763 GLboolean transpose, const GLdouble * value)
1764 {
1765 GET_CURRENT_CONTEXT(ctx);
1766 struct gl_shader_program *shProg =
1767 _mesa_lookup_shader_program_err(ctx, program,
1768 "glProgramUniformMatrix3x4dv");
1769 _mesa_uniform_matrix(location, count, transpose, value,
1770 ctx, shProg, 3, 4, GLSL_TYPE_DOUBLE);
1771 }
1772
1773 void GLAPIENTRY
_mesa_ProgramUniformMatrix4x3dv(GLuint program,GLint location,GLsizei count,GLboolean transpose,const GLdouble * value)1774 _mesa_ProgramUniformMatrix4x3dv(GLuint program, GLint location, GLsizei count,
1775 GLboolean transpose, const GLdouble * value)
1776 {
1777 GET_CURRENT_CONTEXT(ctx);
1778 struct gl_shader_program *shProg =
1779 _mesa_lookup_shader_program_err(ctx, program,
1780 "glProgramUniformMatrix4x3dv");
1781 _mesa_uniform_matrix(location, count, transpose, value,
1782 ctx, shProg, 4, 3, GLSL_TYPE_DOUBLE);
1783 }
1784
1785 void GLAPIENTRY
_mesa_Uniform1i64ARB(GLint location,GLint64 v0)1786 _mesa_Uniform1i64ARB(GLint location, GLint64 v0)
1787 {
1788 GET_CURRENT_CONTEXT(ctx);
1789 _mesa_uniform(location, 1, &v0, ctx, ctx->_Shader->ActiveProgram, GLSL_TYPE_INT64, 1);
1790 }
1791
1792 void GLAPIENTRY
_mesa_Uniform2i64ARB(GLint location,GLint64 v0,GLint64 v1)1793 _mesa_Uniform2i64ARB(GLint location, GLint64 v0, GLint64 v1)
1794 {
1795 GET_CURRENT_CONTEXT(ctx);
1796 int64_t v[2];
1797 v[0] = v0;
1798 v[1] = v1;
1799 _mesa_uniform(location, 1, v, ctx, ctx->_Shader->ActiveProgram, GLSL_TYPE_INT64, 2);
1800 }
1801
1802 void GLAPIENTRY
_mesa_Uniform3i64ARB(GLint location,GLint64 v0,GLint64 v1,GLint64 v2)1803 _mesa_Uniform3i64ARB(GLint location, GLint64 v0, GLint64 v1, GLint64 v2)
1804 {
1805 GET_CURRENT_CONTEXT(ctx);
1806 int64_t v[3];
1807 v[0] = v0;
1808 v[1] = v1;
1809 v[2] = v2;
1810 _mesa_uniform(location, 1, v, ctx, ctx->_Shader->ActiveProgram, GLSL_TYPE_INT64, 3);
1811 }
1812
1813 void GLAPIENTRY
_mesa_Uniform4i64ARB(GLint location,GLint64 v0,GLint64 v1,GLint64 v2,GLint64 v3)1814 _mesa_Uniform4i64ARB(GLint location, GLint64 v0, GLint64 v1, GLint64 v2, GLint64 v3)
1815 {
1816 GET_CURRENT_CONTEXT(ctx);
1817 int64_t v[4];
1818 v[0] = v0;
1819 v[1] = v1;
1820 v[2] = v2;
1821 v[3] = v3;
1822 _mesa_uniform(location, 1, v, ctx, ctx->_Shader->ActiveProgram, GLSL_TYPE_INT64, 4);
1823 }
1824
1825 void GLAPIENTRY
_mesa_Uniform1i64vARB(GLint location,GLsizei count,const GLint64 * value)1826 _mesa_Uniform1i64vARB(GLint location, GLsizei count, const GLint64 *value)
1827 {
1828 GET_CURRENT_CONTEXT(ctx);
1829 _mesa_uniform(location, count, value, ctx, ctx->_Shader->ActiveProgram, GLSL_TYPE_INT64, 1);
1830 }
1831
1832 void GLAPIENTRY
_mesa_Uniform2i64vARB(GLint location,GLsizei count,const GLint64 * value)1833 _mesa_Uniform2i64vARB(GLint location, GLsizei count, const GLint64 *value)
1834 {
1835 GET_CURRENT_CONTEXT(ctx);
1836 _mesa_uniform(location, count, value, ctx, ctx->_Shader->ActiveProgram, GLSL_TYPE_INT64, 2);
1837 }
1838
1839 void GLAPIENTRY
_mesa_Uniform3i64vARB(GLint location,GLsizei count,const GLint64 * value)1840 _mesa_Uniform3i64vARB(GLint location, GLsizei count, const GLint64 *value)
1841 {
1842 GET_CURRENT_CONTEXT(ctx);
1843 _mesa_uniform(location, count, value, ctx, ctx->_Shader->ActiveProgram, GLSL_TYPE_INT64, 3);
1844 }
1845
1846 void GLAPIENTRY
_mesa_Uniform4i64vARB(GLint location,GLsizei count,const GLint64 * value)1847 _mesa_Uniform4i64vARB(GLint location, GLsizei count, const GLint64 *value)
1848 {
1849 GET_CURRENT_CONTEXT(ctx);
1850 _mesa_uniform(location, count, value, ctx, ctx->_Shader->ActiveProgram, GLSL_TYPE_INT64, 4);
1851 }
1852
1853 void GLAPIENTRY
_mesa_Uniform1ui64ARB(GLint location,GLuint64 v0)1854 _mesa_Uniform1ui64ARB(GLint location, GLuint64 v0)
1855 {
1856 GET_CURRENT_CONTEXT(ctx);
1857 _mesa_uniform(location, 1, &v0, ctx, ctx->_Shader->ActiveProgram, GLSL_TYPE_UINT64, 1);
1858 }
1859
1860 void GLAPIENTRY
_mesa_Uniform2ui64ARB(GLint location,GLuint64 v0,GLuint64 v1)1861 _mesa_Uniform2ui64ARB(GLint location, GLuint64 v0, GLuint64 v1)
1862 {
1863 GET_CURRENT_CONTEXT(ctx);
1864 uint64_t v[2];
1865 v[0] = v0;
1866 v[1] = v1;
1867 _mesa_uniform(location, 1, v, ctx, ctx->_Shader->ActiveProgram, GLSL_TYPE_UINT64, 2);
1868 }
1869
1870 void GLAPIENTRY
_mesa_Uniform3ui64ARB(GLint location,GLuint64 v0,GLuint64 v1,GLuint64 v2)1871 _mesa_Uniform3ui64ARB(GLint location, GLuint64 v0, GLuint64 v1, GLuint64 v2)
1872 {
1873 GET_CURRENT_CONTEXT(ctx);
1874 uint64_t v[3];
1875 v[0] = v0;
1876 v[1] = v1;
1877 v[2] = v2;
1878 _mesa_uniform(location, 1, v, ctx, ctx->_Shader->ActiveProgram, GLSL_TYPE_UINT64, 3);
1879 }
1880
1881 void GLAPIENTRY
_mesa_Uniform4ui64ARB(GLint location,GLuint64 v0,GLuint64 v1,GLuint64 v2,GLuint64 v3)1882 _mesa_Uniform4ui64ARB(GLint location, GLuint64 v0, GLuint64 v1, GLuint64 v2, GLuint64 v3)
1883 {
1884 GET_CURRENT_CONTEXT(ctx);
1885 uint64_t v[4];
1886 v[0] = v0;
1887 v[1] = v1;
1888 v[2] = v2;
1889 v[3] = v3;
1890 _mesa_uniform(location, 1, v, ctx, ctx->_Shader->ActiveProgram, GLSL_TYPE_UINT64, 4);
1891 }
1892
1893 void GLAPIENTRY
_mesa_Uniform1ui64vARB(GLint location,GLsizei count,const GLuint64 * value)1894 _mesa_Uniform1ui64vARB(GLint location, GLsizei count, const GLuint64 *value)
1895 {
1896 GET_CURRENT_CONTEXT(ctx);
1897 _mesa_uniform(location, count, value, ctx, ctx->_Shader->ActiveProgram, GLSL_TYPE_UINT64, 1);
1898 }
1899
1900 void GLAPIENTRY
_mesa_Uniform2ui64vARB(GLint location,GLsizei count,const GLuint64 * value)1901 _mesa_Uniform2ui64vARB(GLint location, GLsizei count, const GLuint64 *value)
1902 {
1903 GET_CURRENT_CONTEXT(ctx);
1904 _mesa_uniform(location, count, value, ctx, ctx->_Shader->ActiveProgram, GLSL_TYPE_UINT64, 2);
1905 }
1906
1907 void GLAPIENTRY
_mesa_Uniform3ui64vARB(GLint location,GLsizei count,const GLuint64 * value)1908 _mesa_Uniform3ui64vARB(GLint location, GLsizei count, const GLuint64 *value)
1909 {
1910 GET_CURRENT_CONTEXT(ctx);
1911 _mesa_uniform(location, count, value, ctx, ctx->_Shader->ActiveProgram, GLSL_TYPE_UINT64, 3);
1912 }
1913
1914 void GLAPIENTRY
_mesa_Uniform4ui64vARB(GLint location,GLsizei count,const GLuint64 * value)1915 _mesa_Uniform4ui64vARB(GLint location, GLsizei count, const GLuint64 *value)
1916 {
1917 GET_CURRENT_CONTEXT(ctx);
1918 _mesa_uniform(location, count, value, ctx, ctx->_Shader->ActiveProgram, GLSL_TYPE_UINT64, 4);
1919 }
1920
1921 /* DSA entrypoints */
1922 void GLAPIENTRY
_mesa_ProgramUniform1i64ARB(GLuint program,GLint location,GLint64 v0)1923 _mesa_ProgramUniform1i64ARB(GLuint program, GLint location, GLint64 v0)
1924 {
1925 GET_CURRENT_CONTEXT(ctx);
1926 struct gl_shader_program *shProg =
1927 _mesa_lookup_shader_program_err(ctx, program,
1928 "glProgramUniform1i64ARB");
1929 _mesa_uniform(location, 1, &v0, ctx, shProg, GLSL_TYPE_INT64, 1);
1930 }
1931
1932 void GLAPIENTRY
_mesa_ProgramUniform2i64ARB(GLuint program,GLint location,GLint64 v0,GLint64 v1)1933 _mesa_ProgramUniform2i64ARB(GLuint program, GLint location, GLint64 v0, GLint64 v1)
1934 {
1935 GET_CURRENT_CONTEXT(ctx);
1936 struct gl_shader_program *shProg =
1937 _mesa_lookup_shader_program_err(ctx, program,
1938 "glProgramUniform2i64ARB");
1939 int64_t v[2];
1940 v[0] = v0;
1941 v[1] = v1;
1942 _mesa_uniform(location, 1, v, ctx, shProg, GLSL_TYPE_INT64, 2);
1943 }
1944
1945 void GLAPIENTRY
_mesa_ProgramUniform3i64ARB(GLuint program,GLint location,GLint64 v0,GLint64 v1,GLint64 v2)1946 _mesa_ProgramUniform3i64ARB(GLuint program, GLint location, GLint64 v0, GLint64 v1, GLint64 v2)
1947 {
1948 GET_CURRENT_CONTEXT(ctx);
1949 struct gl_shader_program *shProg =
1950 _mesa_lookup_shader_program_err(ctx, program,
1951 "glProgramUniform3i64ARB");
1952 int64_t v[3];
1953 v[0] = v0;
1954 v[1] = v1;
1955 v[2] = v2;
1956 _mesa_uniform(location, 1, v, ctx, shProg, GLSL_TYPE_INT64, 3);
1957 }
1958
1959 void GLAPIENTRY
_mesa_ProgramUniform4i64ARB(GLuint program,GLint location,GLint64 v0,GLint64 v1,GLint64 v2,GLint64 v3)1960 _mesa_ProgramUniform4i64ARB(GLuint program, GLint location, GLint64 v0, GLint64 v1, GLint64 v2, GLint64 v3)
1961 {
1962 GET_CURRENT_CONTEXT(ctx);
1963 struct gl_shader_program *shProg =
1964 _mesa_lookup_shader_program_err(ctx, program,
1965 "glProgramUniform4i64ARB");
1966 int64_t v[4];
1967 v[0] = v0;
1968 v[1] = v1;
1969 v[2] = v2;
1970 v[3] = v3;
1971 _mesa_uniform(location, 1, v, ctx, shProg, GLSL_TYPE_INT64, 4);
1972 }
1973
1974 void GLAPIENTRY
_mesa_ProgramUniform1i64vARB(GLuint program,GLint location,GLsizei count,const GLint64 * value)1975 _mesa_ProgramUniform1i64vARB(GLuint program, GLint location, GLsizei count, const GLint64 *value)
1976 {
1977 GET_CURRENT_CONTEXT(ctx);
1978 struct gl_shader_program *shProg =
1979 _mesa_lookup_shader_program_err(ctx, program,
1980 "glProgramUniform1i64vARB");
1981 _mesa_uniform(location, count, value, ctx, shProg, GLSL_TYPE_INT64, 1);
1982 }
1983
1984 void GLAPIENTRY
_mesa_ProgramUniform2i64vARB(GLuint program,GLint location,GLsizei count,const GLint64 * value)1985 _mesa_ProgramUniform2i64vARB(GLuint program, GLint location, GLsizei count, const GLint64 *value)
1986 {
1987 GET_CURRENT_CONTEXT(ctx);
1988 struct gl_shader_program *shProg =
1989 _mesa_lookup_shader_program_err(ctx, program,
1990 "glProgramUniform2i64vARB");
1991 _mesa_uniform(location, count, value, ctx, shProg, GLSL_TYPE_INT64, 2);
1992 }
1993
1994 void GLAPIENTRY
_mesa_ProgramUniform3i64vARB(GLuint program,GLint location,GLsizei count,const GLint64 * value)1995 _mesa_ProgramUniform3i64vARB(GLuint program, GLint location, GLsizei count, const GLint64 *value)
1996 {
1997 GET_CURRENT_CONTEXT(ctx);
1998 struct gl_shader_program *shProg =
1999 _mesa_lookup_shader_program_err(ctx, program,
2000 "glProgramUniform3i64vARB");
2001 _mesa_uniform(location, count, value, ctx, shProg, GLSL_TYPE_INT64, 3);
2002 }
2003
2004 void GLAPIENTRY
_mesa_ProgramUniform4i64vARB(GLuint program,GLint location,GLsizei count,const GLint64 * value)2005 _mesa_ProgramUniform4i64vARB(GLuint program, GLint location, GLsizei count, const GLint64 *value)
2006 {
2007 GET_CURRENT_CONTEXT(ctx);
2008 struct gl_shader_program *shProg =
2009 _mesa_lookup_shader_program_err(ctx, program,
2010 "glProgramUniform4i64vARB");
2011 _mesa_uniform(location, count, value, ctx, shProg, GLSL_TYPE_INT64, 4);
2012 }
2013
2014 void GLAPIENTRY
_mesa_ProgramUniform1ui64ARB(GLuint program,GLint location,GLuint64 v0)2015 _mesa_ProgramUniform1ui64ARB(GLuint program, GLint location, GLuint64 v0)
2016 {
2017 GET_CURRENT_CONTEXT(ctx);
2018 struct gl_shader_program *shProg =
2019 _mesa_lookup_shader_program_err(ctx, program,
2020 "glProgramUniform1ui64ARB");
2021 _mesa_uniform(location, 1, &v0, ctx, shProg, GLSL_TYPE_UINT64, 1);
2022 }
2023
2024 void GLAPIENTRY
_mesa_ProgramUniform2ui64ARB(GLuint program,GLint location,GLuint64 v0,GLuint64 v1)2025 _mesa_ProgramUniform2ui64ARB(GLuint program, GLint location, GLuint64 v0, GLuint64 v1)
2026 {
2027 GET_CURRENT_CONTEXT(ctx);
2028 struct gl_shader_program *shProg =
2029 _mesa_lookup_shader_program_err(ctx, program,
2030 "glProgramUniform2ui64ARB");
2031 uint64_t v[2];
2032 v[0] = v0;
2033 v[1] = v1;
2034 _mesa_uniform(location, 1, v, ctx, shProg, GLSL_TYPE_UINT64, 2);
2035 }
2036
2037 void GLAPIENTRY
_mesa_ProgramUniform3ui64ARB(GLuint program,GLint location,GLuint64 v0,GLuint64 v1,GLuint64 v2)2038 _mesa_ProgramUniform3ui64ARB(GLuint program, GLint location, GLuint64 v0, GLuint64 v1, GLuint64 v2)
2039 {
2040 GET_CURRENT_CONTEXT(ctx);
2041 struct gl_shader_program *shProg =
2042 _mesa_lookup_shader_program_err(ctx, program,
2043 "glProgramUniform3ui64ARB");
2044 uint64_t v[3];
2045 v[0] = v0;
2046 v[1] = v1;
2047 v[2] = v2;
2048 _mesa_uniform(location, 1, v, ctx, shProg, GLSL_TYPE_UINT64, 3);
2049 }
2050
2051 void GLAPIENTRY
_mesa_ProgramUniform4ui64ARB(GLuint program,GLint location,GLuint64 v0,GLuint64 v1,GLuint64 v2,GLuint64 v3)2052 _mesa_ProgramUniform4ui64ARB(GLuint program, GLint location, GLuint64 v0, GLuint64 v1, GLuint64 v2, GLuint64 v3)
2053 {
2054 GET_CURRENT_CONTEXT(ctx);
2055 struct gl_shader_program *shProg =
2056 _mesa_lookup_shader_program_err(ctx, program,
2057 "glProgramUniform4ui64ARB");
2058 uint64_t v[4];
2059 v[0] = v0;
2060 v[1] = v1;
2061 v[2] = v2;
2062 v[3] = v3;
2063 _mesa_uniform(location, 1, v, ctx, shProg, GLSL_TYPE_UINT64, 4);
2064 }
2065
2066 void GLAPIENTRY
_mesa_ProgramUniform1ui64vARB(GLuint program,GLint location,GLsizei count,const GLuint64 * value)2067 _mesa_ProgramUniform1ui64vARB(GLuint program, GLint location, GLsizei count, const GLuint64 *value)
2068 {
2069 GET_CURRENT_CONTEXT(ctx);
2070 struct gl_shader_program *shProg =
2071 _mesa_lookup_shader_program_err(ctx, program,
2072 "glProgramUniform1ui64vARB");
2073 _mesa_uniform(location, count, value, ctx, shProg, GLSL_TYPE_UINT64, 1);
2074 }
2075
2076 void GLAPIENTRY
_mesa_ProgramUniform2ui64vARB(GLuint program,GLint location,GLsizei count,const GLuint64 * value)2077 _mesa_ProgramUniform2ui64vARB(GLuint program, GLint location, GLsizei count, const GLuint64 *value)
2078 {
2079 GET_CURRENT_CONTEXT(ctx);
2080 struct gl_shader_program *shProg =
2081 _mesa_lookup_shader_program_err(ctx, program,
2082 "glProgramUniform2ui64vARB");
2083 _mesa_uniform(location, count, value, ctx, shProg, GLSL_TYPE_UINT64, 2);
2084 }
2085
2086 void GLAPIENTRY
_mesa_ProgramUniform3ui64vARB(GLuint program,GLint location,GLsizei count,const GLuint64 * value)2087 _mesa_ProgramUniform3ui64vARB(GLuint program, GLint location, GLsizei count, const GLuint64 *value)
2088 {
2089 GET_CURRENT_CONTEXT(ctx);
2090 struct gl_shader_program *shProg =
2091 _mesa_lookup_shader_program_err(ctx, program,
2092 "glProgramUniform3ui64vARB");
2093 _mesa_uniform(location, count, value, ctx, shProg, GLSL_TYPE_UINT64, 3);
2094 }
2095
2096 void GLAPIENTRY
_mesa_ProgramUniform4ui64vARB(GLuint program,GLint location,GLsizei count,const GLuint64 * value)2097 _mesa_ProgramUniform4ui64vARB(GLuint program, GLint location, GLsizei count, const GLuint64 *value)
2098 {
2099 GET_CURRENT_CONTEXT(ctx);
2100 struct gl_shader_program *shProg =
2101 _mesa_lookup_shader_program_err(ctx, program,
2102 "glProgramUniform4ui64vARB");
2103 _mesa_uniform(location, count, value, ctx, shProg, GLSL_TYPE_UINT64, 4);
2104 }
2105