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 GLbitfield mask
= prog
->SamplersUsed
;
71 struct gl_linked_shader
*shader
=
72 shProg
->_LinkedShaders
[_mesa_program_enum_to_shader_stage(prog
->Target
)];
76 memset(prog
->TexturesUsed
, 0, sizeof(prog
->TexturesUsed
));
78 shProg
->SamplersValidated
= GL_TRUE
;
81 const int s
= u_bit_scan(&mask
);
82 GLuint unit
= prog
->SamplerUnits
[s
];
83 GLuint tgt
= prog
->sh
.SamplerTargets
[s
];
84 assert(unit
< ARRAY_SIZE(prog
->TexturesUsed
));
85 assert(tgt
< NUM_TEXTURE_TARGETS
);
87 /* The types of the samplers associated with a particular texture
88 * unit must be an exact match. Page 74 (page 89 of the PDF) of the
89 * OpenGL 3.3 core spec says:
91 * "It is not allowed to have variables of different sampler
92 * types pointing to the same texture image unit within a program
95 if (prog
->TexturesUsed
[unit
] & ~(1 << tgt
))
96 shProg
->SamplersValidated
= GL_FALSE
;
98 prog
->TexturesUsed
[unit
] |= (1 << tgt
);
103 * Connect a piece of driver storage with a part of a uniform
105 * \param uni The uniform with which the storage will be associated
106 * \param element_stride Byte-stride between array elements.
107 * \sa gl_uniform_driver_storage::element_stride.
108 * \param vector_stride Byte-stride between vectors (in a matrix).
109 * \sa gl_uniform_driver_storage::vector_stride.
110 * \param format Conversion from native format to driver format
111 * required by the driver.
112 * \param data Location to dump the data.
115 _mesa_uniform_attach_driver_storage(struct gl_uniform_storage
*uni
,
116 unsigned element_stride
,
117 unsigned vector_stride
,
118 enum gl_uniform_driver_format format
,
121 uni
->driver_storage
=
122 realloc(uni
->driver_storage
,
123 sizeof(struct gl_uniform_driver_storage
)
124 * (uni
->num_driver_storage
+ 1));
126 uni
->driver_storage
[uni
->num_driver_storage
].element_stride
= element_stride
;
127 uni
->driver_storage
[uni
->num_driver_storage
].vector_stride
= vector_stride
;
128 uni
->driver_storage
[uni
->num_driver_storage
].format
= format
;
129 uni
->driver_storage
[uni
->num_driver_storage
].data
= data
;
131 uni
->num_driver_storage
++;
135 * Sever all connections with all pieces of driver storage for all uniforms
138 * This function does \b not release any of the \c data pointers
139 * previously passed in to \c _mesa_uniform_attach_driver_stoarge.
142 _mesa_uniform_detach_all_driver_storage(struct gl_uniform_storage
*uni
)
144 free(uni
->driver_storage
);
145 uni
->driver_storage
= NULL
;
146 uni
->num_driver_storage
= 0;
150 _mesa_Uniform1f(GLint location
, GLfloat v0
)
152 GET_CURRENT_CONTEXT(ctx
);
153 _mesa_uniform(location
, 1, &v0
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_FLOAT
, 1);
157 _mesa_Uniform2f(GLint location
, GLfloat v0
, GLfloat v1
)
159 GET_CURRENT_CONTEXT(ctx
);
163 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_FLOAT
, 2);
167 _mesa_Uniform3f(GLint location
, GLfloat v0
, GLfloat v1
, GLfloat v2
)
169 GET_CURRENT_CONTEXT(ctx
);
174 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_FLOAT
, 3);
178 _mesa_Uniform4f(GLint location
, GLfloat v0
, GLfloat v1
, GLfloat v2
,
181 GET_CURRENT_CONTEXT(ctx
);
187 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_FLOAT
, 4);
191 _mesa_Uniform1i(GLint location
, GLint v0
)
193 GET_CURRENT_CONTEXT(ctx
);
194 _mesa_uniform(location
, 1, &v0
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT
, 1);
198 _mesa_Uniform2i(GLint location
, GLint v0
, GLint v1
)
200 GET_CURRENT_CONTEXT(ctx
);
204 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT
, 2);
208 _mesa_Uniform3i(GLint location
, GLint v0
, GLint v1
, GLint v2
)
210 GET_CURRENT_CONTEXT(ctx
);
215 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT
, 3);
219 _mesa_Uniform4i(GLint location
, GLint v0
, GLint v1
, GLint v2
, GLint v3
)
221 GET_CURRENT_CONTEXT(ctx
);
227 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT
, 4);
231 _mesa_Uniform1fv(GLint location
, GLsizei count
, const GLfloat
* value
)
233 GET_CURRENT_CONTEXT(ctx
);
234 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_FLOAT
, 1);
238 _mesa_Uniform2fv(GLint location
, GLsizei count
, const GLfloat
* value
)
240 GET_CURRENT_CONTEXT(ctx
);
241 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_FLOAT
, 2);
245 _mesa_Uniform3fv(GLint location
, GLsizei count
, const GLfloat
* value
)
247 GET_CURRENT_CONTEXT(ctx
);
248 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_FLOAT
, 3);
252 _mesa_Uniform4fv(GLint location
, GLsizei count
, const GLfloat
* value
)
254 GET_CURRENT_CONTEXT(ctx
);
255 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_FLOAT
, 4);
259 _mesa_Uniform1iv(GLint location
, GLsizei count
, const GLint
* value
)
261 GET_CURRENT_CONTEXT(ctx
);
262 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT
, 1);
266 _mesa_Uniform2iv(GLint location
, GLsizei count
, const GLint
* value
)
268 GET_CURRENT_CONTEXT(ctx
);
269 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT
, 2);
273 _mesa_Uniform3iv(GLint location
, GLsizei count
, const GLint
* value
)
275 GET_CURRENT_CONTEXT(ctx
);
276 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT
, 3);
280 _mesa_Uniform4iv(GLint location
, GLsizei count
, const GLint
* value
)
282 GET_CURRENT_CONTEXT(ctx
);
283 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT
, 4);
286 /** Same as above with direct state access **/
288 _mesa_ProgramUniform1f(GLuint program
, GLint location
, GLfloat v0
)
290 GET_CURRENT_CONTEXT(ctx
);
291 struct gl_shader_program
*shProg
=
292 _mesa_lookup_shader_program_err(ctx
, program
,
293 "glProgramUniform1f");
294 _mesa_uniform(location
, 1, &v0
, ctx
, shProg
, GLSL_TYPE_FLOAT
, 1);
298 _mesa_ProgramUniform2f(GLuint program
, GLint location
, GLfloat v0
, GLfloat v1
)
300 GET_CURRENT_CONTEXT(ctx
);
302 struct gl_shader_program
*shProg
;
305 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform2f");
306 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_FLOAT
, 2);
310 _mesa_ProgramUniform3f(GLuint program
, GLint location
, GLfloat v0
, GLfloat v1
,
313 GET_CURRENT_CONTEXT(ctx
);
315 struct gl_shader_program
*shProg
;
319 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform3f");
320 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_FLOAT
, 3);
324 _mesa_ProgramUniform4f(GLuint program
, GLint location
, GLfloat v0
, GLfloat v1
,
325 GLfloat v2
, GLfloat v3
)
327 GET_CURRENT_CONTEXT(ctx
);
329 struct gl_shader_program
*shProg
;
334 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform4f");
335 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_FLOAT
, 4);
339 _mesa_ProgramUniform1i(GLuint program
, GLint location
, GLint v0
)
341 GET_CURRENT_CONTEXT(ctx
);
342 struct gl_shader_program
*shProg
=
343 _mesa_lookup_shader_program_err(ctx
, program
,
344 "glProgramUniform1i");
345 _mesa_uniform(location
, 1, &v0
, ctx
, shProg
, GLSL_TYPE_INT
, 1);
349 _mesa_ProgramUniform2i(GLuint program
, GLint location
, GLint v0
, GLint v1
)
351 GET_CURRENT_CONTEXT(ctx
);
353 struct gl_shader_program
*shProg
;
356 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform2i");
357 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_INT
, 2);
361 _mesa_ProgramUniform3i(GLuint program
, GLint location
, GLint v0
, GLint v1
,
364 GET_CURRENT_CONTEXT(ctx
);
366 struct gl_shader_program
*shProg
;
370 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform3i");
371 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_INT
, 3);
375 _mesa_ProgramUniform4i(GLuint program
, GLint location
, GLint v0
, GLint v1
,
378 GET_CURRENT_CONTEXT(ctx
);
380 struct gl_shader_program
*shProg
;
385 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform4i");
386 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_INT
, 4);
390 _mesa_ProgramUniform1fv(GLuint program
, GLint location
, GLsizei count
,
391 const GLfloat
* value
)
393 GET_CURRENT_CONTEXT(ctx
);
394 struct gl_shader_program
*shProg
=
395 _mesa_lookup_shader_program_err(ctx
, program
,
396 "glProgramUniform1fv");
397 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_FLOAT
, 1);
401 _mesa_ProgramUniform2fv(GLuint program
, GLint location
, GLsizei count
,
402 const GLfloat
* value
)
404 GET_CURRENT_CONTEXT(ctx
);
405 struct gl_shader_program
*shProg
=
406 _mesa_lookup_shader_program_err(ctx
, program
,
407 "glProgramUniform2fv");
408 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_FLOAT
, 2);
412 _mesa_ProgramUniform3fv(GLuint program
, GLint location
, GLsizei count
,
413 const GLfloat
* value
)
415 GET_CURRENT_CONTEXT(ctx
);
416 struct gl_shader_program
*shProg
=
417 _mesa_lookup_shader_program_err(ctx
, program
,
418 "glProgramUniform3fv");
419 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_FLOAT
, 3);
423 _mesa_ProgramUniform4fv(GLuint program
, GLint location
, GLsizei count
,
424 const GLfloat
* value
)
426 GET_CURRENT_CONTEXT(ctx
);
427 struct gl_shader_program
*shProg
=
428 _mesa_lookup_shader_program_err(ctx
, program
,
429 "glProgramUniform4fv");
430 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_FLOAT
, 4);
434 _mesa_ProgramUniform1iv(GLuint program
, GLint location
, GLsizei count
,
437 GET_CURRENT_CONTEXT(ctx
);
438 struct gl_shader_program
*shProg
=
439 _mesa_lookup_shader_program_err(ctx
, program
,
440 "glProgramUniform1iv");
441 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_INT
, 1);
445 _mesa_ProgramUniform2iv(GLuint program
, GLint location
, GLsizei count
,
448 GET_CURRENT_CONTEXT(ctx
);
449 struct gl_shader_program
*shProg
=
450 _mesa_lookup_shader_program_err(ctx
, program
,
451 "glProgramUniform2iv");
452 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_INT
, 2);
456 _mesa_ProgramUniform3iv(GLuint program
, GLint location
, GLsizei count
,
459 GET_CURRENT_CONTEXT(ctx
);
460 struct gl_shader_program
*shProg
=
461 _mesa_lookup_shader_program_err(ctx
, program
,
462 "glProgramUniform3iv");
463 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_INT
, 3);
467 _mesa_ProgramUniform4iv(GLuint program
, GLint location
, GLsizei count
,
470 GET_CURRENT_CONTEXT(ctx
);
471 struct gl_shader_program
*shProg
=
472 _mesa_lookup_shader_program_err(ctx
, program
,
473 "glProgramUniform4iv");
474 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_INT
, 4);
478 /** OpenGL 3.0 GLuint-valued functions **/
480 _mesa_Uniform1ui(GLint location
, GLuint v0
)
482 GET_CURRENT_CONTEXT(ctx
);
483 _mesa_uniform(location
, 1, &v0
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT
, 1);
487 _mesa_Uniform2ui(GLint location
, GLuint v0
, GLuint v1
)
489 GET_CURRENT_CONTEXT(ctx
);
493 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT
, 2);
497 _mesa_Uniform3ui(GLint location
, GLuint v0
, GLuint v1
, GLuint v2
)
499 GET_CURRENT_CONTEXT(ctx
);
504 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT
, 3);
508 _mesa_Uniform4ui(GLint location
, GLuint v0
, GLuint v1
, GLuint v2
, GLuint v3
)
510 GET_CURRENT_CONTEXT(ctx
);
516 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT
, 4);
520 _mesa_Uniform1uiv(GLint location
, GLsizei count
, const GLuint
*value
)
522 GET_CURRENT_CONTEXT(ctx
);
523 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT
, 1);
527 _mesa_Uniform2uiv(GLint location
, GLsizei count
, const GLuint
*value
)
529 GET_CURRENT_CONTEXT(ctx
);
530 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT
, 2);
534 _mesa_Uniform3uiv(GLint location
, GLsizei count
, const GLuint
*value
)
536 GET_CURRENT_CONTEXT(ctx
);
537 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT
, 3);
541 _mesa_Uniform4uiv(GLint location
, GLsizei count
, const GLuint
*value
)
543 GET_CURRENT_CONTEXT(ctx
);
544 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT
, 4);
550 _mesa_UniformMatrix2fv(GLint location
, GLsizei count
, GLboolean transpose
,
551 const GLfloat
* value
)
553 GET_CURRENT_CONTEXT(ctx
);
554 _mesa_uniform_matrix(location
, count
, transpose
, value
,
555 ctx
, ctx
->_Shader
->ActiveProgram
, 2, 2, GLSL_TYPE_FLOAT
);
559 _mesa_UniformMatrix3fv(GLint location
, GLsizei count
, GLboolean transpose
,
560 const GLfloat
* value
)
562 GET_CURRENT_CONTEXT(ctx
);
563 _mesa_uniform_matrix(location
, count
, transpose
, value
,
564 ctx
, ctx
->_Shader
->ActiveProgram
, 3, 3, GLSL_TYPE_FLOAT
);
568 _mesa_UniformMatrix4fv(GLint location
, GLsizei count
, GLboolean transpose
,
569 const GLfloat
* value
)
571 GET_CURRENT_CONTEXT(ctx
);
572 _mesa_uniform_matrix(location
, count
, transpose
, value
,
573 ctx
, ctx
->_Shader
->ActiveProgram
, 4, 4, GLSL_TYPE_FLOAT
);
576 /** Same as above with direct state access **/
579 _mesa_ProgramUniform1ui(GLuint program
, GLint location
, GLuint v0
)
581 GET_CURRENT_CONTEXT(ctx
);
582 struct gl_shader_program
*shProg
=
583 _mesa_lookup_shader_program_err(ctx
, program
,
584 "glProgramUniform1ui");
585 _mesa_uniform(location
, 1, &v0
, ctx
, shProg
, GLSL_TYPE_UINT
, 1);
589 _mesa_ProgramUniform2ui(GLuint program
, GLint location
, GLuint v0
, GLuint v1
)
591 GET_CURRENT_CONTEXT(ctx
);
593 struct gl_shader_program
*shProg
;
596 shProg
= _mesa_lookup_shader_program_err(ctx
, program
,
597 "glProgramUniform2ui");
598 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_UINT
, 2);
602 _mesa_ProgramUniform3ui(GLuint program
, GLint location
, GLuint v0
, GLuint v1
,
605 GET_CURRENT_CONTEXT(ctx
);
607 struct gl_shader_program
*shProg
;
611 shProg
= _mesa_lookup_shader_program_err(ctx
, program
,
612 "glProgramUniform3ui");
613 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_UINT
, 3);
617 _mesa_ProgramUniform4ui(GLuint program
, GLint location
, GLuint v0
, GLuint v1
,
618 GLuint v2
, GLuint v3
)
620 GET_CURRENT_CONTEXT(ctx
);
622 struct gl_shader_program
*shProg
;
627 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform4ui");
628 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_UINT
, 4);
632 _mesa_ProgramUniform1uiv(GLuint program
, GLint location
, GLsizei count
,
635 GET_CURRENT_CONTEXT(ctx
);
636 struct gl_shader_program
*shProg
=
637 _mesa_lookup_shader_program_err(ctx
, program
,
638 "glProgramUniform1uiv");
639 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_UINT
, 1);
643 _mesa_ProgramUniform2uiv(GLuint program
, GLint location
, GLsizei count
,
646 GET_CURRENT_CONTEXT(ctx
);
647 struct gl_shader_program
*shProg
=
648 _mesa_lookup_shader_program_err(ctx
, program
,
649 "glProgramUniform2uiv");
650 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_UINT
, 2);
654 _mesa_ProgramUniform3uiv(GLuint program
, GLint location
, GLsizei count
,
657 GET_CURRENT_CONTEXT(ctx
);
658 struct gl_shader_program
*shProg
=
659 _mesa_lookup_shader_program_err(ctx
, program
,
660 "glProgramUniform3uiv");
661 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_UINT
, 3);
665 _mesa_ProgramUniform4uiv(GLuint program
, GLint location
, GLsizei count
,
668 GET_CURRENT_CONTEXT(ctx
);
669 struct gl_shader_program
*shProg
=
670 _mesa_lookup_shader_program_err(ctx
, program
,
671 "glProgramUniform4uiv");
672 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_UINT
, 4);
678 _mesa_ProgramUniformMatrix2fv(GLuint program
, GLint location
, GLsizei count
,
679 GLboolean transpose
, const GLfloat
* value
)
681 GET_CURRENT_CONTEXT(ctx
);
682 struct gl_shader_program
*shProg
=
683 _mesa_lookup_shader_program_err(ctx
, program
,
684 "glProgramUniformMatrix2fv");
685 _mesa_uniform_matrix(location
, count
, transpose
, value
, ctx
, shProg
, 2, 2, GLSL_TYPE_FLOAT
);
689 _mesa_ProgramUniformMatrix3fv(GLuint program
, GLint location
, GLsizei count
,
690 GLboolean transpose
, const GLfloat
* value
)
692 GET_CURRENT_CONTEXT(ctx
);
693 struct gl_shader_program
*shProg
=
694 _mesa_lookup_shader_program_err(ctx
, program
,
695 "glProgramUniformMatrix3fv");
696 _mesa_uniform_matrix(location
, count
, transpose
, value
, ctx
, shProg
, 3, 3, GLSL_TYPE_FLOAT
);
700 _mesa_ProgramUniformMatrix4fv(GLuint program
, GLint location
, GLsizei count
,
701 GLboolean transpose
, const GLfloat
* value
)
703 GET_CURRENT_CONTEXT(ctx
);
704 struct gl_shader_program
*shProg
=
705 _mesa_lookup_shader_program_err(ctx
, program
,
706 "glProgramUniformMatrix4fv");
707 _mesa_uniform_matrix(location
, count
, transpose
, value
, ctx
, shProg
, 4, 4, GLSL_TYPE_FLOAT
);
712 * Non-square UniformMatrix are OpenGL 2.1
715 _mesa_UniformMatrix2x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
716 const GLfloat
*value
)
718 GET_CURRENT_CONTEXT(ctx
);
719 _mesa_uniform_matrix(location
, count
, transpose
, value
,
720 ctx
, ctx
->_Shader
->ActiveProgram
, 2, 3, GLSL_TYPE_FLOAT
);
724 _mesa_UniformMatrix3x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
725 const GLfloat
*value
)
727 GET_CURRENT_CONTEXT(ctx
);
728 _mesa_uniform_matrix(location
, count
, transpose
, value
,
729 ctx
, ctx
->_Shader
->ActiveProgram
, 3, 2, GLSL_TYPE_FLOAT
);
733 _mesa_UniformMatrix2x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
734 const GLfloat
*value
)
736 GET_CURRENT_CONTEXT(ctx
);
737 _mesa_uniform_matrix(location
, count
, transpose
, value
,
738 ctx
, ctx
->_Shader
->ActiveProgram
, 2, 4, GLSL_TYPE_FLOAT
);
742 _mesa_UniformMatrix4x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
743 const GLfloat
*value
)
745 GET_CURRENT_CONTEXT(ctx
);
746 _mesa_uniform_matrix(location
, count
, transpose
, value
,
747 ctx
, ctx
->_Shader
->ActiveProgram
, 4, 2, GLSL_TYPE_FLOAT
);
751 _mesa_UniformMatrix3x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
752 const GLfloat
*value
)
754 GET_CURRENT_CONTEXT(ctx
);
755 _mesa_uniform_matrix(location
, count
, transpose
, value
,
756 ctx
, ctx
->_Shader
->ActiveProgram
, 3, 4, GLSL_TYPE_FLOAT
);
760 _mesa_UniformMatrix4x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
761 const GLfloat
*value
)
763 GET_CURRENT_CONTEXT(ctx
);
764 _mesa_uniform_matrix(location
, count
, transpose
, value
,
765 ctx
, ctx
->_Shader
->ActiveProgram
, 4, 3, GLSL_TYPE_FLOAT
);
768 /** Same as above with direct state access **/
771 _mesa_ProgramUniformMatrix2x3fv(GLuint program
, GLint location
, GLsizei count
,
772 GLboolean transpose
, const GLfloat
* value
)
774 GET_CURRENT_CONTEXT(ctx
);
775 struct gl_shader_program
*shProg
=
776 _mesa_lookup_shader_program_err(ctx
, program
,
777 "glProgramUniformMatrix2x3fv");
778 _mesa_uniform_matrix(location
, count
, transpose
, value
, ctx
, shProg
, 2, 3, GLSL_TYPE_FLOAT
);
782 _mesa_ProgramUniformMatrix3x2fv(GLuint program
, GLint location
, GLsizei count
,
783 GLboolean transpose
, const GLfloat
* value
)
785 GET_CURRENT_CONTEXT(ctx
);
786 struct gl_shader_program
*shProg
=
787 _mesa_lookup_shader_program_err(ctx
, program
,
788 "glProgramUniformMatrix3x2fv");
789 _mesa_uniform_matrix(location
, count
, transpose
, value
, ctx
, shProg
, 3, 2, GLSL_TYPE_FLOAT
);
793 _mesa_ProgramUniformMatrix2x4fv(GLuint program
, GLint location
, GLsizei count
,
794 GLboolean transpose
, const GLfloat
* value
)
796 GET_CURRENT_CONTEXT(ctx
);
797 struct gl_shader_program
*shProg
=
798 _mesa_lookup_shader_program_err(ctx
, program
,
799 "glProgramUniformMatrix2x4fv");
800 _mesa_uniform_matrix(location
, count
, transpose
, value
, ctx
, shProg
, 2, 4, GLSL_TYPE_FLOAT
);
804 _mesa_ProgramUniformMatrix4x2fv(GLuint program
, GLint location
, GLsizei count
,
805 GLboolean transpose
, const GLfloat
* value
)
807 GET_CURRENT_CONTEXT(ctx
);
808 struct gl_shader_program
*shProg
=
809 _mesa_lookup_shader_program_err(ctx
, program
,
810 "glProgramUniformMatrix4x2fv");
811 _mesa_uniform_matrix(location
, count
, transpose
, value
, ctx
, shProg
, 4, 2, GLSL_TYPE_FLOAT
);
815 _mesa_ProgramUniformMatrix3x4fv(GLuint program
, GLint location
, GLsizei count
,
816 GLboolean transpose
, const GLfloat
* value
)
818 GET_CURRENT_CONTEXT(ctx
);
819 struct gl_shader_program
*shProg
=
820 _mesa_lookup_shader_program_err(ctx
, program
,
821 "glProgramUniformMatrix3x4fv");
822 _mesa_uniform_matrix(location
, count
, transpose
, value
, ctx
, shProg
, 3, 4, GLSL_TYPE_FLOAT
);
826 _mesa_ProgramUniformMatrix4x3fv(GLuint program
, GLint location
, GLsizei count
,
827 GLboolean transpose
, const GLfloat
* value
)
829 GET_CURRENT_CONTEXT(ctx
);
830 struct gl_shader_program
*shProg
=
831 _mesa_lookup_shader_program_err(ctx
, program
,
832 "glProgramUniformMatrix4x3fv");
833 _mesa_uniform_matrix(location
, count
, transpose
, value
, ctx
, shProg
, 4, 3, GLSL_TYPE_FLOAT
);
838 _mesa_GetnUniformfvARB(GLuint program
, GLint location
,
839 GLsizei bufSize
, GLfloat
*params
)
841 GET_CURRENT_CONTEXT(ctx
);
842 _mesa_get_uniform(ctx
, program
, location
, bufSize
, GLSL_TYPE_FLOAT
, params
);
846 _mesa_GetUniformfv(GLuint program
, GLint location
, GLfloat
*params
)
848 _mesa_GetnUniformfvARB(program
, location
, INT_MAX
, params
);
853 _mesa_GetnUniformivARB(GLuint program
, GLint location
,
854 GLsizei bufSize
, GLint
*params
)
856 GET_CURRENT_CONTEXT(ctx
);
857 _mesa_get_uniform(ctx
, program
, location
, bufSize
, GLSL_TYPE_INT
, params
);
861 _mesa_GetUniformiv(GLuint program
, GLint location
, GLint
*params
)
863 _mesa_GetnUniformivARB(program
, location
, INT_MAX
, params
);
869 _mesa_GetnUniformuivARB(GLuint program
, GLint location
,
870 GLsizei bufSize
, GLuint
*params
)
872 GET_CURRENT_CONTEXT(ctx
);
873 _mesa_get_uniform(ctx
, program
, location
, bufSize
, GLSL_TYPE_UINT
, params
);
877 _mesa_GetUniformuiv(GLuint program
, GLint location
, GLuint
*params
)
879 _mesa_GetnUniformuivARB(program
, location
, INT_MAX
, params
);
885 _mesa_GetnUniformdvARB(GLuint program
, GLint location
,
886 GLsizei bufSize
, GLdouble
*params
)
888 GET_CURRENT_CONTEXT(ctx
);
890 _mesa_get_uniform(ctx
, program
, location
, bufSize
, GLSL_TYPE_DOUBLE
, params
);
894 _mesa_GetUniformdv(GLuint program
, GLint location
, GLdouble
*params
)
896 _mesa_GetnUniformdvARB(program
, location
, INT_MAX
, params
);
900 _mesa_GetnUniformi64vARB(GLuint program
, GLint location
,
901 GLsizei bufSize
, GLint64
*params
)
903 GET_CURRENT_CONTEXT(ctx
);
904 _mesa_get_uniform(ctx
, program
, location
, bufSize
, GLSL_TYPE_INT64
, params
);
907 _mesa_GetUniformi64vARB(GLuint program
, GLint location
, GLint64
*params
)
909 _mesa_GetnUniformi64vARB(program
, location
, INT_MAX
, params
);
913 _mesa_GetnUniformui64vARB(GLuint program
, GLint location
,
914 GLsizei bufSize
, GLuint64
*params
)
916 GET_CURRENT_CONTEXT(ctx
);
917 _mesa_get_uniform(ctx
, program
, location
, bufSize
, GLSL_TYPE_UINT64
, params
);
921 _mesa_GetUniformui64vARB(GLuint program
, GLint location
, GLuint64
*params
)
923 _mesa_GetnUniformui64vARB(program
, location
, INT_MAX
, params
);
928 _mesa_GetUniformLocation(GLuint programObj
, const GLcharARB
*name
)
930 struct gl_shader_program
*shProg
;
932 GET_CURRENT_CONTEXT(ctx
);
934 shProg
= _mesa_lookup_shader_program_err(ctx
, programObj
,
935 "glGetUniformLocation");
939 /* Page 80 (page 94 of the PDF) of the OpenGL 2.1 spec says:
941 * "If program has not been successfully linked, the error
942 * INVALID_OPERATION is generated."
944 if (shProg
->data
->LinkStatus
== GL_FALSE
) {
945 _mesa_error(ctx
, GL_INVALID_OPERATION
,
946 "glGetUniformLocation(program not linked)");
950 return _mesa_program_resource_location(shProg
, GL_UNIFORM
, name
);
954 _mesa_GetUniformBlockIndex(GLuint program
,
955 const GLchar
*uniformBlockName
)
957 GET_CURRENT_CONTEXT(ctx
);
958 struct gl_shader_program
*shProg
;
960 if (!ctx
->Extensions
.ARB_uniform_buffer_object
) {
961 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glGetUniformBlockIndex");
962 return GL_INVALID_INDEX
;
965 shProg
= _mesa_lookup_shader_program_err(ctx
, program
,
966 "glGetUniformBlockIndex");
968 return GL_INVALID_INDEX
;
970 struct gl_program_resource
*res
=
971 _mesa_program_resource_find_name(shProg
, GL_UNIFORM_BLOCK
,
972 uniformBlockName
, NULL
);
974 return GL_INVALID_INDEX
;
976 return _mesa_program_resource_index(shProg
, res
);
980 _mesa_GetUniformIndices(GLuint program
,
981 GLsizei uniformCount
,
982 const GLchar
* const *uniformNames
,
983 GLuint
*uniformIndices
)
985 GET_CURRENT_CONTEXT(ctx
);
987 struct gl_shader_program
*shProg
;
989 if (!ctx
->Extensions
.ARB_uniform_buffer_object
) {
990 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glGetUniformIndices");
994 shProg
= _mesa_lookup_shader_program_err(ctx
, program
,
995 "glGetUniformIndices");
999 if (uniformCount
< 0) {
1000 _mesa_error(ctx
, GL_INVALID_VALUE
,
1001 "glGetUniformIndices(uniformCount < 0)");
1005 for (i
= 0; i
< uniformCount
; i
++) {
1006 struct gl_program_resource
*res
=
1007 _mesa_program_resource_find_name(shProg
, GL_UNIFORM
, uniformNames
[i
],
1009 uniformIndices
[i
] = _mesa_program_resource_index(shProg
, res
);
1014 _mesa_UniformBlockBinding(GLuint program
,
1015 GLuint uniformBlockIndex
,
1016 GLuint uniformBlockBinding
)
1018 GET_CURRENT_CONTEXT(ctx
);
1019 struct gl_shader_program
*shProg
;
1021 if (!ctx
->Extensions
.ARB_uniform_buffer_object
) {
1022 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glUniformBlockBinding");
1026 shProg
= _mesa_lookup_shader_program_err(ctx
, program
,
1027 "glUniformBlockBinding");
1031 if (uniformBlockIndex
>= shProg
->data
->NumUniformBlocks
) {
1032 _mesa_error(ctx
, GL_INVALID_VALUE
,
1033 "glUniformBlockBinding(block index %u >= %u)",
1034 uniformBlockIndex
, shProg
->data
->NumUniformBlocks
);
1038 if (uniformBlockBinding
>= ctx
->Const
.MaxUniformBufferBindings
) {
1039 _mesa_error(ctx
, GL_INVALID_VALUE
,
1040 "glUniformBlockBinding(block binding %u >= %u)",
1041 uniformBlockBinding
, ctx
->Const
.MaxUniformBufferBindings
);
1045 if (shProg
->data
->UniformBlocks
[uniformBlockIndex
].Binding
!=
1046 uniformBlockBinding
) {
1048 FLUSH_VERTICES(ctx
, 0);
1049 ctx
->NewDriverState
|= ctx
->DriverFlags
.NewUniformBuffer
;
1051 shProg
->data
->UniformBlocks
[uniformBlockIndex
].Binding
=
1052 uniformBlockBinding
;
1057 _mesa_ShaderStorageBlockBinding(GLuint program
,
1058 GLuint shaderStorageBlockIndex
,
1059 GLuint shaderStorageBlockBinding
)
1061 GET_CURRENT_CONTEXT(ctx
);
1062 struct gl_shader_program
*shProg
;
1064 if (!ctx
->Extensions
.ARB_shader_storage_buffer_object
) {
1065 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glShaderStorageBlockBinding");
1069 shProg
= _mesa_lookup_shader_program_err(ctx
, program
,
1070 "glShaderStorageBlockBinding");
1074 if (shaderStorageBlockIndex
>= shProg
->data
->NumShaderStorageBlocks
) {
1075 _mesa_error(ctx
, GL_INVALID_VALUE
,
1076 "glShaderStorageBlockBinding(block index %u >= %u)",
1077 shaderStorageBlockIndex
,
1078 shProg
->data
->NumShaderStorageBlocks
);
1082 if (shaderStorageBlockBinding
>= ctx
->Const
.MaxShaderStorageBufferBindings
) {
1083 _mesa_error(ctx
, GL_INVALID_VALUE
,
1084 "glShaderStorageBlockBinding(block binding %u >= %u)",
1085 shaderStorageBlockBinding
,
1086 ctx
->Const
.MaxShaderStorageBufferBindings
);
1090 if (shProg
->data
->ShaderStorageBlocks
[shaderStorageBlockIndex
].Binding
!=
1091 shaderStorageBlockBinding
) {
1093 FLUSH_VERTICES(ctx
, 0);
1094 ctx
->NewDriverState
|= ctx
->DriverFlags
.NewShaderStorageBuffer
;
1096 shProg
->data
->ShaderStorageBlocks
[shaderStorageBlockIndex
].Binding
=
1097 shaderStorageBlockBinding
;
1102 * Generic program resource property query.
1105 mesa_bufferiv(struct gl_shader_program
*shProg
, GLenum type
,
1106 GLuint index
, GLenum pname
, GLint
*params
, const char *caller
)
1108 GET_CURRENT_CONTEXT(ctx
);
1109 struct gl_program_resource
*res
=
1110 _mesa_program_resource_find_index(shProg
, type
, index
);
1113 _mesa_error(ctx
, GL_INVALID_VALUE
, "%s(bufferindex %d)", caller
, index
);
1118 case GL_UNIFORM_BLOCK_BINDING
:
1119 case GL_ATOMIC_COUNTER_BUFFER_BINDING
:
1120 _mesa_program_resource_prop(shProg
, res
, index
, GL_BUFFER_BINDING
,
1123 case GL_UNIFORM_BLOCK_DATA_SIZE
:
1124 case GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE
:
1125 _mesa_program_resource_prop(shProg
, res
, index
, GL_BUFFER_DATA_SIZE
,
1128 case GL_UNIFORM_BLOCK_NAME_LENGTH
:
1129 _mesa_program_resource_prop(shProg
, res
, index
, GL_NAME_LENGTH
,
1132 case GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS
:
1133 case GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS
:
1134 _mesa_program_resource_prop(shProg
, res
, index
, GL_NUM_ACTIVE_VARIABLES
,
1137 case GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES
:
1138 case GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES
:
1139 _mesa_program_resource_prop(shProg
, res
, index
, GL_ACTIVE_VARIABLES
,
1142 case GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER
:
1143 case GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER
:
1144 _mesa_program_resource_prop(shProg
, res
, index
,
1145 GL_REFERENCED_BY_VERTEX_SHADER
, params
,
1149 case GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER
:
1150 case GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER
:
1151 _mesa_program_resource_prop(shProg
, res
, index
,
1152 GL_REFERENCED_BY_TESS_CONTROL_SHADER
, params
,
1156 case GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER
:
1157 case GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER
:
1158 _mesa_program_resource_prop(shProg
, res
, index
,
1159 GL_REFERENCED_BY_TESS_EVALUATION_SHADER
, params
,
1163 case GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER
:
1164 case GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER
:
1165 _mesa_program_resource_prop(shProg
, res
, index
,
1166 GL_REFERENCED_BY_GEOMETRY_SHADER
, params
,
1169 case GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER
:
1170 case GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER
:
1171 _mesa_program_resource_prop(shProg
, res
, index
,
1172 GL_REFERENCED_BY_FRAGMENT_SHADER
, params
,
1175 case GL_UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER
:
1176 case GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER
:
1177 _mesa_program_resource_prop(shProg
, res
, index
,
1178 GL_REFERENCED_BY_COMPUTE_SHADER
, params
,
1182 _mesa_error(ctx
, GL_INVALID_ENUM
,
1183 "%s(pname 0x%x (%s))", caller
, pname
,
1184 _mesa_enum_to_string(pname
));
1191 _mesa_GetActiveUniformBlockiv(GLuint program
,
1192 GLuint uniformBlockIndex
,
1196 GET_CURRENT_CONTEXT(ctx
);
1197 struct gl_shader_program
*shProg
;
1199 if (!ctx
->Extensions
.ARB_uniform_buffer_object
) {
1200 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glGetActiveUniformBlockiv");
1204 shProg
= _mesa_lookup_shader_program_err(ctx
, program
,
1205 "glGetActiveUniformBlockiv");
1209 mesa_bufferiv(shProg
, GL_UNIFORM_BLOCK
, uniformBlockIndex
, pname
, params
,
1210 "glGetActiveUniformBlockiv");
1214 _mesa_GetActiveUniformBlockName(GLuint program
,
1215 GLuint uniformBlockIndex
,
1218 GLchar
*uniformBlockName
)
1220 GET_CURRENT_CONTEXT(ctx
);
1221 struct gl_shader_program
*shProg
;
1223 if (!ctx
->Extensions
.ARB_uniform_buffer_object
) {
1224 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glGetActiveUniformBlockiv");
1229 _mesa_error(ctx
, GL_INVALID_VALUE
,
1230 "glGetActiveUniformBlockName(bufSize %d < 0)",
1235 shProg
= _mesa_lookup_shader_program_err(ctx
, program
,
1236 "glGetActiveUniformBlockiv");
1240 if (uniformBlockName
)
1241 _mesa_get_program_resource_name(shProg
, GL_UNIFORM_BLOCK
,
1242 uniformBlockIndex
, bufSize
, length
,
1244 "glGetActiveUniformBlockName");
1248 _mesa_GetActiveUniformName(GLuint program
, GLuint uniformIndex
,
1249 GLsizei bufSize
, GLsizei
*length
,
1250 GLchar
*uniformName
)
1252 GET_CURRENT_CONTEXT(ctx
);
1253 struct gl_shader_program
*shProg
;
1255 if (!ctx
->Extensions
.ARB_uniform_buffer_object
) {
1256 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glGetActiveUniformName");
1261 _mesa_error(ctx
, GL_INVALID_VALUE
,
1262 "glGetActiveUniformName(bufSize %d < 0)",
1267 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glGetActiveUniformName");
1272 _mesa_get_program_resource_name(shProg
, GL_UNIFORM
, uniformIndex
, bufSize
,
1273 length
, uniformName
, "glGetActiveUniformName");
1277 _mesa_GetActiveAtomicCounterBufferiv(GLuint program
, GLuint bufferIndex
,
1278 GLenum pname
, GLint
*params
)
1280 GET_CURRENT_CONTEXT(ctx
);
1281 struct gl_shader_program
*shProg
;
1283 if (!ctx
->Extensions
.ARB_shader_atomic_counters
) {
1284 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1285 "glGetActiveAtomicCounterBufferiv");
1289 shProg
= _mesa_lookup_shader_program_err(ctx
, program
,
1290 "glGetActiveAtomicCounterBufferiv");
1294 mesa_bufferiv(shProg
, GL_ATOMIC_COUNTER_BUFFER
, bufferIndex
, pname
, params
,
1295 "glGetActiveAtomicCounterBufferiv");
1299 _mesa_Uniform1d(GLint location
, GLdouble v0
)
1301 GET_CURRENT_CONTEXT(ctx
);
1302 _mesa_uniform(location
, 1, &v0
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_DOUBLE
, 1);
1306 _mesa_Uniform2d(GLint location
, GLdouble v0
, GLdouble v1
)
1308 GET_CURRENT_CONTEXT(ctx
);
1312 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_DOUBLE
, 2);
1316 _mesa_Uniform3d(GLint location
, GLdouble v0
, GLdouble v1
, GLdouble v2
)
1318 GET_CURRENT_CONTEXT(ctx
);
1323 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_DOUBLE
, 3);
1327 _mesa_Uniform4d(GLint location
, GLdouble v0
, GLdouble v1
, GLdouble v2
,
1330 GET_CURRENT_CONTEXT(ctx
);
1336 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_DOUBLE
, 4);
1340 _mesa_Uniform1dv(GLint location
, GLsizei count
, const GLdouble
* value
)
1342 GET_CURRENT_CONTEXT(ctx
);
1343 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_DOUBLE
, 1);
1347 _mesa_Uniform2dv(GLint location
, GLsizei count
, const GLdouble
* value
)
1349 GET_CURRENT_CONTEXT(ctx
);
1350 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_DOUBLE
, 2);
1354 _mesa_Uniform3dv(GLint location
, GLsizei count
, const GLdouble
* value
)
1356 GET_CURRENT_CONTEXT(ctx
);
1357 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_DOUBLE
, 3);
1361 _mesa_Uniform4dv(GLint location
, GLsizei count
, const GLdouble
* value
)
1363 GET_CURRENT_CONTEXT(ctx
);
1364 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_DOUBLE
, 4);
1368 _mesa_UniformMatrix2dv(GLint location
, GLsizei count
, GLboolean transpose
,
1369 const GLdouble
* value
)
1371 GET_CURRENT_CONTEXT(ctx
);
1372 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1373 ctx
, ctx
->_Shader
->ActiveProgram
, 2, 2, GLSL_TYPE_DOUBLE
);
1377 _mesa_UniformMatrix3dv(GLint location
, GLsizei count
, GLboolean transpose
,
1378 const GLdouble
* value
)
1380 GET_CURRENT_CONTEXT(ctx
);
1381 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1382 ctx
, ctx
->_Shader
->ActiveProgram
, 3, 3, GLSL_TYPE_DOUBLE
);
1386 _mesa_UniformMatrix4dv(GLint location
, GLsizei count
, GLboolean transpose
,
1387 const GLdouble
* value
)
1389 GET_CURRENT_CONTEXT(ctx
);
1390 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1391 ctx
, ctx
->_Shader
->ActiveProgram
, 4, 4, GLSL_TYPE_DOUBLE
);
1395 _mesa_UniformMatrix2x3dv(GLint location
, GLsizei count
, GLboolean transpose
,
1396 const GLdouble
*value
)
1398 GET_CURRENT_CONTEXT(ctx
);
1399 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1400 ctx
, ctx
->_Shader
->ActiveProgram
, 2, 3, GLSL_TYPE_DOUBLE
);
1404 _mesa_UniformMatrix3x2dv(GLint location
, GLsizei count
, GLboolean transpose
,
1405 const GLdouble
*value
)
1407 GET_CURRENT_CONTEXT(ctx
);
1408 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1409 ctx
, ctx
->_Shader
->ActiveProgram
, 3, 2, GLSL_TYPE_DOUBLE
);
1413 _mesa_UniformMatrix2x4dv(GLint location
, GLsizei count
, GLboolean transpose
,
1414 const GLdouble
*value
)
1416 GET_CURRENT_CONTEXT(ctx
);
1417 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1418 ctx
, ctx
->_Shader
->ActiveProgram
, 2, 4, GLSL_TYPE_DOUBLE
);
1422 _mesa_UniformMatrix4x2dv(GLint location
, GLsizei count
, GLboolean transpose
,
1423 const GLdouble
*value
)
1425 GET_CURRENT_CONTEXT(ctx
);
1426 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1427 ctx
, ctx
->_Shader
->ActiveProgram
, 4, 2, GLSL_TYPE_DOUBLE
);
1431 _mesa_UniformMatrix3x4dv(GLint location
, GLsizei count
, GLboolean transpose
,
1432 const GLdouble
*value
)
1434 GET_CURRENT_CONTEXT(ctx
);
1435 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1436 ctx
, ctx
->_Shader
->ActiveProgram
, 3, 4, GLSL_TYPE_DOUBLE
);
1440 _mesa_UniformMatrix4x3dv(GLint location
, GLsizei count
, GLboolean transpose
,
1441 const GLdouble
*value
)
1443 GET_CURRENT_CONTEXT(ctx
);
1444 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1445 ctx
, ctx
->_Shader
->ActiveProgram
, 4, 3, GLSL_TYPE_DOUBLE
);
1449 _mesa_ProgramUniform1d(GLuint program
, GLint location
, GLdouble v0
)
1451 GET_CURRENT_CONTEXT(ctx
);
1452 struct gl_shader_program
*shProg
=
1453 _mesa_lookup_shader_program_err(ctx
, program
,
1454 "glProgramUniform1d");
1455 _mesa_uniform(location
, 1, &v0
, ctx
, shProg
, GLSL_TYPE_DOUBLE
, 1);
1459 _mesa_ProgramUniform2d(GLuint program
, GLint location
, GLdouble v0
, GLdouble v1
)
1461 GET_CURRENT_CONTEXT(ctx
);
1463 struct gl_shader_program
*shProg
;
1466 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform2d");
1467 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_DOUBLE
, 2);
1471 _mesa_ProgramUniform3d(GLuint program
, GLint location
, GLdouble v0
, GLdouble v1
,
1474 GET_CURRENT_CONTEXT(ctx
);
1476 struct gl_shader_program
*shProg
;
1480 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform3d");
1481 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_DOUBLE
, 3);
1485 _mesa_ProgramUniform4d(GLuint program
, GLint location
, GLdouble v0
, GLdouble v1
,
1486 GLdouble v2
, GLdouble v3
)
1488 GET_CURRENT_CONTEXT(ctx
);
1490 struct gl_shader_program
*shProg
;
1495 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform4d");
1496 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_DOUBLE
, 4);
1500 _mesa_ProgramUniform1dv(GLuint program
, GLint location
, GLsizei count
,
1501 const GLdouble
* value
)
1503 GET_CURRENT_CONTEXT(ctx
);
1504 struct gl_shader_program
*shProg
=
1505 _mesa_lookup_shader_program_err(ctx
, program
,
1506 "glProgramUniform1dv");
1507 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_DOUBLE
, 1);
1511 _mesa_ProgramUniform2dv(GLuint program
, GLint location
, GLsizei count
,
1512 const GLdouble
* value
)
1514 GET_CURRENT_CONTEXT(ctx
);
1515 struct gl_shader_program
*shProg
=
1516 _mesa_lookup_shader_program_err(ctx
, program
,
1517 "glProgramUniform2dv");
1518 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_DOUBLE
, 2);
1522 _mesa_ProgramUniform3dv(GLuint program
, GLint location
, GLsizei count
,
1523 const GLdouble
* value
)
1525 GET_CURRENT_CONTEXT(ctx
);
1526 struct gl_shader_program
*shProg
=
1527 _mesa_lookup_shader_program_err(ctx
, program
,
1528 "glProgramUniform3dv");
1529 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_DOUBLE
, 3);
1533 _mesa_ProgramUniform4dv(GLuint program
, GLint location
, GLsizei count
,
1534 const GLdouble
* value
)
1536 GET_CURRENT_CONTEXT(ctx
);
1537 struct gl_shader_program
*shProg
=
1538 _mesa_lookup_shader_program_err(ctx
, program
,
1539 "glProgramUniform4dv");
1540 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_DOUBLE
, 4);
1544 _mesa_ProgramUniformMatrix2dv(GLuint program
, GLint location
, GLsizei count
,
1545 GLboolean transpose
, const GLdouble
* value
)
1547 GET_CURRENT_CONTEXT(ctx
);
1548 struct gl_shader_program
*shProg
=
1549 _mesa_lookup_shader_program_err(ctx
, program
,
1550 "glProgramUniformMatrix2dv");
1551 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1552 ctx
, shProg
, 2, 2, GLSL_TYPE_DOUBLE
);
1556 _mesa_ProgramUniformMatrix3dv(GLuint program
, GLint location
, GLsizei count
,
1557 GLboolean transpose
, const GLdouble
* value
)
1559 GET_CURRENT_CONTEXT(ctx
);
1560 struct gl_shader_program
*shProg
=
1561 _mesa_lookup_shader_program_err(ctx
, program
,
1562 "glProgramUniformMatrix3dv");
1563 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1564 ctx
, shProg
, 3, 3, GLSL_TYPE_DOUBLE
);
1568 _mesa_ProgramUniformMatrix4dv(GLuint program
, GLint location
, GLsizei count
,
1569 GLboolean transpose
, const GLdouble
* value
)
1571 GET_CURRENT_CONTEXT(ctx
);
1572 struct gl_shader_program
*shProg
=
1573 _mesa_lookup_shader_program_err(ctx
, program
,
1574 "glProgramUniformMatrix4dv");
1575 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1576 ctx
, shProg
, 4, 4, GLSL_TYPE_DOUBLE
);
1580 _mesa_ProgramUniformMatrix2x3dv(GLuint program
, GLint location
, GLsizei count
,
1581 GLboolean transpose
, const GLdouble
* value
)
1583 GET_CURRENT_CONTEXT(ctx
);
1584 struct gl_shader_program
*shProg
=
1585 _mesa_lookup_shader_program_err(ctx
, program
,
1586 "glProgramUniformMatrix2x3dv");
1587 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1588 ctx
, shProg
, 2, 3, GLSL_TYPE_DOUBLE
);
1592 _mesa_ProgramUniformMatrix3x2dv(GLuint program
, GLint location
, GLsizei count
,
1593 GLboolean transpose
, const GLdouble
* value
)
1595 GET_CURRENT_CONTEXT(ctx
);
1596 struct gl_shader_program
*shProg
=
1597 _mesa_lookup_shader_program_err(ctx
, program
,
1598 "glProgramUniformMatrix3x2dv");
1599 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1600 ctx
, shProg
, 3, 2, GLSL_TYPE_DOUBLE
);
1604 _mesa_ProgramUniformMatrix2x4dv(GLuint program
, GLint location
, GLsizei count
,
1605 GLboolean transpose
, const GLdouble
* value
)
1607 GET_CURRENT_CONTEXT(ctx
);
1608 struct gl_shader_program
*shProg
=
1609 _mesa_lookup_shader_program_err(ctx
, program
,
1610 "glProgramUniformMatrix2x4dv");
1611 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1612 ctx
, shProg
, 2, 4, GLSL_TYPE_DOUBLE
);
1616 _mesa_ProgramUniformMatrix4x2dv(GLuint program
, GLint location
, GLsizei count
,
1617 GLboolean transpose
, const GLdouble
* value
)
1619 GET_CURRENT_CONTEXT(ctx
);
1620 struct gl_shader_program
*shProg
=
1621 _mesa_lookup_shader_program_err(ctx
, program
,
1622 "glProgramUniformMatrix4x2dv");
1623 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1624 ctx
, shProg
, 4, 2, GLSL_TYPE_DOUBLE
);
1628 _mesa_ProgramUniformMatrix3x4dv(GLuint program
, GLint location
, GLsizei count
,
1629 GLboolean transpose
, const GLdouble
* value
)
1631 GET_CURRENT_CONTEXT(ctx
);
1632 struct gl_shader_program
*shProg
=
1633 _mesa_lookup_shader_program_err(ctx
, program
,
1634 "glProgramUniformMatrix3x4dv");
1635 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1636 ctx
, shProg
, 3, 4, GLSL_TYPE_DOUBLE
);
1640 _mesa_ProgramUniformMatrix4x3dv(GLuint program
, GLint location
, GLsizei count
,
1641 GLboolean transpose
, const GLdouble
* value
)
1643 GET_CURRENT_CONTEXT(ctx
);
1644 struct gl_shader_program
*shProg
=
1645 _mesa_lookup_shader_program_err(ctx
, program
,
1646 "glProgramUniformMatrix4x3dv");
1647 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1648 ctx
, shProg
, 4, 3, GLSL_TYPE_DOUBLE
);
1652 _mesa_Uniform1i64ARB(GLint location
, GLint64 v0
)
1654 GET_CURRENT_CONTEXT(ctx
);
1655 _mesa_uniform(location
, 1, &v0
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT64
, 1);
1659 _mesa_Uniform2i64ARB(GLint location
, GLint64 v0
, GLint64 v1
)
1661 GET_CURRENT_CONTEXT(ctx
);
1665 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT64
, 2);
1669 _mesa_Uniform3i64ARB(GLint location
, GLint64 v0
, GLint64 v1
, GLint64 v2
)
1671 GET_CURRENT_CONTEXT(ctx
);
1676 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT64
, 3);
1680 _mesa_Uniform4i64ARB(GLint location
, GLint64 v0
, GLint64 v1
, GLint64 v2
, GLint64 v3
)
1682 GET_CURRENT_CONTEXT(ctx
);
1688 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT64
, 4);
1692 _mesa_Uniform1i64vARB(GLint location
, GLsizei count
, const GLint64
*value
)
1694 GET_CURRENT_CONTEXT(ctx
);
1695 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT64
, 1);
1699 _mesa_Uniform2i64vARB(GLint location
, GLsizei count
, const GLint64
*value
)
1701 GET_CURRENT_CONTEXT(ctx
);
1702 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT64
, 2);
1706 _mesa_Uniform3i64vARB(GLint location
, GLsizei count
, const GLint64
*value
)
1708 GET_CURRENT_CONTEXT(ctx
);
1709 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT64
, 3);
1713 _mesa_Uniform4i64vARB(GLint location
, GLsizei count
, const GLint64
*value
)
1715 GET_CURRENT_CONTEXT(ctx
);
1716 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT64
, 4);
1720 _mesa_Uniform1ui64ARB(GLint location
, GLuint64 v0
)
1722 GET_CURRENT_CONTEXT(ctx
);
1723 _mesa_uniform(location
, 1, &v0
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT64
, 1);
1727 _mesa_Uniform2ui64ARB(GLint location
, GLuint64 v0
, GLuint64 v1
)
1729 GET_CURRENT_CONTEXT(ctx
);
1733 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT64
, 2);
1737 _mesa_Uniform3ui64ARB(GLint location
, GLuint64 v0
, GLuint64 v1
, GLuint64 v2
)
1739 GET_CURRENT_CONTEXT(ctx
);
1744 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT64
, 3);
1748 _mesa_Uniform4ui64ARB(GLint location
, GLuint64 v0
, GLuint64 v1
, GLuint64 v2
, GLuint64 v3
)
1750 GET_CURRENT_CONTEXT(ctx
);
1756 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT64
, 4);
1760 _mesa_Uniform1ui64vARB(GLint location
, GLsizei count
, const GLuint64
*value
)
1762 GET_CURRENT_CONTEXT(ctx
);
1763 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT64
, 1);
1767 _mesa_Uniform2ui64vARB(GLint location
, GLsizei count
, const GLuint64
*value
)
1769 GET_CURRENT_CONTEXT(ctx
);
1770 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT64
, 2);
1774 _mesa_Uniform3ui64vARB(GLint location
, GLsizei count
, const GLuint64
*value
)
1776 GET_CURRENT_CONTEXT(ctx
);
1777 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT64
, 3);
1781 _mesa_Uniform4ui64vARB(GLint location
, GLsizei count
, const GLuint64
*value
)
1783 GET_CURRENT_CONTEXT(ctx
);
1784 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT64
, 4);
1787 /* DSA entrypoints */
1789 _mesa_ProgramUniform1i64ARB(GLuint program
, GLint location
, GLint64 v0
)
1791 GET_CURRENT_CONTEXT(ctx
);
1792 struct gl_shader_program
*shProg
=
1793 _mesa_lookup_shader_program_err(ctx
, program
,
1794 "glProgramUniform1i64ARB");
1795 _mesa_uniform(location
, 1, &v0
, ctx
, shProg
, GLSL_TYPE_INT64
, 1);
1799 _mesa_ProgramUniform2i64ARB(GLuint program
, GLint location
, GLint64 v0
, GLint64 v1
)
1801 GET_CURRENT_CONTEXT(ctx
);
1802 struct gl_shader_program
*shProg
=
1803 _mesa_lookup_shader_program_err(ctx
, program
,
1804 "glProgramUniform2i64ARB");
1808 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_INT64
, 2);
1812 _mesa_ProgramUniform3i64ARB(GLuint program
, GLint location
, GLint64 v0
, GLint64 v1
, GLint64 v2
)
1814 GET_CURRENT_CONTEXT(ctx
);
1815 struct gl_shader_program
*shProg
=
1816 _mesa_lookup_shader_program_err(ctx
, program
,
1817 "glProgramUniform3i64ARB");
1822 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_INT64
, 3);
1826 _mesa_ProgramUniform4i64ARB(GLuint program
, GLint location
, GLint64 v0
, GLint64 v1
, GLint64 v2
, GLint64 v3
)
1828 GET_CURRENT_CONTEXT(ctx
);
1829 struct gl_shader_program
*shProg
=
1830 _mesa_lookup_shader_program_err(ctx
, program
,
1831 "glProgramUniform4i64ARB");
1837 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_INT64
, 4);
1841 _mesa_ProgramUniform1i64vARB(GLuint program
, GLint location
, GLsizei count
, const GLint64
*value
)
1843 GET_CURRENT_CONTEXT(ctx
);
1844 struct gl_shader_program
*shProg
=
1845 _mesa_lookup_shader_program_err(ctx
, program
,
1846 "glProgramUniform1i64vARB");
1847 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_INT64
, 1);
1851 _mesa_ProgramUniform2i64vARB(GLuint program
, GLint location
, GLsizei count
, const GLint64
*value
)
1853 GET_CURRENT_CONTEXT(ctx
);
1854 struct gl_shader_program
*shProg
=
1855 _mesa_lookup_shader_program_err(ctx
, program
,
1856 "glProgramUniform2i64vARB");
1857 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_INT64
, 2);
1861 _mesa_ProgramUniform3i64vARB(GLuint program
, GLint location
, GLsizei count
, const GLint64
*value
)
1863 GET_CURRENT_CONTEXT(ctx
);
1864 struct gl_shader_program
*shProg
=
1865 _mesa_lookup_shader_program_err(ctx
, program
,
1866 "glProgramUniform3i64vARB");
1867 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_INT64
, 3);
1871 _mesa_ProgramUniform4i64vARB(GLuint program
, GLint location
, GLsizei count
, const GLint64
*value
)
1873 GET_CURRENT_CONTEXT(ctx
);
1874 struct gl_shader_program
*shProg
=
1875 _mesa_lookup_shader_program_err(ctx
, program
,
1876 "glProgramUniform4i64vARB");
1877 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_INT64
, 4);
1881 _mesa_ProgramUniform1ui64ARB(GLuint program
, GLint location
, GLuint64 v0
)
1883 GET_CURRENT_CONTEXT(ctx
);
1884 struct gl_shader_program
*shProg
=
1885 _mesa_lookup_shader_program_err(ctx
, program
,
1886 "glProgramUniform1ui64ARB");
1887 _mesa_uniform(location
, 1, &v0
, ctx
, shProg
, GLSL_TYPE_UINT64
, 1);
1891 _mesa_ProgramUniform2ui64ARB(GLuint program
, GLint location
, GLuint64 v0
, GLuint64 v1
)
1893 GET_CURRENT_CONTEXT(ctx
);
1894 struct gl_shader_program
*shProg
=
1895 _mesa_lookup_shader_program_err(ctx
, program
,
1896 "glProgramUniform2ui64ARB");
1900 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_UINT64
, 2);
1904 _mesa_ProgramUniform3ui64ARB(GLuint program
, GLint location
, GLuint64 v0
, GLuint64 v1
, GLuint64 v2
)
1906 GET_CURRENT_CONTEXT(ctx
);
1907 struct gl_shader_program
*shProg
=
1908 _mesa_lookup_shader_program_err(ctx
, program
,
1909 "glProgramUniform3ui64ARB");
1914 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_UINT64
, 3);
1918 _mesa_ProgramUniform4ui64ARB(GLuint program
, GLint location
, GLuint64 v0
, GLuint64 v1
, GLuint64 v2
, GLuint64 v3
)
1920 GET_CURRENT_CONTEXT(ctx
);
1921 struct gl_shader_program
*shProg
=
1922 _mesa_lookup_shader_program_err(ctx
, program
,
1923 "glProgramUniform4ui64ARB");
1929 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_UINT64
, 4);
1933 _mesa_ProgramUniform1ui64vARB(GLuint program
, GLint location
, GLsizei count
, const GLuint64
*value
)
1935 GET_CURRENT_CONTEXT(ctx
);
1936 struct gl_shader_program
*shProg
=
1937 _mesa_lookup_shader_program_err(ctx
, program
,
1938 "glProgramUniform1ui64vARB");
1939 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_UINT64
, 1);
1943 _mesa_ProgramUniform2ui64vARB(GLuint program
, GLint location
, GLsizei count
, const GLuint64
*value
)
1945 GET_CURRENT_CONTEXT(ctx
);
1946 struct gl_shader_program
*shProg
=
1947 _mesa_lookup_shader_program_err(ctx
, program
,
1948 "glProgramUniform2ui64vARB");
1949 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_UINT64
, 2);
1953 _mesa_ProgramUniform3ui64vARB(GLuint program
, GLint location
, GLsizei count
, const GLuint64
*value
)
1955 GET_CURRENT_CONTEXT(ctx
);
1956 struct gl_shader_program
*shProg
=
1957 _mesa_lookup_shader_program_err(ctx
, program
,
1958 "glProgramUniform3ui64vARB");
1959 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_UINT64
, 3);
1963 _mesa_ProgramUniform4ui64vARB(GLuint program
, GLint location
, GLsizei count
, const GLuint64
*value
)
1965 GET_CURRENT_CONTEXT(ctx
);
1966 struct gl_shader_program
*shProg
=
1967 _mesa_lookup_shader_program_err(ctx
, program
,
1968 "glProgramUniform4ui64vARB");
1969 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_UINT64
, 4);