2 * Mesa 3-D graphics library
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
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:
15 * The above copyright notice and this permission notice shall be included
16 * in all copies or substantial portions of the Software.
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.
29 * Functions related to GLSL uniform variables.
35 * 1. Check that the right error code is generated for all _mesa_error() calls.
36 * 2. Insert FLUSH_VERTICES calls in various places
39 #include "main/glheader.h"
40 #include "main/context.h"
41 #include "main/dispatch.h"
42 #include "main/shaderapi.h"
43 #include "main/shaderobj.h"
44 #include "main/uniforms.h"
45 #include "main/enums.h"
46 #include "compiler/glsl/ir_uniform.h"
47 #include "compiler/glsl_types.h"
48 #include "program/program.h"
49 #include "util/bitscan.h"
52 * Update the vertex/fragment program's TexturesUsed array.
54 * This needs to be called after glUniform(set sampler var) is called.
55 * A call to glUniform(samplerVar, value) causes a sampler to point to a
56 * particular texture unit. We know the sampler's texture target
57 * (1D/2D/3D/etc) from compile time but the sampler's texture unit is
58 * set by glUniform() calls.
60 * So, scan the program->SamplerUnits[] and program->SamplerTargets[]
61 * information to update the prog->TexturesUsed[] values.
62 * Each value of TexturesUsed[unit] is one of zero, TEXTURE_1D_INDEX,
63 * TEXTURE_2D_INDEX, TEXTURE_3D_INDEX, etc.
64 * We'll use that info for state validation before rendering.
67 _mesa_update_shader_textures_used(struct gl_shader_program
*shProg
,
68 struct gl_program
*prog
)
70 memset(prog
->TexturesUsed
, 0, sizeof(prog
->TexturesUsed
));
72 shProg
->SamplersValidated
= GL_TRUE
;
74 GLbitfield mask
= prog
->SamplersUsed
;
76 const int s
= u_bit_scan(&mask
);
77 GLuint unit
= prog
->SamplerUnits
[s
];
78 GLuint tgt
= prog
->sh
.SamplerTargets
[s
];
79 assert(unit
< ARRAY_SIZE(prog
->TexturesUsed
));
80 assert(tgt
< NUM_TEXTURE_TARGETS
);
82 /* The types of the samplers associated with a particular texture
83 * unit must be an exact match. Page 74 (page 89 of the PDF) of the
84 * OpenGL 3.3 core spec says:
86 * "It is not allowed to have variables of different sampler
87 * types pointing to the same texture image unit within a program
90 if (prog
->TexturesUsed
[unit
] & ~(1 << tgt
))
91 shProg
->SamplersValidated
= GL_FALSE
;
93 prog
->TexturesUsed
[unit
] |= (1 << tgt
);
98 * Connect a piece of driver storage with a part of a uniform
100 * \param uni The uniform with which the storage will be associated
101 * \param element_stride Byte-stride between array elements.
102 * \sa gl_uniform_driver_storage::element_stride.
103 * \param vector_stride Byte-stride between vectors (in a matrix).
104 * \sa gl_uniform_driver_storage::vector_stride.
105 * \param format Conversion from native format to driver format
106 * required by the driver.
107 * \param data Location to dump the data.
110 _mesa_uniform_attach_driver_storage(struct gl_uniform_storage
*uni
,
111 unsigned element_stride
,
112 unsigned vector_stride
,
113 enum gl_uniform_driver_format format
,
116 uni
->driver_storage
=
117 realloc(uni
->driver_storage
,
118 sizeof(struct gl_uniform_driver_storage
)
119 * (uni
->num_driver_storage
+ 1));
121 uni
->driver_storage
[uni
->num_driver_storage
].element_stride
= element_stride
;
122 uni
->driver_storage
[uni
->num_driver_storage
].vector_stride
= vector_stride
;
123 uni
->driver_storage
[uni
->num_driver_storage
].format
= format
;
124 uni
->driver_storage
[uni
->num_driver_storage
].data
= data
;
126 uni
->num_driver_storage
++;
130 * Sever all connections with all pieces of driver storage for all uniforms
133 * This function does \b not release any of the \c data pointers
134 * previously passed in to \c _mesa_uniform_attach_driver_stoarge.
137 _mesa_uniform_detach_all_driver_storage(struct gl_uniform_storage
*uni
)
139 free(uni
->driver_storage
);
140 uni
->driver_storage
= NULL
;
141 uni
->num_driver_storage
= 0;
145 _mesa_Uniform1f(GLint location
, GLfloat v0
)
147 GET_CURRENT_CONTEXT(ctx
);
148 _mesa_uniform(location
, 1, &v0
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_FLOAT
, 1);
152 _mesa_Uniform2f(GLint location
, GLfloat v0
, GLfloat v1
)
154 GET_CURRENT_CONTEXT(ctx
);
158 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_FLOAT
, 2);
162 _mesa_Uniform3f(GLint location
, GLfloat v0
, GLfloat v1
, GLfloat v2
)
164 GET_CURRENT_CONTEXT(ctx
);
169 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_FLOAT
, 3);
173 _mesa_Uniform4f(GLint location
, GLfloat v0
, GLfloat v1
, GLfloat v2
,
176 GET_CURRENT_CONTEXT(ctx
);
182 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_FLOAT
, 4);
186 _mesa_Uniform1i(GLint location
, GLint v0
)
188 GET_CURRENT_CONTEXT(ctx
);
189 _mesa_uniform(location
, 1, &v0
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT
, 1);
193 _mesa_Uniform2i(GLint location
, GLint v0
, GLint v1
)
195 GET_CURRENT_CONTEXT(ctx
);
199 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT
, 2);
203 _mesa_Uniform3i(GLint location
, GLint v0
, GLint v1
, GLint v2
)
205 GET_CURRENT_CONTEXT(ctx
);
210 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT
, 3);
214 _mesa_Uniform4i(GLint location
, GLint v0
, GLint v1
, GLint v2
, GLint v3
)
216 GET_CURRENT_CONTEXT(ctx
);
222 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT
, 4);
226 _mesa_Uniform1fv(GLint location
, GLsizei count
, const GLfloat
* value
)
228 GET_CURRENT_CONTEXT(ctx
);
229 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_FLOAT
, 1);
233 _mesa_Uniform2fv(GLint location
, GLsizei count
, const GLfloat
* value
)
235 GET_CURRENT_CONTEXT(ctx
);
236 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_FLOAT
, 2);
240 _mesa_Uniform3fv(GLint location
, GLsizei count
, const GLfloat
* value
)
242 GET_CURRENT_CONTEXT(ctx
);
243 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_FLOAT
, 3);
247 _mesa_Uniform4fv(GLint location
, GLsizei count
, const GLfloat
* value
)
249 GET_CURRENT_CONTEXT(ctx
);
250 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_FLOAT
, 4);
254 _mesa_Uniform1iv(GLint location
, GLsizei count
, const GLint
* value
)
256 GET_CURRENT_CONTEXT(ctx
);
257 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT
, 1);
261 _mesa_Uniform2iv(GLint location
, GLsizei count
, const GLint
* value
)
263 GET_CURRENT_CONTEXT(ctx
);
264 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT
, 2);
268 _mesa_Uniform3iv(GLint location
, GLsizei count
, const GLint
* value
)
270 GET_CURRENT_CONTEXT(ctx
);
271 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT
, 3);
275 _mesa_Uniform4iv(GLint location
, GLsizei count
, const GLint
* value
)
277 GET_CURRENT_CONTEXT(ctx
);
278 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT
, 4);
281 /** Same as above with direct state access **/
283 _mesa_ProgramUniform1f(GLuint program
, GLint location
, GLfloat v0
)
285 GET_CURRENT_CONTEXT(ctx
);
286 struct gl_shader_program
*shProg
=
287 _mesa_lookup_shader_program_err(ctx
, program
,
288 "glProgramUniform1f");
289 _mesa_uniform(location
, 1, &v0
, ctx
, shProg
, GLSL_TYPE_FLOAT
, 1);
293 _mesa_ProgramUniform2f(GLuint program
, GLint location
, GLfloat v0
, GLfloat v1
)
295 GET_CURRENT_CONTEXT(ctx
);
297 struct gl_shader_program
*shProg
;
300 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform2f");
301 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_FLOAT
, 2);
305 _mesa_ProgramUniform3f(GLuint program
, GLint location
, GLfloat v0
, GLfloat v1
,
308 GET_CURRENT_CONTEXT(ctx
);
310 struct gl_shader_program
*shProg
;
314 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform3f");
315 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_FLOAT
, 3);
319 _mesa_ProgramUniform4f(GLuint program
, GLint location
, GLfloat v0
, GLfloat v1
,
320 GLfloat v2
, GLfloat v3
)
322 GET_CURRENT_CONTEXT(ctx
);
324 struct gl_shader_program
*shProg
;
329 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform4f");
330 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_FLOAT
, 4);
334 _mesa_ProgramUniform1i(GLuint program
, GLint location
, GLint v0
)
336 GET_CURRENT_CONTEXT(ctx
);
337 struct gl_shader_program
*shProg
=
338 _mesa_lookup_shader_program_err(ctx
, program
,
339 "glProgramUniform1i");
340 _mesa_uniform(location
, 1, &v0
, ctx
, shProg
, GLSL_TYPE_INT
, 1);
344 _mesa_ProgramUniform2i(GLuint program
, GLint location
, GLint v0
, GLint v1
)
346 GET_CURRENT_CONTEXT(ctx
);
348 struct gl_shader_program
*shProg
;
351 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform2i");
352 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_INT
, 2);
356 _mesa_ProgramUniform3i(GLuint program
, GLint location
, GLint v0
, GLint v1
,
359 GET_CURRENT_CONTEXT(ctx
);
361 struct gl_shader_program
*shProg
;
365 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform3i");
366 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_INT
, 3);
370 _mesa_ProgramUniform4i(GLuint program
, GLint location
, GLint v0
, GLint v1
,
373 GET_CURRENT_CONTEXT(ctx
);
375 struct gl_shader_program
*shProg
;
380 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform4i");
381 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_INT
, 4);
385 _mesa_ProgramUniform1fv(GLuint program
, GLint location
, GLsizei count
,
386 const GLfloat
* value
)
388 GET_CURRENT_CONTEXT(ctx
);
389 struct gl_shader_program
*shProg
=
390 _mesa_lookup_shader_program_err(ctx
, program
,
391 "glProgramUniform1fv");
392 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_FLOAT
, 1);
396 _mesa_ProgramUniform2fv(GLuint program
, GLint location
, GLsizei count
,
397 const GLfloat
* value
)
399 GET_CURRENT_CONTEXT(ctx
);
400 struct gl_shader_program
*shProg
=
401 _mesa_lookup_shader_program_err(ctx
, program
,
402 "glProgramUniform2fv");
403 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_FLOAT
, 2);
407 _mesa_ProgramUniform3fv(GLuint program
, GLint location
, GLsizei count
,
408 const GLfloat
* value
)
410 GET_CURRENT_CONTEXT(ctx
);
411 struct gl_shader_program
*shProg
=
412 _mesa_lookup_shader_program_err(ctx
, program
,
413 "glProgramUniform3fv");
414 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_FLOAT
, 3);
418 _mesa_ProgramUniform4fv(GLuint program
, GLint location
, GLsizei count
,
419 const GLfloat
* value
)
421 GET_CURRENT_CONTEXT(ctx
);
422 struct gl_shader_program
*shProg
=
423 _mesa_lookup_shader_program_err(ctx
, program
,
424 "glProgramUniform4fv");
425 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_FLOAT
, 4);
429 _mesa_ProgramUniform1iv(GLuint program
, GLint location
, GLsizei count
,
432 GET_CURRENT_CONTEXT(ctx
);
433 struct gl_shader_program
*shProg
=
434 _mesa_lookup_shader_program_err(ctx
, program
,
435 "glProgramUniform1iv");
436 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_INT
, 1);
440 _mesa_ProgramUniform2iv(GLuint program
, GLint location
, GLsizei count
,
443 GET_CURRENT_CONTEXT(ctx
);
444 struct gl_shader_program
*shProg
=
445 _mesa_lookup_shader_program_err(ctx
, program
,
446 "glProgramUniform2iv");
447 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_INT
, 2);
451 _mesa_ProgramUniform3iv(GLuint program
, GLint location
, GLsizei count
,
454 GET_CURRENT_CONTEXT(ctx
);
455 struct gl_shader_program
*shProg
=
456 _mesa_lookup_shader_program_err(ctx
, program
,
457 "glProgramUniform3iv");
458 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_INT
, 3);
462 _mesa_ProgramUniform4iv(GLuint program
, GLint location
, GLsizei count
,
465 GET_CURRENT_CONTEXT(ctx
);
466 struct gl_shader_program
*shProg
=
467 _mesa_lookup_shader_program_err(ctx
, program
,
468 "glProgramUniform4iv");
469 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_INT
, 4);
473 /** OpenGL 3.0 GLuint-valued functions **/
475 _mesa_Uniform1ui(GLint location
, GLuint v0
)
477 GET_CURRENT_CONTEXT(ctx
);
478 _mesa_uniform(location
, 1, &v0
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT
, 1);
482 _mesa_Uniform2ui(GLint location
, GLuint v0
, GLuint v1
)
484 GET_CURRENT_CONTEXT(ctx
);
488 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT
, 2);
492 _mesa_Uniform3ui(GLint location
, GLuint v0
, GLuint v1
, GLuint v2
)
494 GET_CURRENT_CONTEXT(ctx
);
499 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT
, 3);
503 _mesa_Uniform4ui(GLint location
, GLuint v0
, GLuint v1
, GLuint v2
, GLuint v3
)
505 GET_CURRENT_CONTEXT(ctx
);
511 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT
, 4);
515 _mesa_Uniform1uiv(GLint location
, GLsizei count
, const GLuint
*value
)
517 GET_CURRENT_CONTEXT(ctx
);
518 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT
, 1);
522 _mesa_Uniform2uiv(GLint location
, GLsizei count
, const GLuint
*value
)
524 GET_CURRENT_CONTEXT(ctx
);
525 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT
, 2);
529 _mesa_Uniform3uiv(GLint location
, GLsizei count
, const GLuint
*value
)
531 GET_CURRENT_CONTEXT(ctx
);
532 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT
, 3);
536 _mesa_Uniform4uiv(GLint location
, GLsizei count
, const GLuint
*value
)
538 GET_CURRENT_CONTEXT(ctx
);
539 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT
, 4);
545 _mesa_UniformMatrix2fv(GLint location
, GLsizei count
, GLboolean transpose
,
546 const GLfloat
* value
)
548 GET_CURRENT_CONTEXT(ctx
);
549 _mesa_uniform_matrix(location
, count
, transpose
, value
,
550 ctx
, ctx
->_Shader
->ActiveProgram
, 2, 2, GLSL_TYPE_FLOAT
);
554 _mesa_UniformMatrix3fv(GLint location
, GLsizei count
, GLboolean transpose
,
555 const GLfloat
* value
)
557 GET_CURRENT_CONTEXT(ctx
);
558 _mesa_uniform_matrix(location
, count
, transpose
, value
,
559 ctx
, ctx
->_Shader
->ActiveProgram
, 3, 3, GLSL_TYPE_FLOAT
);
563 _mesa_UniformMatrix4fv(GLint location
, GLsizei count
, GLboolean transpose
,
564 const GLfloat
* value
)
566 GET_CURRENT_CONTEXT(ctx
);
567 _mesa_uniform_matrix(location
, count
, transpose
, value
,
568 ctx
, ctx
->_Shader
->ActiveProgram
, 4, 4, GLSL_TYPE_FLOAT
);
571 /** Same as above with direct state access **/
574 _mesa_ProgramUniform1ui(GLuint program
, GLint location
, GLuint v0
)
576 GET_CURRENT_CONTEXT(ctx
);
577 struct gl_shader_program
*shProg
=
578 _mesa_lookup_shader_program_err(ctx
, program
,
579 "glProgramUniform1ui");
580 _mesa_uniform(location
, 1, &v0
, ctx
, shProg
, GLSL_TYPE_UINT
, 1);
584 _mesa_ProgramUniform2ui(GLuint program
, GLint location
, GLuint v0
, GLuint v1
)
586 GET_CURRENT_CONTEXT(ctx
);
588 struct gl_shader_program
*shProg
;
591 shProg
= _mesa_lookup_shader_program_err(ctx
, program
,
592 "glProgramUniform2ui");
593 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_UINT
, 2);
597 _mesa_ProgramUniform3ui(GLuint program
, GLint location
, GLuint v0
, GLuint v1
,
600 GET_CURRENT_CONTEXT(ctx
);
602 struct gl_shader_program
*shProg
;
606 shProg
= _mesa_lookup_shader_program_err(ctx
, program
,
607 "glProgramUniform3ui");
608 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_UINT
, 3);
612 _mesa_ProgramUniform4ui(GLuint program
, GLint location
, GLuint v0
, GLuint v1
,
613 GLuint v2
, GLuint v3
)
615 GET_CURRENT_CONTEXT(ctx
);
617 struct gl_shader_program
*shProg
;
622 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform4ui");
623 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_UINT
, 4);
627 _mesa_ProgramUniform1uiv(GLuint program
, GLint location
, GLsizei count
,
630 GET_CURRENT_CONTEXT(ctx
);
631 struct gl_shader_program
*shProg
=
632 _mesa_lookup_shader_program_err(ctx
, program
,
633 "glProgramUniform1uiv");
634 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_UINT
, 1);
638 _mesa_ProgramUniform2uiv(GLuint program
, GLint location
, GLsizei count
,
641 GET_CURRENT_CONTEXT(ctx
);
642 struct gl_shader_program
*shProg
=
643 _mesa_lookup_shader_program_err(ctx
, program
,
644 "glProgramUniform2uiv");
645 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_UINT
, 2);
649 _mesa_ProgramUniform3uiv(GLuint program
, GLint location
, GLsizei count
,
652 GET_CURRENT_CONTEXT(ctx
);
653 struct gl_shader_program
*shProg
=
654 _mesa_lookup_shader_program_err(ctx
, program
,
655 "glProgramUniform3uiv");
656 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_UINT
, 3);
660 _mesa_ProgramUniform4uiv(GLuint program
, GLint location
, GLsizei count
,
663 GET_CURRENT_CONTEXT(ctx
);
664 struct gl_shader_program
*shProg
=
665 _mesa_lookup_shader_program_err(ctx
, program
,
666 "glProgramUniform4uiv");
667 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_UINT
, 4);
673 _mesa_ProgramUniformMatrix2fv(GLuint program
, GLint location
, GLsizei count
,
674 GLboolean transpose
, const GLfloat
* value
)
676 GET_CURRENT_CONTEXT(ctx
);
677 struct gl_shader_program
*shProg
=
678 _mesa_lookup_shader_program_err(ctx
, program
,
679 "glProgramUniformMatrix2fv");
680 _mesa_uniform_matrix(location
, count
, transpose
, value
, ctx
, shProg
, 2, 2, GLSL_TYPE_FLOAT
);
684 _mesa_ProgramUniformMatrix3fv(GLuint program
, GLint location
, GLsizei count
,
685 GLboolean transpose
, const GLfloat
* value
)
687 GET_CURRENT_CONTEXT(ctx
);
688 struct gl_shader_program
*shProg
=
689 _mesa_lookup_shader_program_err(ctx
, program
,
690 "glProgramUniformMatrix3fv");
691 _mesa_uniform_matrix(location
, count
, transpose
, value
, ctx
, shProg
, 3, 3, GLSL_TYPE_FLOAT
);
695 _mesa_ProgramUniformMatrix4fv(GLuint program
, GLint location
, GLsizei count
,
696 GLboolean transpose
, const GLfloat
* value
)
698 GET_CURRENT_CONTEXT(ctx
);
699 struct gl_shader_program
*shProg
=
700 _mesa_lookup_shader_program_err(ctx
, program
,
701 "glProgramUniformMatrix4fv");
702 _mesa_uniform_matrix(location
, count
, transpose
, value
, ctx
, shProg
, 4, 4, GLSL_TYPE_FLOAT
);
707 * Non-square UniformMatrix are OpenGL 2.1
710 _mesa_UniformMatrix2x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
711 const GLfloat
*value
)
713 GET_CURRENT_CONTEXT(ctx
);
714 _mesa_uniform_matrix(location
, count
, transpose
, value
,
715 ctx
, ctx
->_Shader
->ActiveProgram
, 2, 3, GLSL_TYPE_FLOAT
);
719 _mesa_UniformMatrix3x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
720 const GLfloat
*value
)
722 GET_CURRENT_CONTEXT(ctx
);
723 _mesa_uniform_matrix(location
, count
, transpose
, value
,
724 ctx
, ctx
->_Shader
->ActiveProgram
, 3, 2, GLSL_TYPE_FLOAT
);
728 _mesa_UniformMatrix2x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
729 const GLfloat
*value
)
731 GET_CURRENT_CONTEXT(ctx
);
732 _mesa_uniform_matrix(location
, count
, transpose
, value
,
733 ctx
, ctx
->_Shader
->ActiveProgram
, 2, 4, GLSL_TYPE_FLOAT
);
737 _mesa_UniformMatrix4x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
738 const GLfloat
*value
)
740 GET_CURRENT_CONTEXT(ctx
);
741 _mesa_uniform_matrix(location
, count
, transpose
, value
,
742 ctx
, ctx
->_Shader
->ActiveProgram
, 4, 2, GLSL_TYPE_FLOAT
);
746 _mesa_UniformMatrix3x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
747 const GLfloat
*value
)
749 GET_CURRENT_CONTEXT(ctx
);
750 _mesa_uniform_matrix(location
, count
, transpose
, value
,
751 ctx
, ctx
->_Shader
->ActiveProgram
, 3, 4, GLSL_TYPE_FLOAT
);
755 _mesa_UniformMatrix4x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
756 const GLfloat
*value
)
758 GET_CURRENT_CONTEXT(ctx
);
759 _mesa_uniform_matrix(location
, count
, transpose
, value
,
760 ctx
, ctx
->_Shader
->ActiveProgram
, 4, 3, GLSL_TYPE_FLOAT
);
763 /** Same as above with direct state access **/
766 _mesa_ProgramUniformMatrix2x3fv(GLuint program
, GLint location
, GLsizei count
,
767 GLboolean transpose
, const GLfloat
* value
)
769 GET_CURRENT_CONTEXT(ctx
);
770 struct gl_shader_program
*shProg
=
771 _mesa_lookup_shader_program_err(ctx
, program
,
772 "glProgramUniformMatrix2x3fv");
773 _mesa_uniform_matrix(location
, count
, transpose
, value
, ctx
, shProg
, 2, 3, GLSL_TYPE_FLOAT
);
777 _mesa_ProgramUniformMatrix3x2fv(GLuint program
, GLint location
, GLsizei count
,
778 GLboolean transpose
, const GLfloat
* value
)
780 GET_CURRENT_CONTEXT(ctx
);
781 struct gl_shader_program
*shProg
=
782 _mesa_lookup_shader_program_err(ctx
, program
,
783 "glProgramUniformMatrix3x2fv");
784 _mesa_uniform_matrix(location
, count
, transpose
, value
, ctx
, shProg
, 3, 2, GLSL_TYPE_FLOAT
);
788 _mesa_ProgramUniformMatrix2x4fv(GLuint program
, GLint location
, GLsizei count
,
789 GLboolean transpose
, const GLfloat
* value
)
791 GET_CURRENT_CONTEXT(ctx
);
792 struct gl_shader_program
*shProg
=
793 _mesa_lookup_shader_program_err(ctx
, program
,
794 "glProgramUniformMatrix2x4fv");
795 _mesa_uniform_matrix(location
, count
, transpose
, value
, ctx
, shProg
, 2, 4, GLSL_TYPE_FLOAT
);
799 _mesa_ProgramUniformMatrix4x2fv(GLuint program
, GLint location
, GLsizei count
,
800 GLboolean transpose
, const GLfloat
* value
)
802 GET_CURRENT_CONTEXT(ctx
);
803 struct gl_shader_program
*shProg
=
804 _mesa_lookup_shader_program_err(ctx
, program
,
805 "glProgramUniformMatrix4x2fv");
806 _mesa_uniform_matrix(location
, count
, transpose
, value
, ctx
, shProg
, 4, 2, GLSL_TYPE_FLOAT
);
810 _mesa_ProgramUniformMatrix3x4fv(GLuint program
, GLint location
, GLsizei count
,
811 GLboolean transpose
, const GLfloat
* value
)
813 GET_CURRENT_CONTEXT(ctx
);
814 struct gl_shader_program
*shProg
=
815 _mesa_lookup_shader_program_err(ctx
, program
,
816 "glProgramUniformMatrix3x4fv");
817 _mesa_uniform_matrix(location
, count
, transpose
, value
, ctx
, shProg
, 3, 4, GLSL_TYPE_FLOAT
);
821 _mesa_ProgramUniformMatrix4x3fv(GLuint program
, GLint location
, GLsizei count
,
822 GLboolean transpose
, const GLfloat
* value
)
824 GET_CURRENT_CONTEXT(ctx
);
825 struct gl_shader_program
*shProg
=
826 _mesa_lookup_shader_program_err(ctx
, program
,
827 "glProgramUniformMatrix4x3fv");
828 _mesa_uniform_matrix(location
, count
, transpose
, value
, ctx
, shProg
, 4, 3, GLSL_TYPE_FLOAT
);
833 _mesa_GetnUniformfvARB(GLuint program
, GLint location
,
834 GLsizei bufSize
, GLfloat
*params
)
836 GET_CURRENT_CONTEXT(ctx
);
837 _mesa_get_uniform(ctx
, program
, location
, bufSize
, GLSL_TYPE_FLOAT
, params
);
841 _mesa_GetUniformfv(GLuint program
, GLint location
, GLfloat
*params
)
843 _mesa_GetnUniformfvARB(program
, location
, INT_MAX
, params
);
848 _mesa_GetnUniformivARB(GLuint program
, GLint location
,
849 GLsizei bufSize
, GLint
*params
)
851 GET_CURRENT_CONTEXT(ctx
);
852 _mesa_get_uniform(ctx
, program
, location
, bufSize
, GLSL_TYPE_INT
, params
);
856 _mesa_GetUniformiv(GLuint program
, GLint location
, GLint
*params
)
858 _mesa_GetnUniformivARB(program
, location
, INT_MAX
, params
);
864 _mesa_GetnUniformuivARB(GLuint program
, GLint location
,
865 GLsizei bufSize
, GLuint
*params
)
867 GET_CURRENT_CONTEXT(ctx
);
868 _mesa_get_uniform(ctx
, program
, location
, bufSize
, GLSL_TYPE_UINT
, params
);
872 _mesa_GetUniformuiv(GLuint program
, GLint location
, GLuint
*params
)
874 _mesa_GetnUniformuivARB(program
, location
, INT_MAX
, params
);
880 _mesa_GetnUniformdvARB(GLuint program
, GLint location
,
881 GLsizei bufSize
, GLdouble
*params
)
883 GET_CURRENT_CONTEXT(ctx
);
885 _mesa_get_uniform(ctx
, program
, location
, bufSize
, GLSL_TYPE_DOUBLE
, params
);
889 _mesa_GetUniformdv(GLuint program
, GLint location
, GLdouble
*params
)
891 _mesa_GetnUniformdvARB(program
, location
, INT_MAX
, params
);
895 _mesa_GetnUniformi64vARB(GLuint program
, GLint location
,
896 GLsizei bufSize
, GLint64
*params
)
898 GET_CURRENT_CONTEXT(ctx
);
899 _mesa_get_uniform(ctx
, program
, location
, bufSize
, GLSL_TYPE_INT64
, params
);
902 _mesa_GetUniformi64vARB(GLuint program
, GLint location
, GLint64
*params
)
904 _mesa_GetnUniformi64vARB(program
, location
, INT_MAX
, params
);
908 _mesa_GetnUniformui64vARB(GLuint program
, GLint location
,
909 GLsizei bufSize
, GLuint64
*params
)
911 GET_CURRENT_CONTEXT(ctx
);
912 _mesa_get_uniform(ctx
, program
, location
, bufSize
, GLSL_TYPE_UINT64
, params
);
916 _mesa_GetUniformui64vARB(GLuint program
, GLint location
, GLuint64
*params
)
918 _mesa_GetnUniformui64vARB(program
, location
, INT_MAX
, params
);
923 _mesa_GetUniformLocation(GLuint programObj
, const GLcharARB
*name
)
925 struct gl_shader_program
*shProg
;
927 GET_CURRENT_CONTEXT(ctx
);
929 shProg
= _mesa_lookup_shader_program_err(ctx
, programObj
,
930 "glGetUniformLocation");
934 /* Page 80 (page 94 of the PDF) of the OpenGL 2.1 spec says:
936 * "If program has not been successfully linked, the error
937 * INVALID_OPERATION is generated."
939 if (shProg
->data
->LinkStatus
== linking_failure
) {
940 _mesa_error(ctx
, GL_INVALID_OPERATION
,
941 "glGetUniformLocation(program not linked)");
945 return _mesa_program_resource_location(shProg
, GL_UNIFORM
, name
);
949 _mesa_GetUniformBlockIndex(GLuint program
,
950 const GLchar
*uniformBlockName
)
952 GET_CURRENT_CONTEXT(ctx
);
953 struct gl_shader_program
*shProg
;
955 if (!ctx
->Extensions
.ARB_uniform_buffer_object
) {
956 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glGetUniformBlockIndex");
957 return GL_INVALID_INDEX
;
960 shProg
= _mesa_lookup_shader_program_err(ctx
, program
,
961 "glGetUniformBlockIndex");
963 return GL_INVALID_INDEX
;
965 struct gl_program_resource
*res
=
966 _mesa_program_resource_find_name(shProg
, GL_UNIFORM_BLOCK
,
967 uniformBlockName
, NULL
);
969 return GL_INVALID_INDEX
;
971 return _mesa_program_resource_index(shProg
, res
);
975 _mesa_GetUniformIndices(GLuint program
,
976 GLsizei uniformCount
,
977 const GLchar
* const *uniformNames
,
978 GLuint
*uniformIndices
)
980 GET_CURRENT_CONTEXT(ctx
);
982 struct gl_shader_program
*shProg
;
984 if (!ctx
->Extensions
.ARB_uniform_buffer_object
) {
985 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glGetUniformIndices");
989 shProg
= _mesa_lookup_shader_program_err(ctx
, program
,
990 "glGetUniformIndices");
994 if (uniformCount
< 0) {
995 _mesa_error(ctx
, GL_INVALID_VALUE
,
996 "glGetUniformIndices(uniformCount < 0)");
1000 for (i
= 0; i
< uniformCount
; i
++) {
1001 struct gl_program_resource
*res
=
1002 _mesa_program_resource_find_name(shProg
, GL_UNIFORM
, uniformNames
[i
],
1004 uniformIndices
[i
] = _mesa_program_resource_index(shProg
, res
);
1009 _mesa_UniformBlockBinding(GLuint program
,
1010 GLuint uniformBlockIndex
,
1011 GLuint uniformBlockBinding
)
1013 GET_CURRENT_CONTEXT(ctx
);
1014 struct gl_shader_program
*shProg
;
1016 if (!ctx
->Extensions
.ARB_uniform_buffer_object
) {
1017 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glUniformBlockBinding");
1021 shProg
= _mesa_lookup_shader_program_err(ctx
, program
,
1022 "glUniformBlockBinding");
1026 if (uniformBlockIndex
>= shProg
->data
->NumUniformBlocks
) {
1027 _mesa_error(ctx
, GL_INVALID_VALUE
,
1028 "glUniformBlockBinding(block index %u >= %u)",
1029 uniformBlockIndex
, shProg
->data
->NumUniformBlocks
);
1033 if (uniformBlockBinding
>= ctx
->Const
.MaxUniformBufferBindings
) {
1034 _mesa_error(ctx
, GL_INVALID_VALUE
,
1035 "glUniformBlockBinding(block binding %u >= %u)",
1036 uniformBlockBinding
, ctx
->Const
.MaxUniformBufferBindings
);
1040 if (shProg
->data
->UniformBlocks
[uniformBlockIndex
].Binding
!=
1041 uniformBlockBinding
) {
1043 FLUSH_VERTICES(ctx
, 0);
1044 ctx
->NewDriverState
|= ctx
->DriverFlags
.NewUniformBuffer
;
1046 shProg
->data
->UniformBlocks
[uniformBlockIndex
].Binding
=
1047 uniformBlockBinding
;
1052 _mesa_ShaderStorageBlockBinding(GLuint program
,
1053 GLuint shaderStorageBlockIndex
,
1054 GLuint shaderStorageBlockBinding
)
1056 GET_CURRENT_CONTEXT(ctx
);
1057 struct gl_shader_program
*shProg
;
1059 if (!ctx
->Extensions
.ARB_shader_storage_buffer_object
) {
1060 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glShaderStorageBlockBinding");
1064 shProg
= _mesa_lookup_shader_program_err(ctx
, program
,
1065 "glShaderStorageBlockBinding");
1069 if (shaderStorageBlockIndex
>= shProg
->data
->NumShaderStorageBlocks
) {
1070 _mesa_error(ctx
, GL_INVALID_VALUE
,
1071 "glShaderStorageBlockBinding(block index %u >= %u)",
1072 shaderStorageBlockIndex
,
1073 shProg
->data
->NumShaderStorageBlocks
);
1077 if (shaderStorageBlockBinding
>= ctx
->Const
.MaxShaderStorageBufferBindings
) {
1078 _mesa_error(ctx
, GL_INVALID_VALUE
,
1079 "glShaderStorageBlockBinding(block binding %u >= %u)",
1080 shaderStorageBlockBinding
,
1081 ctx
->Const
.MaxShaderStorageBufferBindings
);
1085 if (shProg
->data
->ShaderStorageBlocks
[shaderStorageBlockIndex
].Binding
!=
1086 shaderStorageBlockBinding
) {
1088 FLUSH_VERTICES(ctx
, 0);
1089 ctx
->NewDriverState
|= ctx
->DriverFlags
.NewShaderStorageBuffer
;
1091 shProg
->data
->ShaderStorageBlocks
[shaderStorageBlockIndex
].Binding
=
1092 shaderStorageBlockBinding
;
1097 * Generic program resource property query.
1100 mesa_bufferiv(struct gl_shader_program
*shProg
, GLenum type
,
1101 GLuint index
, GLenum pname
, GLint
*params
, const char *caller
)
1103 GET_CURRENT_CONTEXT(ctx
);
1104 struct gl_program_resource
*res
=
1105 _mesa_program_resource_find_index(shProg
, type
, index
);
1108 _mesa_error(ctx
, GL_INVALID_VALUE
, "%s(bufferindex %d)", caller
, index
);
1113 case GL_UNIFORM_BLOCK_BINDING
:
1114 case GL_ATOMIC_COUNTER_BUFFER_BINDING
:
1115 _mesa_program_resource_prop(shProg
, res
, index
, GL_BUFFER_BINDING
,
1118 case GL_UNIFORM_BLOCK_DATA_SIZE
:
1119 case GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE
:
1120 _mesa_program_resource_prop(shProg
, res
, index
, GL_BUFFER_DATA_SIZE
,
1123 case GL_UNIFORM_BLOCK_NAME_LENGTH
:
1124 _mesa_program_resource_prop(shProg
, res
, index
, GL_NAME_LENGTH
,
1127 case GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS
:
1128 case GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS
:
1129 _mesa_program_resource_prop(shProg
, res
, index
, GL_NUM_ACTIVE_VARIABLES
,
1132 case GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES
:
1133 case GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES
:
1134 _mesa_program_resource_prop(shProg
, res
, index
, GL_ACTIVE_VARIABLES
,
1137 case GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER
:
1138 case GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER
:
1139 _mesa_program_resource_prop(shProg
, res
, index
,
1140 GL_REFERENCED_BY_VERTEX_SHADER
, params
,
1144 case GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER
:
1145 case GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER
:
1146 _mesa_program_resource_prop(shProg
, res
, index
,
1147 GL_REFERENCED_BY_TESS_CONTROL_SHADER
, params
,
1151 case GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER
:
1152 case GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER
:
1153 _mesa_program_resource_prop(shProg
, res
, index
,
1154 GL_REFERENCED_BY_TESS_EVALUATION_SHADER
, params
,
1158 case GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER
:
1159 case GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER
:
1160 _mesa_program_resource_prop(shProg
, res
, index
,
1161 GL_REFERENCED_BY_GEOMETRY_SHADER
, params
,
1164 case GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER
:
1165 case GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER
:
1166 _mesa_program_resource_prop(shProg
, res
, index
,
1167 GL_REFERENCED_BY_FRAGMENT_SHADER
, params
,
1170 case GL_UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER
:
1171 case GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER
:
1172 _mesa_program_resource_prop(shProg
, res
, index
,
1173 GL_REFERENCED_BY_COMPUTE_SHADER
, params
,
1177 _mesa_error(ctx
, GL_INVALID_ENUM
,
1178 "%s(pname 0x%x (%s))", caller
, pname
,
1179 _mesa_enum_to_string(pname
));
1186 _mesa_GetActiveUniformBlockiv(GLuint program
,
1187 GLuint uniformBlockIndex
,
1191 GET_CURRENT_CONTEXT(ctx
);
1192 struct gl_shader_program
*shProg
;
1194 if (!ctx
->Extensions
.ARB_uniform_buffer_object
) {
1195 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glGetActiveUniformBlockiv");
1199 shProg
= _mesa_lookup_shader_program_err(ctx
, program
,
1200 "glGetActiveUniformBlockiv");
1204 mesa_bufferiv(shProg
, GL_UNIFORM_BLOCK
, uniformBlockIndex
, pname
, params
,
1205 "glGetActiveUniformBlockiv");
1209 _mesa_GetActiveUniformBlockName(GLuint program
,
1210 GLuint uniformBlockIndex
,
1213 GLchar
*uniformBlockName
)
1215 GET_CURRENT_CONTEXT(ctx
);
1216 struct gl_shader_program
*shProg
;
1218 if (!ctx
->Extensions
.ARB_uniform_buffer_object
) {
1219 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glGetActiveUniformBlockiv");
1224 _mesa_error(ctx
, GL_INVALID_VALUE
,
1225 "glGetActiveUniformBlockName(bufSize %d < 0)",
1230 shProg
= _mesa_lookup_shader_program_err(ctx
, program
,
1231 "glGetActiveUniformBlockiv");
1235 if (uniformBlockName
)
1236 _mesa_get_program_resource_name(shProg
, GL_UNIFORM_BLOCK
,
1237 uniformBlockIndex
, bufSize
, length
,
1239 "glGetActiveUniformBlockName");
1243 _mesa_GetActiveUniformName(GLuint program
, GLuint uniformIndex
,
1244 GLsizei bufSize
, GLsizei
*length
,
1245 GLchar
*uniformName
)
1247 GET_CURRENT_CONTEXT(ctx
);
1248 struct gl_shader_program
*shProg
;
1250 if (!ctx
->Extensions
.ARB_uniform_buffer_object
) {
1251 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glGetActiveUniformName");
1256 _mesa_error(ctx
, GL_INVALID_VALUE
,
1257 "glGetActiveUniformName(bufSize %d < 0)",
1262 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glGetActiveUniformName");
1267 _mesa_get_program_resource_name(shProg
, GL_UNIFORM
, uniformIndex
, bufSize
,
1268 length
, uniformName
, "glGetActiveUniformName");
1272 _mesa_GetActiveAtomicCounterBufferiv(GLuint program
, GLuint bufferIndex
,
1273 GLenum pname
, GLint
*params
)
1275 GET_CURRENT_CONTEXT(ctx
);
1276 struct gl_shader_program
*shProg
;
1278 if (!ctx
->Extensions
.ARB_shader_atomic_counters
) {
1279 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1280 "glGetActiveAtomicCounterBufferiv");
1284 shProg
= _mesa_lookup_shader_program_err(ctx
, program
,
1285 "glGetActiveAtomicCounterBufferiv");
1289 mesa_bufferiv(shProg
, GL_ATOMIC_COUNTER_BUFFER
, bufferIndex
, pname
, params
,
1290 "glGetActiveAtomicCounterBufferiv");
1294 _mesa_Uniform1d(GLint location
, GLdouble v0
)
1296 GET_CURRENT_CONTEXT(ctx
);
1297 _mesa_uniform(location
, 1, &v0
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_DOUBLE
, 1);
1301 _mesa_Uniform2d(GLint location
, GLdouble v0
, GLdouble v1
)
1303 GET_CURRENT_CONTEXT(ctx
);
1307 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_DOUBLE
, 2);
1311 _mesa_Uniform3d(GLint location
, GLdouble v0
, GLdouble v1
, GLdouble v2
)
1313 GET_CURRENT_CONTEXT(ctx
);
1318 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_DOUBLE
, 3);
1322 _mesa_Uniform4d(GLint location
, GLdouble v0
, GLdouble v1
, GLdouble v2
,
1325 GET_CURRENT_CONTEXT(ctx
);
1331 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_DOUBLE
, 4);
1335 _mesa_Uniform1dv(GLint location
, GLsizei count
, const GLdouble
* value
)
1337 GET_CURRENT_CONTEXT(ctx
);
1338 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_DOUBLE
, 1);
1342 _mesa_Uniform2dv(GLint location
, GLsizei count
, const GLdouble
* value
)
1344 GET_CURRENT_CONTEXT(ctx
);
1345 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_DOUBLE
, 2);
1349 _mesa_Uniform3dv(GLint location
, GLsizei count
, const GLdouble
* value
)
1351 GET_CURRENT_CONTEXT(ctx
);
1352 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_DOUBLE
, 3);
1356 _mesa_Uniform4dv(GLint location
, GLsizei count
, const GLdouble
* value
)
1358 GET_CURRENT_CONTEXT(ctx
);
1359 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_DOUBLE
, 4);
1363 _mesa_UniformMatrix2dv(GLint location
, GLsizei count
, GLboolean transpose
,
1364 const GLdouble
* value
)
1366 GET_CURRENT_CONTEXT(ctx
);
1367 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1368 ctx
, ctx
->_Shader
->ActiveProgram
, 2, 2, GLSL_TYPE_DOUBLE
);
1372 _mesa_UniformMatrix3dv(GLint location
, GLsizei count
, GLboolean transpose
,
1373 const GLdouble
* value
)
1375 GET_CURRENT_CONTEXT(ctx
);
1376 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1377 ctx
, ctx
->_Shader
->ActiveProgram
, 3, 3, GLSL_TYPE_DOUBLE
);
1381 _mesa_UniformMatrix4dv(GLint location
, GLsizei count
, GLboolean transpose
,
1382 const GLdouble
* value
)
1384 GET_CURRENT_CONTEXT(ctx
);
1385 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1386 ctx
, ctx
->_Shader
->ActiveProgram
, 4, 4, GLSL_TYPE_DOUBLE
);
1390 _mesa_UniformMatrix2x3dv(GLint location
, GLsizei count
, GLboolean transpose
,
1391 const GLdouble
*value
)
1393 GET_CURRENT_CONTEXT(ctx
);
1394 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1395 ctx
, ctx
->_Shader
->ActiveProgram
, 2, 3, GLSL_TYPE_DOUBLE
);
1399 _mesa_UniformMatrix3x2dv(GLint location
, GLsizei count
, GLboolean transpose
,
1400 const GLdouble
*value
)
1402 GET_CURRENT_CONTEXT(ctx
);
1403 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1404 ctx
, ctx
->_Shader
->ActiveProgram
, 3, 2, GLSL_TYPE_DOUBLE
);
1408 _mesa_UniformMatrix2x4dv(GLint location
, GLsizei count
, GLboolean transpose
,
1409 const GLdouble
*value
)
1411 GET_CURRENT_CONTEXT(ctx
);
1412 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1413 ctx
, ctx
->_Shader
->ActiveProgram
, 2, 4, GLSL_TYPE_DOUBLE
);
1417 _mesa_UniformMatrix4x2dv(GLint location
, GLsizei count
, GLboolean transpose
,
1418 const GLdouble
*value
)
1420 GET_CURRENT_CONTEXT(ctx
);
1421 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1422 ctx
, ctx
->_Shader
->ActiveProgram
, 4, 2, GLSL_TYPE_DOUBLE
);
1426 _mesa_UniformMatrix3x4dv(GLint location
, GLsizei count
, GLboolean transpose
,
1427 const GLdouble
*value
)
1429 GET_CURRENT_CONTEXT(ctx
);
1430 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1431 ctx
, ctx
->_Shader
->ActiveProgram
, 3, 4, GLSL_TYPE_DOUBLE
);
1435 _mesa_UniformMatrix4x3dv(GLint location
, GLsizei count
, GLboolean transpose
,
1436 const GLdouble
*value
)
1438 GET_CURRENT_CONTEXT(ctx
);
1439 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1440 ctx
, ctx
->_Shader
->ActiveProgram
, 4, 3, GLSL_TYPE_DOUBLE
);
1444 _mesa_ProgramUniform1d(GLuint program
, GLint location
, GLdouble v0
)
1446 GET_CURRENT_CONTEXT(ctx
);
1447 struct gl_shader_program
*shProg
=
1448 _mesa_lookup_shader_program_err(ctx
, program
,
1449 "glProgramUniform1d");
1450 _mesa_uniform(location
, 1, &v0
, ctx
, shProg
, GLSL_TYPE_DOUBLE
, 1);
1454 _mesa_ProgramUniform2d(GLuint program
, GLint location
, GLdouble v0
, GLdouble v1
)
1456 GET_CURRENT_CONTEXT(ctx
);
1458 struct gl_shader_program
*shProg
;
1461 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform2d");
1462 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_DOUBLE
, 2);
1466 _mesa_ProgramUniform3d(GLuint program
, GLint location
, GLdouble v0
, GLdouble v1
,
1469 GET_CURRENT_CONTEXT(ctx
);
1471 struct gl_shader_program
*shProg
;
1475 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform3d");
1476 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_DOUBLE
, 3);
1480 _mesa_ProgramUniform4d(GLuint program
, GLint location
, GLdouble v0
, GLdouble v1
,
1481 GLdouble v2
, GLdouble v3
)
1483 GET_CURRENT_CONTEXT(ctx
);
1485 struct gl_shader_program
*shProg
;
1490 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform4d");
1491 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_DOUBLE
, 4);
1495 _mesa_ProgramUniform1dv(GLuint program
, GLint location
, GLsizei count
,
1496 const GLdouble
* value
)
1498 GET_CURRENT_CONTEXT(ctx
);
1499 struct gl_shader_program
*shProg
=
1500 _mesa_lookup_shader_program_err(ctx
, program
,
1501 "glProgramUniform1dv");
1502 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_DOUBLE
, 1);
1506 _mesa_ProgramUniform2dv(GLuint program
, GLint location
, GLsizei count
,
1507 const GLdouble
* value
)
1509 GET_CURRENT_CONTEXT(ctx
);
1510 struct gl_shader_program
*shProg
=
1511 _mesa_lookup_shader_program_err(ctx
, program
,
1512 "glProgramUniform2dv");
1513 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_DOUBLE
, 2);
1517 _mesa_ProgramUniform3dv(GLuint program
, GLint location
, GLsizei count
,
1518 const GLdouble
* value
)
1520 GET_CURRENT_CONTEXT(ctx
);
1521 struct gl_shader_program
*shProg
=
1522 _mesa_lookup_shader_program_err(ctx
, program
,
1523 "glProgramUniform3dv");
1524 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_DOUBLE
, 3);
1528 _mesa_ProgramUniform4dv(GLuint program
, GLint location
, GLsizei count
,
1529 const GLdouble
* value
)
1531 GET_CURRENT_CONTEXT(ctx
);
1532 struct gl_shader_program
*shProg
=
1533 _mesa_lookup_shader_program_err(ctx
, program
,
1534 "glProgramUniform4dv");
1535 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_DOUBLE
, 4);
1539 _mesa_ProgramUniformMatrix2dv(GLuint program
, GLint location
, GLsizei count
,
1540 GLboolean transpose
, const GLdouble
* value
)
1542 GET_CURRENT_CONTEXT(ctx
);
1543 struct gl_shader_program
*shProg
=
1544 _mesa_lookup_shader_program_err(ctx
, program
,
1545 "glProgramUniformMatrix2dv");
1546 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1547 ctx
, shProg
, 2, 2, GLSL_TYPE_DOUBLE
);
1551 _mesa_ProgramUniformMatrix3dv(GLuint program
, GLint location
, GLsizei count
,
1552 GLboolean transpose
, const GLdouble
* value
)
1554 GET_CURRENT_CONTEXT(ctx
);
1555 struct gl_shader_program
*shProg
=
1556 _mesa_lookup_shader_program_err(ctx
, program
,
1557 "glProgramUniformMatrix3dv");
1558 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1559 ctx
, shProg
, 3, 3, GLSL_TYPE_DOUBLE
);
1563 _mesa_ProgramUniformMatrix4dv(GLuint program
, GLint location
, GLsizei count
,
1564 GLboolean transpose
, const GLdouble
* value
)
1566 GET_CURRENT_CONTEXT(ctx
);
1567 struct gl_shader_program
*shProg
=
1568 _mesa_lookup_shader_program_err(ctx
, program
,
1569 "glProgramUniformMatrix4dv");
1570 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1571 ctx
, shProg
, 4, 4, GLSL_TYPE_DOUBLE
);
1575 _mesa_ProgramUniformMatrix2x3dv(GLuint program
, GLint location
, GLsizei count
,
1576 GLboolean transpose
, const GLdouble
* value
)
1578 GET_CURRENT_CONTEXT(ctx
);
1579 struct gl_shader_program
*shProg
=
1580 _mesa_lookup_shader_program_err(ctx
, program
,
1581 "glProgramUniformMatrix2x3dv");
1582 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1583 ctx
, shProg
, 2, 3, GLSL_TYPE_DOUBLE
);
1587 _mesa_ProgramUniformMatrix3x2dv(GLuint program
, GLint location
, GLsizei count
,
1588 GLboolean transpose
, const GLdouble
* value
)
1590 GET_CURRENT_CONTEXT(ctx
);
1591 struct gl_shader_program
*shProg
=
1592 _mesa_lookup_shader_program_err(ctx
, program
,
1593 "glProgramUniformMatrix3x2dv");
1594 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1595 ctx
, shProg
, 3, 2, GLSL_TYPE_DOUBLE
);
1599 _mesa_ProgramUniformMatrix2x4dv(GLuint program
, GLint location
, GLsizei count
,
1600 GLboolean transpose
, const GLdouble
* value
)
1602 GET_CURRENT_CONTEXT(ctx
);
1603 struct gl_shader_program
*shProg
=
1604 _mesa_lookup_shader_program_err(ctx
, program
,
1605 "glProgramUniformMatrix2x4dv");
1606 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1607 ctx
, shProg
, 2, 4, GLSL_TYPE_DOUBLE
);
1611 _mesa_ProgramUniformMatrix4x2dv(GLuint program
, GLint location
, GLsizei count
,
1612 GLboolean transpose
, const GLdouble
* value
)
1614 GET_CURRENT_CONTEXT(ctx
);
1615 struct gl_shader_program
*shProg
=
1616 _mesa_lookup_shader_program_err(ctx
, program
,
1617 "glProgramUniformMatrix4x2dv");
1618 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1619 ctx
, shProg
, 4, 2, GLSL_TYPE_DOUBLE
);
1623 _mesa_ProgramUniformMatrix3x4dv(GLuint program
, GLint location
, GLsizei count
,
1624 GLboolean transpose
, const GLdouble
* value
)
1626 GET_CURRENT_CONTEXT(ctx
);
1627 struct gl_shader_program
*shProg
=
1628 _mesa_lookup_shader_program_err(ctx
, program
,
1629 "glProgramUniformMatrix3x4dv");
1630 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1631 ctx
, shProg
, 3, 4, GLSL_TYPE_DOUBLE
);
1635 _mesa_ProgramUniformMatrix4x3dv(GLuint program
, GLint location
, GLsizei count
,
1636 GLboolean transpose
, const GLdouble
* value
)
1638 GET_CURRENT_CONTEXT(ctx
);
1639 struct gl_shader_program
*shProg
=
1640 _mesa_lookup_shader_program_err(ctx
, program
,
1641 "glProgramUniformMatrix4x3dv");
1642 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1643 ctx
, shProg
, 4, 3, GLSL_TYPE_DOUBLE
);
1647 _mesa_Uniform1i64ARB(GLint location
, GLint64 v0
)
1649 GET_CURRENT_CONTEXT(ctx
);
1650 _mesa_uniform(location
, 1, &v0
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT64
, 1);
1654 _mesa_Uniform2i64ARB(GLint location
, GLint64 v0
, GLint64 v1
)
1656 GET_CURRENT_CONTEXT(ctx
);
1660 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT64
, 2);
1664 _mesa_Uniform3i64ARB(GLint location
, GLint64 v0
, GLint64 v1
, GLint64 v2
)
1666 GET_CURRENT_CONTEXT(ctx
);
1671 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT64
, 3);
1675 _mesa_Uniform4i64ARB(GLint location
, GLint64 v0
, GLint64 v1
, GLint64 v2
, GLint64 v3
)
1677 GET_CURRENT_CONTEXT(ctx
);
1683 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT64
, 4);
1687 _mesa_Uniform1i64vARB(GLint location
, GLsizei count
, const GLint64
*value
)
1689 GET_CURRENT_CONTEXT(ctx
);
1690 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT64
, 1);
1694 _mesa_Uniform2i64vARB(GLint location
, GLsizei count
, const GLint64
*value
)
1696 GET_CURRENT_CONTEXT(ctx
);
1697 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT64
, 2);
1701 _mesa_Uniform3i64vARB(GLint location
, GLsizei count
, const GLint64
*value
)
1703 GET_CURRENT_CONTEXT(ctx
);
1704 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT64
, 3);
1708 _mesa_Uniform4i64vARB(GLint location
, GLsizei count
, const GLint64
*value
)
1710 GET_CURRENT_CONTEXT(ctx
);
1711 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT64
, 4);
1715 _mesa_Uniform1ui64ARB(GLint location
, GLuint64 v0
)
1717 GET_CURRENT_CONTEXT(ctx
);
1718 _mesa_uniform(location
, 1, &v0
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT64
, 1);
1722 _mesa_Uniform2ui64ARB(GLint location
, GLuint64 v0
, GLuint64 v1
)
1724 GET_CURRENT_CONTEXT(ctx
);
1728 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT64
, 2);
1732 _mesa_Uniform3ui64ARB(GLint location
, GLuint64 v0
, GLuint64 v1
, GLuint64 v2
)
1734 GET_CURRENT_CONTEXT(ctx
);
1739 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT64
, 3);
1743 _mesa_Uniform4ui64ARB(GLint location
, GLuint64 v0
, GLuint64 v1
, GLuint64 v2
, GLuint64 v3
)
1745 GET_CURRENT_CONTEXT(ctx
);
1751 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT64
, 4);
1755 _mesa_Uniform1ui64vARB(GLint location
, GLsizei count
, const GLuint64
*value
)
1757 GET_CURRENT_CONTEXT(ctx
);
1758 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT64
, 1);
1762 _mesa_Uniform2ui64vARB(GLint location
, GLsizei count
, const GLuint64
*value
)
1764 GET_CURRENT_CONTEXT(ctx
);
1765 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT64
, 2);
1769 _mesa_Uniform3ui64vARB(GLint location
, GLsizei count
, const GLuint64
*value
)
1771 GET_CURRENT_CONTEXT(ctx
);
1772 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT64
, 3);
1776 _mesa_Uniform4ui64vARB(GLint location
, GLsizei count
, const GLuint64
*value
)
1778 GET_CURRENT_CONTEXT(ctx
);
1779 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT64
, 4);
1782 /* DSA entrypoints */
1784 _mesa_ProgramUniform1i64ARB(GLuint program
, GLint location
, GLint64 v0
)
1786 GET_CURRENT_CONTEXT(ctx
);
1787 struct gl_shader_program
*shProg
=
1788 _mesa_lookup_shader_program_err(ctx
, program
,
1789 "glProgramUniform1i64ARB");
1790 _mesa_uniform(location
, 1, &v0
, ctx
, shProg
, GLSL_TYPE_INT64
, 1);
1794 _mesa_ProgramUniform2i64ARB(GLuint program
, GLint location
, GLint64 v0
, GLint64 v1
)
1796 GET_CURRENT_CONTEXT(ctx
);
1797 struct gl_shader_program
*shProg
=
1798 _mesa_lookup_shader_program_err(ctx
, program
,
1799 "glProgramUniform2i64ARB");
1803 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_INT64
, 2);
1807 _mesa_ProgramUniform3i64ARB(GLuint program
, GLint location
, GLint64 v0
, GLint64 v1
, GLint64 v2
)
1809 GET_CURRENT_CONTEXT(ctx
);
1810 struct gl_shader_program
*shProg
=
1811 _mesa_lookup_shader_program_err(ctx
, program
,
1812 "glProgramUniform3i64ARB");
1817 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_INT64
, 3);
1821 _mesa_ProgramUniform4i64ARB(GLuint program
, GLint location
, GLint64 v0
, GLint64 v1
, GLint64 v2
, GLint64 v3
)
1823 GET_CURRENT_CONTEXT(ctx
);
1824 struct gl_shader_program
*shProg
=
1825 _mesa_lookup_shader_program_err(ctx
, program
,
1826 "glProgramUniform4i64ARB");
1832 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_INT64
, 4);
1836 _mesa_ProgramUniform1i64vARB(GLuint program
, GLint location
, GLsizei count
, const GLint64
*value
)
1838 GET_CURRENT_CONTEXT(ctx
);
1839 struct gl_shader_program
*shProg
=
1840 _mesa_lookup_shader_program_err(ctx
, program
,
1841 "glProgramUniform1i64vARB");
1842 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_INT64
, 1);
1846 _mesa_ProgramUniform2i64vARB(GLuint program
, GLint location
, GLsizei count
, const GLint64
*value
)
1848 GET_CURRENT_CONTEXT(ctx
);
1849 struct gl_shader_program
*shProg
=
1850 _mesa_lookup_shader_program_err(ctx
, program
,
1851 "glProgramUniform2i64vARB");
1852 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_INT64
, 2);
1856 _mesa_ProgramUniform3i64vARB(GLuint program
, GLint location
, GLsizei count
, const GLint64
*value
)
1858 GET_CURRENT_CONTEXT(ctx
);
1859 struct gl_shader_program
*shProg
=
1860 _mesa_lookup_shader_program_err(ctx
, program
,
1861 "glProgramUniform3i64vARB");
1862 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_INT64
, 3);
1866 _mesa_ProgramUniform4i64vARB(GLuint program
, GLint location
, GLsizei count
, const GLint64
*value
)
1868 GET_CURRENT_CONTEXT(ctx
);
1869 struct gl_shader_program
*shProg
=
1870 _mesa_lookup_shader_program_err(ctx
, program
,
1871 "glProgramUniform4i64vARB");
1872 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_INT64
, 4);
1876 _mesa_ProgramUniform1ui64ARB(GLuint program
, GLint location
, GLuint64 v0
)
1878 GET_CURRENT_CONTEXT(ctx
);
1879 struct gl_shader_program
*shProg
=
1880 _mesa_lookup_shader_program_err(ctx
, program
,
1881 "glProgramUniform1ui64ARB");
1882 _mesa_uniform(location
, 1, &v0
, ctx
, shProg
, GLSL_TYPE_UINT64
, 1);
1886 _mesa_ProgramUniform2ui64ARB(GLuint program
, GLint location
, GLuint64 v0
, GLuint64 v1
)
1888 GET_CURRENT_CONTEXT(ctx
);
1889 struct gl_shader_program
*shProg
=
1890 _mesa_lookup_shader_program_err(ctx
, program
,
1891 "glProgramUniform2ui64ARB");
1895 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_UINT64
, 2);
1899 _mesa_ProgramUniform3ui64ARB(GLuint program
, GLint location
, GLuint64 v0
, GLuint64 v1
, GLuint64 v2
)
1901 GET_CURRENT_CONTEXT(ctx
);
1902 struct gl_shader_program
*shProg
=
1903 _mesa_lookup_shader_program_err(ctx
, program
,
1904 "glProgramUniform3ui64ARB");
1909 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_UINT64
, 3);
1913 _mesa_ProgramUniform4ui64ARB(GLuint program
, GLint location
, GLuint64 v0
, GLuint64 v1
, GLuint64 v2
, GLuint64 v3
)
1915 GET_CURRENT_CONTEXT(ctx
);
1916 struct gl_shader_program
*shProg
=
1917 _mesa_lookup_shader_program_err(ctx
, program
,
1918 "glProgramUniform4ui64ARB");
1924 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_UINT64
, 4);
1928 _mesa_ProgramUniform1ui64vARB(GLuint program
, GLint location
, GLsizei count
, const GLuint64
*value
)
1930 GET_CURRENT_CONTEXT(ctx
);
1931 struct gl_shader_program
*shProg
=
1932 _mesa_lookup_shader_program_err(ctx
, program
,
1933 "glProgramUniform1ui64vARB");
1934 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_UINT64
, 1);
1938 _mesa_ProgramUniform2ui64vARB(GLuint program
, GLint location
, GLsizei count
, const GLuint64
*value
)
1940 GET_CURRENT_CONTEXT(ctx
);
1941 struct gl_shader_program
*shProg
=
1942 _mesa_lookup_shader_program_err(ctx
, program
,
1943 "glProgramUniform2ui64vARB");
1944 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_UINT64
, 2);
1948 _mesa_ProgramUniform3ui64vARB(GLuint program
, GLint location
, GLsizei count
, const GLuint64
*value
)
1950 GET_CURRENT_CONTEXT(ctx
);
1951 struct gl_shader_program
*shProg
=
1952 _mesa_lookup_shader_program_err(ctx
, program
,
1953 "glProgramUniform3ui64vARB");
1954 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_UINT64
, 3);
1958 _mesa_ProgramUniform4ui64vARB(GLuint program
, GLint location
, GLsizei count
, const GLuint64
*value
)
1960 GET_CURRENT_CONTEXT(ctx
);
1961 struct gl_shader_program
*shProg
=
1962 _mesa_lookup_shader_program_err(ctx
, program
,
1963 "glProgramUniform4ui64vARB");
1964 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_UINT64
, 4);