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 update_single_shader_texture_used(struct gl_shader_program
*shProg
,
68 struct gl_program
*prog
,
69 GLuint unit
, GLuint target
)
71 gl_shader_stage prog_stage
=
72 _mesa_program_enum_to_shader_stage(prog
->Target
);
74 assert(unit
< ARRAY_SIZE(prog
->TexturesUsed
));
75 assert(target
< NUM_TEXTURE_TARGETS
);
77 /* From section 7.10 (Samplers) of the OpenGL 4.5 spec:
79 * "It is not allowed to have variables of different sampler types pointing
80 * to the same texture image unit within a program object."
82 unsigned stages_mask
= shProg
->data
->linked_stages
;
84 const int stage
= u_bit_scan(&stages_mask
);
86 /* Skip validation if we are yet to update textures used in this
89 if (prog_stage
< stage
)
92 struct gl_program
*glprog
= shProg
->_LinkedShaders
[stage
]->Program
;
93 if (glprog
->TexturesUsed
[unit
] & ~(1 << target
))
94 shProg
->SamplersValidated
= GL_FALSE
;
97 prog
->TexturesUsed
[unit
] |= (1 << target
);
101 _mesa_update_shader_textures_used(struct gl_shader_program
*shProg
,
102 struct gl_program
*prog
)
104 GLbitfield mask
= prog
->SamplersUsed
;
105 gl_shader_stage prog_stage
=
106 _mesa_program_enum_to_shader_stage(prog
->Target
);
107 struct gl_linked_shader
*shader
= shProg
->_LinkedShaders
[prog_stage
];
112 memset(prog
->TexturesUsed
, 0, sizeof(prog
->TexturesUsed
));
115 s
= u_bit_scan(&mask
);
117 update_single_shader_texture_used(shProg
, prog
,
118 prog
->SamplerUnits
[s
],
119 prog
->sh
.SamplerTargets
[s
]);
122 if (unlikely(prog
->sh
.HasBoundBindlessSampler
)) {
123 /* Loop over bindless samplers bound to texture units.
125 for (s
= 0; s
< prog
->sh
.NumBindlessSamplers
; s
++) {
126 struct gl_bindless_sampler
*sampler
= &prog
->sh
.BindlessSamplers
[s
];
131 update_single_shader_texture_used(shProg
, prog
, sampler
->unit
,
138 * Connect a piece of driver storage with a part of a uniform
140 * \param uni The uniform with which the storage will be associated
141 * \param element_stride Byte-stride between array elements.
142 * \sa gl_uniform_driver_storage::element_stride.
143 * \param vector_stride Byte-stride between vectors (in a matrix).
144 * \sa gl_uniform_driver_storage::vector_stride.
145 * \param format Conversion from native format to driver format
146 * required by the driver.
147 * \param data Location to dump the data.
150 _mesa_uniform_attach_driver_storage(struct gl_uniform_storage
*uni
,
151 unsigned element_stride
,
152 unsigned vector_stride
,
153 enum gl_uniform_driver_format format
,
156 uni
->driver_storage
=
157 realloc(uni
->driver_storage
,
158 sizeof(struct gl_uniform_driver_storage
)
159 * (uni
->num_driver_storage
+ 1));
161 uni
->driver_storage
[uni
->num_driver_storage
].element_stride
= element_stride
;
162 uni
->driver_storage
[uni
->num_driver_storage
].vector_stride
= vector_stride
;
163 uni
->driver_storage
[uni
->num_driver_storage
].format
= format
;
164 uni
->driver_storage
[uni
->num_driver_storage
].data
= data
;
166 uni
->num_driver_storage
++;
170 * Sever all connections with all pieces of driver storage for all uniforms
173 * This function does \b not release any of the \c data pointers
174 * previously passed in to \c _mesa_uniform_attach_driver_stoarge.
177 _mesa_uniform_detach_all_driver_storage(struct gl_uniform_storage
*uni
)
179 free(uni
->driver_storage
);
180 uni
->driver_storage
= NULL
;
181 uni
->num_driver_storage
= 0;
185 _mesa_Uniform1f(GLint location
, GLfloat v0
)
187 GET_CURRENT_CONTEXT(ctx
);
188 _mesa_uniform(location
, 1, &v0
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_FLOAT
, 1);
192 _mesa_Uniform2f(GLint location
, GLfloat v0
, GLfloat v1
)
194 GET_CURRENT_CONTEXT(ctx
);
198 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_FLOAT
, 2);
202 _mesa_Uniform3f(GLint location
, GLfloat v0
, GLfloat v1
, GLfloat v2
)
204 GET_CURRENT_CONTEXT(ctx
);
209 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_FLOAT
, 3);
213 _mesa_Uniform4f(GLint location
, GLfloat v0
, GLfloat v1
, GLfloat v2
,
216 GET_CURRENT_CONTEXT(ctx
);
222 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_FLOAT
, 4);
226 _mesa_Uniform1i(GLint location
, GLint v0
)
228 GET_CURRENT_CONTEXT(ctx
);
229 _mesa_uniform(location
, 1, &v0
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT
, 1);
233 _mesa_Uniform2i(GLint location
, GLint v0
, GLint v1
)
235 GET_CURRENT_CONTEXT(ctx
);
239 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT
, 2);
243 _mesa_Uniform3i(GLint location
, GLint v0
, GLint v1
, GLint v2
)
245 GET_CURRENT_CONTEXT(ctx
);
250 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT
, 3);
254 _mesa_Uniform4i(GLint location
, GLint v0
, GLint v1
, GLint v2
, GLint v3
)
256 GET_CURRENT_CONTEXT(ctx
);
262 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT
, 4);
266 _mesa_Uniform1fv(GLint location
, GLsizei count
, const GLfloat
* value
)
268 GET_CURRENT_CONTEXT(ctx
);
269 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_FLOAT
, 1);
273 _mesa_Uniform2fv(GLint location
, GLsizei count
, const GLfloat
* value
)
275 GET_CURRENT_CONTEXT(ctx
);
276 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_FLOAT
, 2);
280 _mesa_Uniform3fv(GLint location
, GLsizei count
, const GLfloat
* value
)
282 GET_CURRENT_CONTEXT(ctx
);
283 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_FLOAT
, 3);
287 _mesa_Uniform4fv(GLint location
, GLsizei count
, const GLfloat
* value
)
289 GET_CURRENT_CONTEXT(ctx
);
290 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_FLOAT
, 4);
294 _mesa_Uniform1iv(GLint location
, GLsizei count
, const GLint
* value
)
296 GET_CURRENT_CONTEXT(ctx
);
297 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT
, 1);
301 _mesa_Uniform2iv(GLint location
, GLsizei count
, const GLint
* value
)
303 GET_CURRENT_CONTEXT(ctx
);
304 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT
, 2);
308 _mesa_Uniform3iv(GLint location
, GLsizei count
, const GLint
* value
)
310 GET_CURRENT_CONTEXT(ctx
);
311 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT
, 3);
315 _mesa_Uniform4iv(GLint location
, GLsizei count
, const GLint
* value
)
317 GET_CURRENT_CONTEXT(ctx
);
318 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT
, 4);
322 _mesa_UniformHandleui64ARB(GLint location
, GLuint64 value
)
324 GET_CURRENT_CONTEXT(ctx
);
325 _mesa_uniform_handle(location
, 1, &value
, ctx
, ctx
->_Shader
->ActiveProgram
);
329 _mesa_UniformHandleui64vARB(GLint location
, GLsizei count
,
330 const GLuint64
*value
)
332 GET_CURRENT_CONTEXT(ctx
);
333 _mesa_uniform_handle(location
, count
, value
, ctx
,
334 ctx
->_Shader
->ActiveProgram
);
338 /** Same as above with direct state access **/
340 _mesa_ProgramUniform1f(GLuint program
, GLint location
, GLfloat v0
)
342 GET_CURRENT_CONTEXT(ctx
);
343 struct gl_shader_program
*shProg
=
344 _mesa_lookup_shader_program_err(ctx
, program
,
345 "glProgramUniform1f");
346 _mesa_uniform(location
, 1, &v0
, ctx
, shProg
, GLSL_TYPE_FLOAT
, 1);
350 _mesa_ProgramUniform2f(GLuint program
, GLint location
, GLfloat v0
, GLfloat v1
)
352 GET_CURRENT_CONTEXT(ctx
);
354 struct gl_shader_program
*shProg
;
357 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform2f");
358 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_FLOAT
, 2);
362 _mesa_ProgramUniform3f(GLuint program
, GLint location
, GLfloat v0
, GLfloat v1
,
365 GET_CURRENT_CONTEXT(ctx
);
367 struct gl_shader_program
*shProg
;
371 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform3f");
372 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_FLOAT
, 3);
376 _mesa_ProgramUniform4f(GLuint program
, GLint location
, GLfloat v0
, GLfloat v1
,
377 GLfloat v2
, GLfloat v3
)
379 GET_CURRENT_CONTEXT(ctx
);
381 struct gl_shader_program
*shProg
;
386 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform4f");
387 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_FLOAT
, 4);
391 _mesa_ProgramUniform1i(GLuint program
, GLint location
, GLint v0
)
393 GET_CURRENT_CONTEXT(ctx
);
394 struct gl_shader_program
*shProg
=
395 _mesa_lookup_shader_program_err(ctx
, program
,
396 "glProgramUniform1i");
397 _mesa_uniform(location
, 1, &v0
, ctx
, shProg
, GLSL_TYPE_INT
, 1);
401 _mesa_ProgramUniform2i(GLuint program
, GLint location
, GLint v0
, GLint v1
)
403 GET_CURRENT_CONTEXT(ctx
);
405 struct gl_shader_program
*shProg
;
408 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform2i");
409 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_INT
, 2);
413 _mesa_ProgramUniform3i(GLuint program
, GLint location
, GLint v0
, GLint v1
,
416 GET_CURRENT_CONTEXT(ctx
);
418 struct gl_shader_program
*shProg
;
422 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform3i");
423 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_INT
, 3);
427 _mesa_ProgramUniform4i(GLuint program
, GLint location
, GLint v0
, GLint v1
,
430 GET_CURRENT_CONTEXT(ctx
);
432 struct gl_shader_program
*shProg
;
437 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform4i");
438 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_INT
, 4);
442 _mesa_ProgramUniform1fv(GLuint program
, GLint location
, GLsizei count
,
443 const GLfloat
* value
)
445 GET_CURRENT_CONTEXT(ctx
);
446 struct gl_shader_program
*shProg
=
447 _mesa_lookup_shader_program_err(ctx
, program
,
448 "glProgramUniform1fv");
449 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_FLOAT
, 1);
453 _mesa_ProgramUniform2fv(GLuint program
, GLint location
, GLsizei count
,
454 const GLfloat
* value
)
456 GET_CURRENT_CONTEXT(ctx
);
457 struct gl_shader_program
*shProg
=
458 _mesa_lookup_shader_program_err(ctx
, program
,
459 "glProgramUniform2fv");
460 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_FLOAT
, 2);
464 _mesa_ProgramUniform3fv(GLuint program
, GLint location
, GLsizei count
,
465 const GLfloat
* value
)
467 GET_CURRENT_CONTEXT(ctx
);
468 struct gl_shader_program
*shProg
=
469 _mesa_lookup_shader_program_err(ctx
, program
,
470 "glProgramUniform3fv");
471 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_FLOAT
, 3);
475 _mesa_ProgramUniform4fv(GLuint program
, GLint location
, GLsizei count
,
476 const GLfloat
* value
)
478 GET_CURRENT_CONTEXT(ctx
);
479 struct gl_shader_program
*shProg
=
480 _mesa_lookup_shader_program_err(ctx
, program
,
481 "glProgramUniform4fv");
482 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_FLOAT
, 4);
486 _mesa_ProgramUniform1iv(GLuint program
, GLint location
, GLsizei count
,
489 GET_CURRENT_CONTEXT(ctx
);
490 struct gl_shader_program
*shProg
=
491 _mesa_lookup_shader_program_err(ctx
, program
,
492 "glProgramUniform1iv");
493 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_INT
, 1);
497 _mesa_ProgramUniform2iv(GLuint program
, GLint location
, GLsizei count
,
500 GET_CURRENT_CONTEXT(ctx
);
501 struct gl_shader_program
*shProg
=
502 _mesa_lookup_shader_program_err(ctx
, program
,
503 "glProgramUniform2iv");
504 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_INT
, 2);
508 _mesa_ProgramUniform3iv(GLuint program
, GLint location
, GLsizei count
,
511 GET_CURRENT_CONTEXT(ctx
);
512 struct gl_shader_program
*shProg
=
513 _mesa_lookup_shader_program_err(ctx
, program
,
514 "glProgramUniform3iv");
515 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_INT
, 3);
519 _mesa_ProgramUniform4iv(GLuint program
, GLint location
, GLsizei count
,
522 GET_CURRENT_CONTEXT(ctx
);
523 struct gl_shader_program
*shProg
=
524 _mesa_lookup_shader_program_err(ctx
, program
,
525 "glProgramUniform4iv");
526 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_INT
, 4);
530 _mesa_ProgramUniformHandleui64ARB(GLuint program
, GLint location
,
533 GET_CURRENT_CONTEXT(ctx
);
534 struct gl_shader_program
*shProg
=
535 _mesa_lookup_shader_program_err(ctx
, program
,
536 "glProgramUniformHandleui64ARB");
537 _mesa_uniform_handle(location
, 1, &value
, ctx
, shProg
);
541 _mesa_ProgramUniformHandleui64vARB(GLuint program
, GLint location
,
542 GLsizei count
, const GLuint64
*values
)
544 GET_CURRENT_CONTEXT(ctx
);
545 struct gl_shader_program
*shProg
=
546 _mesa_lookup_shader_program_err(ctx
, program
,
547 "glProgramUniformHandleui64vARB");
548 _mesa_uniform_handle(location
, count
, values
, ctx
, shProg
);
552 /** OpenGL 3.0 GLuint-valued functions **/
554 _mesa_Uniform1ui(GLint location
, GLuint v0
)
556 GET_CURRENT_CONTEXT(ctx
);
557 _mesa_uniform(location
, 1, &v0
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT
, 1);
561 _mesa_Uniform2ui(GLint location
, GLuint v0
, GLuint v1
)
563 GET_CURRENT_CONTEXT(ctx
);
567 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT
, 2);
571 _mesa_Uniform3ui(GLint location
, GLuint v0
, GLuint v1
, GLuint v2
)
573 GET_CURRENT_CONTEXT(ctx
);
578 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT
, 3);
582 _mesa_Uniform4ui(GLint location
, GLuint v0
, GLuint v1
, GLuint v2
, GLuint v3
)
584 GET_CURRENT_CONTEXT(ctx
);
590 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT
, 4);
594 _mesa_Uniform1uiv(GLint location
, GLsizei count
, const GLuint
*value
)
596 GET_CURRENT_CONTEXT(ctx
);
597 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT
, 1);
601 _mesa_Uniform2uiv(GLint location
, GLsizei count
, const GLuint
*value
)
603 GET_CURRENT_CONTEXT(ctx
);
604 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT
, 2);
608 _mesa_Uniform3uiv(GLint location
, GLsizei count
, const GLuint
*value
)
610 GET_CURRENT_CONTEXT(ctx
);
611 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT
, 3);
615 _mesa_Uniform4uiv(GLint location
, GLsizei count
, const GLuint
*value
)
617 GET_CURRENT_CONTEXT(ctx
);
618 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT
, 4);
624 _mesa_UniformMatrix2fv(GLint location
, GLsizei count
, GLboolean transpose
,
625 const GLfloat
* value
)
627 GET_CURRENT_CONTEXT(ctx
);
628 _mesa_uniform_matrix(location
, count
, transpose
, value
,
629 ctx
, ctx
->_Shader
->ActiveProgram
, 2, 2, GLSL_TYPE_FLOAT
);
633 _mesa_UniformMatrix3fv(GLint location
, GLsizei count
, GLboolean transpose
,
634 const GLfloat
* value
)
636 GET_CURRENT_CONTEXT(ctx
);
637 _mesa_uniform_matrix(location
, count
, transpose
, value
,
638 ctx
, ctx
->_Shader
->ActiveProgram
, 3, 3, GLSL_TYPE_FLOAT
);
642 _mesa_UniformMatrix4fv(GLint location
, GLsizei count
, GLboolean transpose
,
643 const GLfloat
* value
)
645 GET_CURRENT_CONTEXT(ctx
);
646 _mesa_uniform_matrix(location
, count
, transpose
, value
,
647 ctx
, ctx
->_Shader
->ActiveProgram
, 4, 4, GLSL_TYPE_FLOAT
);
650 /** Same as above with direct state access **/
653 _mesa_ProgramUniform1ui(GLuint program
, GLint location
, GLuint v0
)
655 GET_CURRENT_CONTEXT(ctx
);
656 struct gl_shader_program
*shProg
=
657 _mesa_lookup_shader_program_err(ctx
, program
,
658 "glProgramUniform1ui");
659 _mesa_uniform(location
, 1, &v0
, ctx
, shProg
, GLSL_TYPE_UINT
, 1);
663 _mesa_ProgramUniform2ui(GLuint program
, GLint location
, GLuint v0
, GLuint v1
)
665 GET_CURRENT_CONTEXT(ctx
);
667 struct gl_shader_program
*shProg
;
670 shProg
= _mesa_lookup_shader_program_err(ctx
, program
,
671 "glProgramUniform2ui");
672 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_UINT
, 2);
676 _mesa_ProgramUniform3ui(GLuint program
, GLint location
, GLuint v0
, GLuint v1
,
679 GET_CURRENT_CONTEXT(ctx
);
681 struct gl_shader_program
*shProg
;
685 shProg
= _mesa_lookup_shader_program_err(ctx
, program
,
686 "glProgramUniform3ui");
687 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_UINT
, 3);
691 _mesa_ProgramUniform4ui(GLuint program
, GLint location
, GLuint v0
, GLuint v1
,
692 GLuint v2
, GLuint v3
)
694 GET_CURRENT_CONTEXT(ctx
);
696 struct gl_shader_program
*shProg
;
701 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform4ui");
702 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_UINT
, 4);
706 _mesa_ProgramUniform1uiv(GLuint program
, GLint location
, GLsizei count
,
709 GET_CURRENT_CONTEXT(ctx
);
710 struct gl_shader_program
*shProg
=
711 _mesa_lookup_shader_program_err(ctx
, program
,
712 "glProgramUniform1uiv");
713 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_UINT
, 1);
717 _mesa_ProgramUniform2uiv(GLuint program
, GLint location
, GLsizei count
,
720 GET_CURRENT_CONTEXT(ctx
);
721 struct gl_shader_program
*shProg
=
722 _mesa_lookup_shader_program_err(ctx
, program
,
723 "glProgramUniform2uiv");
724 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_UINT
, 2);
728 _mesa_ProgramUniform3uiv(GLuint program
, GLint location
, GLsizei count
,
731 GET_CURRENT_CONTEXT(ctx
);
732 struct gl_shader_program
*shProg
=
733 _mesa_lookup_shader_program_err(ctx
, program
,
734 "glProgramUniform3uiv");
735 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_UINT
, 3);
739 _mesa_ProgramUniform4uiv(GLuint program
, GLint location
, GLsizei count
,
742 GET_CURRENT_CONTEXT(ctx
);
743 struct gl_shader_program
*shProg
=
744 _mesa_lookup_shader_program_err(ctx
, program
,
745 "glProgramUniform4uiv");
746 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_UINT
, 4);
752 _mesa_ProgramUniformMatrix2fv(GLuint program
, GLint location
, GLsizei count
,
753 GLboolean transpose
, const GLfloat
* value
)
755 GET_CURRENT_CONTEXT(ctx
);
756 struct gl_shader_program
*shProg
=
757 _mesa_lookup_shader_program_err(ctx
, program
,
758 "glProgramUniformMatrix2fv");
759 _mesa_uniform_matrix(location
, count
, transpose
, value
, ctx
, shProg
, 2, 2, GLSL_TYPE_FLOAT
);
763 _mesa_ProgramUniformMatrix3fv(GLuint program
, GLint location
, GLsizei count
,
764 GLboolean transpose
, const GLfloat
* value
)
766 GET_CURRENT_CONTEXT(ctx
);
767 struct gl_shader_program
*shProg
=
768 _mesa_lookup_shader_program_err(ctx
, program
,
769 "glProgramUniformMatrix3fv");
770 _mesa_uniform_matrix(location
, count
, transpose
, value
, ctx
, shProg
, 3, 3, GLSL_TYPE_FLOAT
);
774 _mesa_ProgramUniformMatrix4fv(GLuint program
, GLint location
, GLsizei count
,
775 GLboolean transpose
, const GLfloat
* value
)
777 GET_CURRENT_CONTEXT(ctx
);
778 struct gl_shader_program
*shProg
=
779 _mesa_lookup_shader_program_err(ctx
, program
,
780 "glProgramUniformMatrix4fv");
781 _mesa_uniform_matrix(location
, count
, transpose
, value
, ctx
, shProg
, 4, 4, GLSL_TYPE_FLOAT
);
786 * Non-square UniformMatrix are OpenGL 2.1
789 _mesa_UniformMatrix2x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
790 const GLfloat
*value
)
792 GET_CURRENT_CONTEXT(ctx
);
793 _mesa_uniform_matrix(location
, count
, transpose
, value
,
794 ctx
, ctx
->_Shader
->ActiveProgram
, 2, 3, GLSL_TYPE_FLOAT
);
798 _mesa_UniformMatrix3x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
799 const GLfloat
*value
)
801 GET_CURRENT_CONTEXT(ctx
);
802 _mesa_uniform_matrix(location
, count
, transpose
, value
,
803 ctx
, ctx
->_Shader
->ActiveProgram
, 3, 2, GLSL_TYPE_FLOAT
);
807 _mesa_UniformMatrix2x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
808 const GLfloat
*value
)
810 GET_CURRENT_CONTEXT(ctx
);
811 _mesa_uniform_matrix(location
, count
, transpose
, value
,
812 ctx
, ctx
->_Shader
->ActiveProgram
, 2, 4, GLSL_TYPE_FLOAT
);
816 _mesa_UniformMatrix4x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
817 const GLfloat
*value
)
819 GET_CURRENT_CONTEXT(ctx
);
820 _mesa_uniform_matrix(location
, count
, transpose
, value
,
821 ctx
, ctx
->_Shader
->ActiveProgram
, 4, 2, GLSL_TYPE_FLOAT
);
825 _mesa_UniformMatrix3x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
826 const GLfloat
*value
)
828 GET_CURRENT_CONTEXT(ctx
);
829 _mesa_uniform_matrix(location
, count
, transpose
, value
,
830 ctx
, ctx
->_Shader
->ActiveProgram
, 3, 4, GLSL_TYPE_FLOAT
);
834 _mesa_UniformMatrix4x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
835 const GLfloat
*value
)
837 GET_CURRENT_CONTEXT(ctx
);
838 _mesa_uniform_matrix(location
, count
, transpose
, value
,
839 ctx
, ctx
->_Shader
->ActiveProgram
, 4, 3, GLSL_TYPE_FLOAT
);
842 /** Same as above with direct state access **/
845 _mesa_ProgramUniformMatrix2x3fv(GLuint program
, GLint location
, GLsizei count
,
846 GLboolean transpose
, const GLfloat
* value
)
848 GET_CURRENT_CONTEXT(ctx
);
849 struct gl_shader_program
*shProg
=
850 _mesa_lookup_shader_program_err(ctx
, program
,
851 "glProgramUniformMatrix2x3fv");
852 _mesa_uniform_matrix(location
, count
, transpose
, value
, ctx
, shProg
, 2, 3, GLSL_TYPE_FLOAT
);
856 _mesa_ProgramUniformMatrix3x2fv(GLuint program
, GLint location
, GLsizei count
,
857 GLboolean transpose
, const GLfloat
* value
)
859 GET_CURRENT_CONTEXT(ctx
);
860 struct gl_shader_program
*shProg
=
861 _mesa_lookup_shader_program_err(ctx
, program
,
862 "glProgramUniformMatrix3x2fv");
863 _mesa_uniform_matrix(location
, count
, transpose
, value
, ctx
, shProg
, 3, 2, GLSL_TYPE_FLOAT
);
867 _mesa_ProgramUniformMatrix2x4fv(GLuint program
, GLint location
, GLsizei count
,
868 GLboolean transpose
, const GLfloat
* value
)
870 GET_CURRENT_CONTEXT(ctx
);
871 struct gl_shader_program
*shProg
=
872 _mesa_lookup_shader_program_err(ctx
, program
,
873 "glProgramUniformMatrix2x4fv");
874 _mesa_uniform_matrix(location
, count
, transpose
, value
, ctx
, shProg
, 2, 4, GLSL_TYPE_FLOAT
);
878 _mesa_ProgramUniformMatrix4x2fv(GLuint program
, GLint location
, GLsizei count
,
879 GLboolean transpose
, const GLfloat
* value
)
881 GET_CURRENT_CONTEXT(ctx
);
882 struct gl_shader_program
*shProg
=
883 _mesa_lookup_shader_program_err(ctx
, program
,
884 "glProgramUniformMatrix4x2fv");
885 _mesa_uniform_matrix(location
, count
, transpose
, value
, ctx
, shProg
, 4, 2, GLSL_TYPE_FLOAT
);
889 _mesa_ProgramUniformMatrix3x4fv(GLuint program
, GLint location
, GLsizei count
,
890 GLboolean transpose
, const GLfloat
* value
)
892 GET_CURRENT_CONTEXT(ctx
);
893 struct gl_shader_program
*shProg
=
894 _mesa_lookup_shader_program_err(ctx
, program
,
895 "glProgramUniformMatrix3x4fv");
896 _mesa_uniform_matrix(location
, count
, transpose
, value
, ctx
, shProg
, 3, 4, GLSL_TYPE_FLOAT
);
900 _mesa_ProgramUniformMatrix4x3fv(GLuint program
, GLint location
, GLsizei count
,
901 GLboolean transpose
, const GLfloat
* value
)
903 GET_CURRENT_CONTEXT(ctx
);
904 struct gl_shader_program
*shProg
=
905 _mesa_lookup_shader_program_err(ctx
, program
,
906 "glProgramUniformMatrix4x3fv");
907 _mesa_uniform_matrix(location
, count
, transpose
, value
, ctx
, shProg
, 4, 3, GLSL_TYPE_FLOAT
);
912 _mesa_GetnUniformfvARB(GLuint program
, GLint location
,
913 GLsizei bufSize
, GLfloat
*params
)
915 GET_CURRENT_CONTEXT(ctx
);
916 _mesa_get_uniform(ctx
, program
, location
, bufSize
, GLSL_TYPE_FLOAT
, params
);
920 _mesa_GetUniformfv(GLuint program
, GLint location
, GLfloat
*params
)
922 _mesa_GetnUniformfvARB(program
, location
, INT_MAX
, params
);
927 _mesa_GetnUniformivARB(GLuint program
, GLint location
,
928 GLsizei bufSize
, GLint
*params
)
930 GET_CURRENT_CONTEXT(ctx
);
931 _mesa_get_uniform(ctx
, program
, location
, bufSize
, GLSL_TYPE_INT
, params
);
935 _mesa_GetUniformiv(GLuint program
, GLint location
, GLint
*params
)
937 _mesa_GetnUniformivARB(program
, location
, INT_MAX
, params
);
943 _mesa_GetnUniformuivARB(GLuint program
, GLint location
,
944 GLsizei bufSize
, GLuint
*params
)
946 GET_CURRENT_CONTEXT(ctx
);
947 _mesa_get_uniform(ctx
, program
, location
, bufSize
, GLSL_TYPE_UINT
, params
);
951 _mesa_GetUniformuiv(GLuint program
, GLint location
, GLuint
*params
)
953 _mesa_GetnUniformuivARB(program
, location
, INT_MAX
, params
);
959 _mesa_GetnUniformdvARB(GLuint program
, GLint location
,
960 GLsizei bufSize
, GLdouble
*params
)
962 GET_CURRENT_CONTEXT(ctx
);
964 _mesa_get_uniform(ctx
, program
, location
, bufSize
, GLSL_TYPE_DOUBLE
, params
);
968 _mesa_GetUniformdv(GLuint program
, GLint location
, GLdouble
*params
)
970 _mesa_GetnUniformdvARB(program
, location
, INT_MAX
, params
);
974 _mesa_GetnUniformi64vARB(GLuint program
, GLint location
,
975 GLsizei bufSize
, GLint64
*params
)
977 GET_CURRENT_CONTEXT(ctx
);
978 _mesa_get_uniform(ctx
, program
, location
, bufSize
, GLSL_TYPE_INT64
, params
);
981 _mesa_GetUniformi64vARB(GLuint program
, GLint location
, GLint64
*params
)
983 _mesa_GetnUniformi64vARB(program
, location
, INT_MAX
, params
);
987 _mesa_GetnUniformui64vARB(GLuint program
, GLint location
,
988 GLsizei bufSize
, GLuint64
*params
)
990 GET_CURRENT_CONTEXT(ctx
);
991 _mesa_get_uniform(ctx
, program
, location
, bufSize
, GLSL_TYPE_UINT64
, params
);
995 _mesa_GetUniformui64vARB(GLuint program
, GLint location
, GLuint64
*params
)
997 _mesa_GetnUniformui64vARB(program
, location
, INT_MAX
, params
);
1002 _mesa_GetUniformLocation(GLuint programObj
, const GLcharARB
*name
)
1004 struct gl_shader_program
*shProg
;
1006 GET_CURRENT_CONTEXT(ctx
);
1008 shProg
= _mesa_lookup_shader_program_err(ctx
, programObj
,
1009 "glGetUniformLocation");
1013 /* Page 80 (page 94 of the PDF) of the OpenGL 2.1 spec says:
1015 * "If program has not been successfully linked, the error
1016 * INVALID_OPERATION is generated."
1018 if (shProg
->data
->LinkStatus
== linking_failure
) {
1019 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1020 "glGetUniformLocation(program not linked)");
1024 return _mesa_program_resource_location(shProg
, GL_UNIFORM
, name
);
1028 _mesa_GetUniformBlockIndex(GLuint program
,
1029 const GLchar
*uniformBlockName
)
1031 GET_CURRENT_CONTEXT(ctx
);
1032 struct gl_shader_program
*shProg
;
1034 if (!ctx
->Extensions
.ARB_uniform_buffer_object
) {
1035 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glGetUniformBlockIndex");
1036 return GL_INVALID_INDEX
;
1039 shProg
= _mesa_lookup_shader_program_err(ctx
, program
,
1040 "glGetUniformBlockIndex");
1042 return GL_INVALID_INDEX
;
1044 struct gl_program_resource
*res
=
1045 _mesa_program_resource_find_name(shProg
, GL_UNIFORM_BLOCK
,
1046 uniformBlockName
, NULL
);
1048 return GL_INVALID_INDEX
;
1050 return _mesa_program_resource_index(shProg
, res
);
1054 _mesa_GetUniformIndices(GLuint program
,
1055 GLsizei uniformCount
,
1056 const GLchar
* const *uniformNames
,
1057 GLuint
*uniformIndices
)
1059 GET_CURRENT_CONTEXT(ctx
);
1061 struct gl_shader_program
*shProg
;
1063 if (!ctx
->Extensions
.ARB_uniform_buffer_object
) {
1064 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glGetUniformIndices");
1068 shProg
= _mesa_lookup_shader_program_err(ctx
, program
,
1069 "glGetUniformIndices");
1073 if (uniformCount
< 0) {
1074 _mesa_error(ctx
, GL_INVALID_VALUE
,
1075 "glGetUniformIndices(uniformCount < 0)");
1079 for (i
= 0; i
< uniformCount
; i
++) {
1080 struct gl_program_resource
*res
=
1081 _mesa_program_resource_find_name(shProg
, GL_UNIFORM
, uniformNames
[i
],
1083 uniformIndices
[i
] = _mesa_program_resource_index(shProg
, res
);
1088 _mesa_UniformBlockBinding(GLuint program
,
1089 GLuint uniformBlockIndex
,
1090 GLuint uniformBlockBinding
)
1092 GET_CURRENT_CONTEXT(ctx
);
1093 struct gl_shader_program
*shProg
;
1095 if (!ctx
->Extensions
.ARB_uniform_buffer_object
) {
1096 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glUniformBlockBinding");
1100 shProg
= _mesa_lookup_shader_program_err(ctx
, program
,
1101 "glUniformBlockBinding");
1105 if (uniformBlockIndex
>= shProg
->data
->NumUniformBlocks
) {
1106 _mesa_error(ctx
, GL_INVALID_VALUE
,
1107 "glUniformBlockBinding(block index %u >= %u)",
1108 uniformBlockIndex
, shProg
->data
->NumUniformBlocks
);
1112 if (uniformBlockBinding
>= ctx
->Const
.MaxUniformBufferBindings
) {
1113 _mesa_error(ctx
, GL_INVALID_VALUE
,
1114 "glUniformBlockBinding(block binding %u >= %u)",
1115 uniformBlockBinding
, ctx
->Const
.MaxUniformBufferBindings
);
1119 if (shProg
->data
->UniformBlocks
[uniformBlockIndex
].Binding
!=
1120 uniformBlockBinding
) {
1122 FLUSH_VERTICES(ctx
, 0);
1123 ctx
->NewDriverState
|= ctx
->DriverFlags
.NewUniformBuffer
;
1125 shProg
->data
->UniformBlocks
[uniformBlockIndex
].Binding
=
1126 uniformBlockBinding
;
1131 _mesa_ShaderStorageBlockBinding(GLuint program
,
1132 GLuint shaderStorageBlockIndex
,
1133 GLuint shaderStorageBlockBinding
)
1135 GET_CURRENT_CONTEXT(ctx
);
1136 struct gl_shader_program
*shProg
;
1138 if (!ctx
->Extensions
.ARB_shader_storage_buffer_object
) {
1139 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glShaderStorageBlockBinding");
1143 shProg
= _mesa_lookup_shader_program_err(ctx
, program
,
1144 "glShaderStorageBlockBinding");
1148 if (shaderStorageBlockIndex
>= shProg
->data
->NumShaderStorageBlocks
) {
1149 _mesa_error(ctx
, GL_INVALID_VALUE
,
1150 "glShaderStorageBlockBinding(block index %u >= %u)",
1151 shaderStorageBlockIndex
,
1152 shProg
->data
->NumShaderStorageBlocks
);
1156 if (shaderStorageBlockBinding
>= ctx
->Const
.MaxShaderStorageBufferBindings
) {
1157 _mesa_error(ctx
, GL_INVALID_VALUE
,
1158 "glShaderStorageBlockBinding(block binding %u >= %u)",
1159 shaderStorageBlockBinding
,
1160 ctx
->Const
.MaxShaderStorageBufferBindings
);
1164 if (shProg
->data
->ShaderStorageBlocks
[shaderStorageBlockIndex
].Binding
!=
1165 shaderStorageBlockBinding
) {
1167 FLUSH_VERTICES(ctx
, 0);
1168 ctx
->NewDriverState
|= ctx
->DriverFlags
.NewShaderStorageBuffer
;
1170 shProg
->data
->ShaderStorageBlocks
[shaderStorageBlockIndex
].Binding
=
1171 shaderStorageBlockBinding
;
1176 * Generic program resource property query.
1179 mesa_bufferiv(struct gl_shader_program
*shProg
, GLenum type
,
1180 GLuint index
, GLenum pname
, GLint
*params
, const char *caller
)
1182 GET_CURRENT_CONTEXT(ctx
);
1183 struct gl_program_resource
*res
=
1184 _mesa_program_resource_find_index(shProg
, type
, index
);
1187 _mesa_error(ctx
, GL_INVALID_VALUE
, "%s(bufferindex %d)", caller
, index
);
1192 case GL_UNIFORM_BLOCK_BINDING
:
1193 case GL_ATOMIC_COUNTER_BUFFER_BINDING
:
1194 _mesa_program_resource_prop(shProg
, res
, index
, GL_BUFFER_BINDING
,
1197 case GL_UNIFORM_BLOCK_DATA_SIZE
:
1198 case GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE
:
1199 _mesa_program_resource_prop(shProg
, res
, index
, GL_BUFFER_DATA_SIZE
,
1202 case GL_UNIFORM_BLOCK_NAME_LENGTH
:
1203 _mesa_program_resource_prop(shProg
, res
, index
, GL_NAME_LENGTH
,
1206 case GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS
:
1207 case GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS
:
1208 _mesa_program_resource_prop(shProg
, res
, index
, GL_NUM_ACTIVE_VARIABLES
,
1211 case GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES
:
1212 case GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES
:
1213 _mesa_program_resource_prop(shProg
, res
, index
, GL_ACTIVE_VARIABLES
,
1216 case GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER
:
1217 case GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER
:
1218 _mesa_program_resource_prop(shProg
, res
, index
,
1219 GL_REFERENCED_BY_VERTEX_SHADER
, params
,
1223 case GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER
:
1224 case GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER
:
1225 _mesa_program_resource_prop(shProg
, res
, index
,
1226 GL_REFERENCED_BY_TESS_CONTROL_SHADER
, params
,
1230 case GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER
:
1231 case GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER
:
1232 _mesa_program_resource_prop(shProg
, res
, index
,
1233 GL_REFERENCED_BY_TESS_EVALUATION_SHADER
, params
,
1237 case GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER
:
1238 case GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER
:
1239 _mesa_program_resource_prop(shProg
, res
, index
,
1240 GL_REFERENCED_BY_GEOMETRY_SHADER
, params
,
1243 case GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER
:
1244 case GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER
:
1245 _mesa_program_resource_prop(shProg
, res
, index
,
1246 GL_REFERENCED_BY_FRAGMENT_SHADER
, params
,
1249 case GL_UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER
:
1250 case GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER
:
1251 _mesa_program_resource_prop(shProg
, res
, index
,
1252 GL_REFERENCED_BY_COMPUTE_SHADER
, params
,
1256 _mesa_error(ctx
, GL_INVALID_ENUM
,
1257 "%s(pname 0x%x (%s))", caller
, pname
,
1258 _mesa_enum_to_string(pname
));
1265 _mesa_GetActiveUniformBlockiv(GLuint program
,
1266 GLuint uniformBlockIndex
,
1270 GET_CURRENT_CONTEXT(ctx
);
1271 struct gl_shader_program
*shProg
;
1273 if (!ctx
->Extensions
.ARB_uniform_buffer_object
) {
1274 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glGetActiveUniformBlockiv");
1278 shProg
= _mesa_lookup_shader_program_err(ctx
, program
,
1279 "glGetActiveUniformBlockiv");
1283 mesa_bufferiv(shProg
, GL_UNIFORM_BLOCK
, uniformBlockIndex
, pname
, params
,
1284 "glGetActiveUniformBlockiv");
1288 _mesa_GetActiveUniformBlockName(GLuint program
,
1289 GLuint uniformBlockIndex
,
1292 GLchar
*uniformBlockName
)
1294 GET_CURRENT_CONTEXT(ctx
);
1295 struct gl_shader_program
*shProg
;
1297 if (!ctx
->Extensions
.ARB_uniform_buffer_object
) {
1298 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glGetActiveUniformBlockiv");
1303 _mesa_error(ctx
, GL_INVALID_VALUE
,
1304 "glGetActiveUniformBlockName(bufSize %d < 0)",
1309 shProg
= _mesa_lookup_shader_program_err(ctx
, program
,
1310 "glGetActiveUniformBlockiv");
1314 if (uniformBlockName
)
1315 _mesa_get_program_resource_name(shProg
, GL_UNIFORM_BLOCK
,
1316 uniformBlockIndex
, bufSize
, length
,
1318 "glGetActiveUniformBlockName");
1322 _mesa_GetActiveUniformName(GLuint program
, GLuint uniformIndex
,
1323 GLsizei bufSize
, GLsizei
*length
,
1324 GLchar
*uniformName
)
1326 GET_CURRENT_CONTEXT(ctx
);
1327 struct gl_shader_program
*shProg
;
1329 if (!ctx
->Extensions
.ARB_uniform_buffer_object
) {
1330 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glGetActiveUniformName");
1335 _mesa_error(ctx
, GL_INVALID_VALUE
,
1336 "glGetActiveUniformName(bufSize %d < 0)",
1341 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glGetActiveUniformName");
1346 _mesa_get_program_resource_name(shProg
, GL_UNIFORM
, uniformIndex
, bufSize
,
1347 length
, uniformName
, "glGetActiveUniformName");
1351 _mesa_GetActiveAtomicCounterBufferiv(GLuint program
, GLuint bufferIndex
,
1352 GLenum pname
, GLint
*params
)
1354 GET_CURRENT_CONTEXT(ctx
);
1355 struct gl_shader_program
*shProg
;
1357 if (!ctx
->Extensions
.ARB_shader_atomic_counters
) {
1358 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1359 "glGetActiveAtomicCounterBufferiv");
1363 shProg
= _mesa_lookup_shader_program_err(ctx
, program
,
1364 "glGetActiveAtomicCounterBufferiv");
1368 mesa_bufferiv(shProg
, GL_ATOMIC_COUNTER_BUFFER
, bufferIndex
, pname
, params
,
1369 "glGetActiveAtomicCounterBufferiv");
1373 _mesa_Uniform1d(GLint location
, GLdouble v0
)
1375 GET_CURRENT_CONTEXT(ctx
);
1376 _mesa_uniform(location
, 1, &v0
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_DOUBLE
, 1);
1380 _mesa_Uniform2d(GLint location
, GLdouble v0
, GLdouble v1
)
1382 GET_CURRENT_CONTEXT(ctx
);
1386 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_DOUBLE
, 2);
1390 _mesa_Uniform3d(GLint location
, GLdouble v0
, GLdouble v1
, GLdouble v2
)
1392 GET_CURRENT_CONTEXT(ctx
);
1397 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_DOUBLE
, 3);
1401 _mesa_Uniform4d(GLint location
, GLdouble v0
, GLdouble v1
, GLdouble v2
,
1404 GET_CURRENT_CONTEXT(ctx
);
1410 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_DOUBLE
, 4);
1414 _mesa_Uniform1dv(GLint location
, GLsizei count
, const GLdouble
* value
)
1416 GET_CURRENT_CONTEXT(ctx
);
1417 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_DOUBLE
, 1);
1421 _mesa_Uniform2dv(GLint location
, GLsizei count
, const GLdouble
* value
)
1423 GET_CURRENT_CONTEXT(ctx
);
1424 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_DOUBLE
, 2);
1428 _mesa_Uniform3dv(GLint location
, GLsizei count
, const GLdouble
* value
)
1430 GET_CURRENT_CONTEXT(ctx
);
1431 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_DOUBLE
, 3);
1435 _mesa_Uniform4dv(GLint location
, GLsizei count
, const GLdouble
* value
)
1437 GET_CURRENT_CONTEXT(ctx
);
1438 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_DOUBLE
, 4);
1442 _mesa_UniformMatrix2dv(GLint location
, GLsizei count
, GLboolean transpose
,
1443 const GLdouble
* value
)
1445 GET_CURRENT_CONTEXT(ctx
);
1446 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1447 ctx
, ctx
->_Shader
->ActiveProgram
, 2, 2, GLSL_TYPE_DOUBLE
);
1451 _mesa_UniformMatrix3dv(GLint location
, GLsizei count
, GLboolean transpose
,
1452 const GLdouble
* value
)
1454 GET_CURRENT_CONTEXT(ctx
);
1455 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1456 ctx
, ctx
->_Shader
->ActiveProgram
, 3, 3, GLSL_TYPE_DOUBLE
);
1460 _mesa_UniformMatrix4dv(GLint location
, GLsizei count
, GLboolean transpose
,
1461 const GLdouble
* value
)
1463 GET_CURRENT_CONTEXT(ctx
);
1464 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1465 ctx
, ctx
->_Shader
->ActiveProgram
, 4, 4, GLSL_TYPE_DOUBLE
);
1469 _mesa_UniformMatrix2x3dv(GLint location
, GLsizei count
, GLboolean transpose
,
1470 const GLdouble
*value
)
1472 GET_CURRENT_CONTEXT(ctx
);
1473 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1474 ctx
, ctx
->_Shader
->ActiveProgram
, 2, 3, GLSL_TYPE_DOUBLE
);
1478 _mesa_UniformMatrix3x2dv(GLint location
, GLsizei count
, GLboolean transpose
,
1479 const GLdouble
*value
)
1481 GET_CURRENT_CONTEXT(ctx
);
1482 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1483 ctx
, ctx
->_Shader
->ActiveProgram
, 3, 2, GLSL_TYPE_DOUBLE
);
1487 _mesa_UniformMatrix2x4dv(GLint location
, GLsizei count
, GLboolean transpose
,
1488 const GLdouble
*value
)
1490 GET_CURRENT_CONTEXT(ctx
);
1491 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1492 ctx
, ctx
->_Shader
->ActiveProgram
, 2, 4, GLSL_TYPE_DOUBLE
);
1496 _mesa_UniformMatrix4x2dv(GLint location
, GLsizei count
, GLboolean transpose
,
1497 const GLdouble
*value
)
1499 GET_CURRENT_CONTEXT(ctx
);
1500 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1501 ctx
, ctx
->_Shader
->ActiveProgram
, 4, 2, GLSL_TYPE_DOUBLE
);
1505 _mesa_UniformMatrix3x4dv(GLint location
, GLsizei count
, GLboolean transpose
,
1506 const GLdouble
*value
)
1508 GET_CURRENT_CONTEXT(ctx
);
1509 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1510 ctx
, ctx
->_Shader
->ActiveProgram
, 3, 4, GLSL_TYPE_DOUBLE
);
1514 _mesa_UniformMatrix4x3dv(GLint location
, GLsizei count
, GLboolean transpose
,
1515 const GLdouble
*value
)
1517 GET_CURRENT_CONTEXT(ctx
);
1518 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1519 ctx
, ctx
->_Shader
->ActiveProgram
, 4, 3, GLSL_TYPE_DOUBLE
);
1523 _mesa_ProgramUniform1d(GLuint program
, GLint location
, GLdouble v0
)
1525 GET_CURRENT_CONTEXT(ctx
);
1526 struct gl_shader_program
*shProg
=
1527 _mesa_lookup_shader_program_err(ctx
, program
,
1528 "glProgramUniform1d");
1529 _mesa_uniform(location
, 1, &v0
, ctx
, shProg
, GLSL_TYPE_DOUBLE
, 1);
1533 _mesa_ProgramUniform2d(GLuint program
, GLint location
, GLdouble v0
, GLdouble v1
)
1535 GET_CURRENT_CONTEXT(ctx
);
1537 struct gl_shader_program
*shProg
;
1540 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform2d");
1541 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_DOUBLE
, 2);
1545 _mesa_ProgramUniform3d(GLuint program
, GLint location
, GLdouble v0
, GLdouble v1
,
1548 GET_CURRENT_CONTEXT(ctx
);
1550 struct gl_shader_program
*shProg
;
1554 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform3d");
1555 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_DOUBLE
, 3);
1559 _mesa_ProgramUniform4d(GLuint program
, GLint location
, GLdouble v0
, GLdouble v1
,
1560 GLdouble v2
, GLdouble v3
)
1562 GET_CURRENT_CONTEXT(ctx
);
1564 struct gl_shader_program
*shProg
;
1569 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform4d");
1570 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_DOUBLE
, 4);
1574 _mesa_ProgramUniform1dv(GLuint program
, GLint location
, GLsizei count
,
1575 const GLdouble
* value
)
1577 GET_CURRENT_CONTEXT(ctx
);
1578 struct gl_shader_program
*shProg
=
1579 _mesa_lookup_shader_program_err(ctx
, program
,
1580 "glProgramUniform1dv");
1581 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_DOUBLE
, 1);
1585 _mesa_ProgramUniform2dv(GLuint program
, GLint location
, GLsizei count
,
1586 const GLdouble
* value
)
1588 GET_CURRENT_CONTEXT(ctx
);
1589 struct gl_shader_program
*shProg
=
1590 _mesa_lookup_shader_program_err(ctx
, program
,
1591 "glProgramUniform2dv");
1592 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_DOUBLE
, 2);
1596 _mesa_ProgramUniform3dv(GLuint program
, GLint location
, GLsizei count
,
1597 const GLdouble
* value
)
1599 GET_CURRENT_CONTEXT(ctx
);
1600 struct gl_shader_program
*shProg
=
1601 _mesa_lookup_shader_program_err(ctx
, program
,
1602 "glProgramUniform3dv");
1603 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_DOUBLE
, 3);
1607 _mesa_ProgramUniform4dv(GLuint program
, GLint location
, GLsizei count
,
1608 const GLdouble
* value
)
1610 GET_CURRENT_CONTEXT(ctx
);
1611 struct gl_shader_program
*shProg
=
1612 _mesa_lookup_shader_program_err(ctx
, program
,
1613 "glProgramUniform4dv");
1614 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_DOUBLE
, 4);
1618 _mesa_ProgramUniformMatrix2dv(GLuint program
, GLint location
, GLsizei count
,
1619 GLboolean transpose
, const GLdouble
* value
)
1621 GET_CURRENT_CONTEXT(ctx
);
1622 struct gl_shader_program
*shProg
=
1623 _mesa_lookup_shader_program_err(ctx
, program
,
1624 "glProgramUniformMatrix2dv");
1625 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1626 ctx
, shProg
, 2, 2, GLSL_TYPE_DOUBLE
);
1630 _mesa_ProgramUniformMatrix3dv(GLuint program
, GLint location
, GLsizei count
,
1631 GLboolean transpose
, const GLdouble
* value
)
1633 GET_CURRENT_CONTEXT(ctx
);
1634 struct gl_shader_program
*shProg
=
1635 _mesa_lookup_shader_program_err(ctx
, program
,
1636 "glProgramUniformMatrix3dv");
1637 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1638 ctx
, shProg
, 3, 3, GLSL_TYPE_DOUBLE
);
1642 _mesa_ProgramUniformMatrix4dv(GLuint program
, GLint location
, GLsizei count
,
1643 GLboolean transpose
, const GLdouble
* value
)
1645 GET_CURRENT_CONTEXT(ctx
);
1646 struct gl_shader_program
*shProg
=
1647 _mesa_lookup_shader_program_err(ctx
, program
,
1648 "glProgramUniformMatrix4dv");
1649 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1650 ctx
, shProg
, 4, 4, GLSL_TYPE_DOUBLE
);
1654 _mesa_ProgramUniformMatrix2x3dv(GLuint program
, GLint location
, GLsizei count
,
1655 GLboolean transpose
, const GLdouble
* value
)
1657 GET_CURRENT_CONTEXT(ctx
);
1658 struct gl_shader_program
*shProg
=
1659 _mesa_lookup_shader_program_err(ctx
, program
,
1660 "glProgramUniformMatrix2x3dv");
1661 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1662 ctx
, shProg
, 2, 3, GLSL_TYPE_DOUBLE
);
1666 _mesa_ProgramUniformMatrix3x2dv(GLuint program
, GLint location
, GLsizei count
,
1667 GLboolean transpose
, const GLdouble
* value
)
1669 GET_CURRENT_CONTEXT(ctx
);
1670 struct gl_shader_program
*shProg
=
1671 _mesa_lookup_shader_program_err(ctx
, program
,
1672 "glProgramUniformMatrix3x2dv");
1673 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1674 ctx
, shProg
, 3, 2, GLSL_TYPE_DOUBLE
);
1678 _mesa_ProgramUniformMatrix2x4dv(GLuint program
, GLint location
, GLsizei count
,
1679 GLboolean transpose
, const GLdouble
* value
)
1681 GET_CURRENT_CONTEXT(ctx
);
1682 struct gl_shader_program
*shProg
=
1683 _mesa_lookup_shader_program_err(ctx
, program
,
1684 "glProgramUniformMatrix2x4dv");
1685 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1686 ctx
, shProg
, 2, 4, GLSL_TYPE_DOUBLE
);
1690 _mesa_ProgramUniformMatrix4x2dv(GLuint program
, GLint location
, GLsizei count
,
1691 GLboolean transpose
, const GLdouble
* value
)
1693 GET_CURRENT_CONTEXT(ctx
);
1694 struct gl_shader_program
*shProg
=
1695 _mesa_lookup_shader_program_err(ctx
, program
,
1696 "glProgramUniformMatrix4x2dv");
1697 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1698 ctx
, shProg
, 4, 2, GLSL_TYPE_DOUBLE
);
1702 _mesa_ProgramUniformMatrix3x4dv(GLuint program
, GLint location
, GLsizei count
,
1703 GLboolean transpose
, const GLdouble
* value
)
1705 GET_CURRENT_CONTEXT(ctx
);
1706 struct gl_shader_program
*shProg
=
1707 _mesa_lookup_shader_program_err(ctx
, program
,
1708 "glProgramUniformMatrix3x4dv");
1709 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1710 ctx
, shProg
, 3, 4, GLSL_TYPE_DOUBLE
);
1714 _mesa_ProgramUniformMatrix4x3dv(GLuint program
, GLint location
, GLsizei count
,
1715 GLboolean transpose
, const GLdouble
* value
)
1717 GET_CURRENT_CONTEXT(ctx
);
1718 struct gl_shader_program
*shProg
=
1719 _mesa_lookup_shader_program_err(ctx
, program
,
1720 "glProgramUniformMatrix4x3dv");
1721 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1722 ctx
, shProg
, 4, 3, GLSL_TYPE_DOUBLE
);
1726 _mesa_Uniform1i64ARB(GLint location
, GLint64 v0
)
1728 GET_CURRENT_CONTEXT(ctx
);
1729 _mesa_uniform(location
, 1, &v0
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT64
, 1);
1733 _mesa_Uniform2i64ARB(GLint location
, GLint64 v0
, GLint64 v1
)
1735 GET_CURRENT_CONTEXT(ctx
);
1739 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT64
, 2);
1743 _mesa_Uniform3i64ARB(GLint location
, GLint64 v0
, GLint64 v1
, GLint64 v2
)
1745 GET_CURRENT_CONTEXT(ctx
);
1750 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT64
, 3);
1754 _mesa_Uniform4i64ARB(GLint location
, GLint64 v0
, GLint64 v1
, GLint64 v2
, GLint64 v3
)
1756 GET_CURRENT_CONTEXT(ctx
);
1762 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT64
, 4);
1766 _mesa_Uniform1i64vARB(GLint location
, GLsizei count
, const GLint64
*value
)
1768 GET_CURRENT_CONTEXT(ctx
);
1769 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT64
, 1);
1773 _mesa_Uniform2i64vARB(GLint location
, GLsizei count
, const GLint64
*value
)
1775 GET_CURRENT_CONTEXT(ctx
);
1776 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT64
, 2);
1780 _mesa_Uniform3i64vARB(GLint location
, GLsizei count
, const GLint64
*value
)
1782 GET_CURRENT_CONTEXT(ctx
);
1783 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT64
, 3);
1787 _mesa_Uniform4i64vARB(GLint location
, GLsizei count
, const GLint64
*value
)
1789 GET_CURRENT_CONTEXT(ctx
);
1790 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT64
, 4);
1794 _mesa_Uniform1ui64ARB(GLint location
, GLuint64 v0
)
1796 GET_CURRENT_CONTEXT(ctx
);
1797 _mesa_uniform(location
, 1, &v0
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT64
, 1);
1801 _mesa_Uniform2ui64ARB(GLint location
, GLuint64 v0
, GLuint64 v1
)
1803 GET_CURRENT_CONTEXT(ctx
);
1807 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT64
, 2);
1811 _mesa_Uniform3ui64ARB(GLint location
, GLuint64 v0
, GLuint64 v1
, GLuint64 v2
)
1813 GET_CURRENT_CONTEXT(ctx
);
1818 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT64
, 3);
1822 _mesa_Uniform4ui64ARB(GLint location
, GLuint64 v0
, GLuint64 v1
, GLuint64 v2
, GLuint64 v3
)
1824 GET_CURRENT_CONTEXT(ctx
);
1830 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT64
, 4);
1834 _mesa_Uniform1ui64vARB(GLint location
, GLsizei count
, const GLuint64
*value
)
1836 GET_CURRENT_CONTEXT(ctx
);
1837 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT64
, 1);
1841 _mesa_Uniform2ui64vARB(GLint location
, GLsizei count
, const GLuint64
*value
)
1843 GET_CURRENT_CONTEXT(ctx
);
1844 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT64
, 2);
1848 _mesa_Uniform3ui64vARB(GLint location
, GLsizei count
, const GLuint64
*value
)
1850 GET_CURRENT_CONTEXT(ctx
);
1851 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT64
, 3);
1855 _mesa_Uniform4ui64vARB(GLint location
, GLsizei count
, const GLuint64
*value
)
1857 GET_CURRENT_CONTEXT(ctx
);
1858 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT64
, 4);
1861 /* DSA entrypoints */
1863 _mesa_ProgramUniform1i64ARB(GLuint program
, GLint location
, GLint64 v0
)
1865 GET_CURRENT_CONTEXT(ctx
);
1866 struct gl_shader_program
*shProg
=
1867 _mesa_lookup_shader_program_err(ctx
, program
,
1868 "glProgramUniform1i64ARB");
1869 _mesa_uniform(location
, 1, &v0
, ctx
, shProg
, GLSL_TYPE_INT64
, 1);
1873 _mesa_ProgramUniform2i64ARB(GLuint program
, GLint location
, GLint64 v0
, GLint64 v1
)
1875 GET_CURRENT_CONTEXT(ctx
);
1876 struct gl_shader_program
*shProg
=
1877 _mesa_lookup_shader_program_err(ctx
, program
,
1878 "glProgramUniform2i64ARB");
1882 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_INT64
, 2);
1886 _mesa_ProgramUniform3i64ARB(GLuint program
, GLint location
, GLint64 v0
, GLint64 v1
, GLint64 v2
)
1888 GET_CURRENT_CONTEXT(ctx
);
1889 struct gl_shader_program
*shProg
=
1890 _mesa_lookup_shader_program_err(ctx
, program
,
1891 "glProgramUniform3i64ARB");
1896 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_INT64
, 3);
1900 _mesa_ProgramUniform4i64ARB(GLuint program
, GLint location
, GLint64 v0
, GLint64 v1
, GLint64 v2
, GLint64 v3
)
1902 GET_CURRENT_CONTEXT(ctx
);
1903 struct gl_shader_program
*shProg
=
1904 _mesa_lookup_shader_program_err(ctx
, program
,
1905 "glProgramUniform4i64ARB");
1911 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_INT64
, 4);
1915 _mesa_ProgramUniform1i64vARB(GLuint program
, GLint location
, GLsizei count
, const GLint64
*value
)
1917 GET_CURRENT_CONTEXT(ctx
);
1918 struct gl_shader_program
*shProg
=
1919 _mesa_lookup_shader_program_err(ctx
, program
,
1920 "glProgramUniform1i64vARB");
1921 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_INT64
, 1);
1925 _mesa_ProgramUniform2i64vARB(GLuint program
, GLint location
, GLsizei count
, const GLint64
*value
)
1927 GET_CURRENT_CONTEXT(ctx
);
1928 struct gl_shader_program
*shProg
=
1929 _mesa_lookup_shader_program_err(ctx
, program
,
1930 "glProgramUniform2i64vARB");
1931 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_INT64
, 2);
1935 _mesa_ProgramUniform3i64vARB(GLuint program
, GLint location
, GLsizei count
, const GLint64
*value
)
1937 GET_CURRENT_CONTEXT(ctx
);
1938 struct gl_shader_program
*shProg
=
1939 _mesa_lookup_shader_program_err(ctx
, program
,
1940 "glProgramUniform3i64vARB");
1941 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_INT64
, 3);
1945 _mesa_ProgramUniform4i64vARB(GLuint program
, GLint location
, GLsizei count
, const GLint64
*value
)
1947 GET_CURRENT_CONTEXT(ctx
);
1948 struct gl_shader_program
*shProg
=
1949 _mesa_lookup_shader_program_err(ctx
, program
,
1950 "glProgramUniform4i64vARB");
1951 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_INT64
, 4);
1955 _mesa_ProgramUniform1ui64ARB(GLuint program
, GLint location
, GLuint64 v0
)
1957 GET_CURRENT_CONTEXT(ctx
);
1958 struct gl_shader_program
*shProg
=
1959 _mesa_lookup_shader_program_err(ctx
, program
,
1960 "glProgramUniform1ui64ARB");
1961 _mesa_uniform(location
, 1, &v0
, ctx
, shProg
, GLSL_TYPE_UINT64
, 1);
1965 _mesa_ProgramUniform2ui64ARB(GLuint program
, GLint location
, GLuint64 v0
, GLuint64 v1
)
1967 GET_CURRENT_CONTEXT(ctx
);
1968 struct gl_shader_program
*shProg
=
1969 _mesa_lookup_shader_program_err(ctx
, program
,
1970 "glProgramUniform2ui64ARB");
1974 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_UINT64
, 2);
1978 _mesa_ProgramUniform3ui64ARB(GLuint program
, GLint location
, GLuint64 v0
, GLuint64 v1
, GLuint64 v2
)
1980 GET_CURRENT_CONTEXT(ctx
);
1981 struct gl_shader_program
*shProg
=
1982 _mesa_lookup_shader_program_err(ctx
, program
,
1983 "glProgramUniform3ui64ARB");
1988 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_UINT64
, 3);
1992 _mesa_ProgramUniform4ui64ARB(GLuint program
, GLint location
, GLuint64 v0
, GLuint64 v1
, GLuint64 v2
, GLuint64 v3
)
1994 GET_CURRENT_CONTEXT(ctx
);
1995 struct gl_shader_program
*shProg
=
1996 _mesa_lookup_shader_program_err(ctx
, program
,
1997 "glProgramUniform4ui64ARB");
2003 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_UINT64
, 4);
2007 _mesa_ProgramUniform1ui64vARB(GLuint program
, GLint location
, GLsizei count
, const GLuint64
*value
)
2009 GET_CURRENT_CONTEXT(ctx
);
2010 struct gl_shader_program
*shProg
=
2011 _mesa_lookup_shader_program_err(ctx
, program
,
2012 "glProgramUniform1ui64vARB");
2013 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_UINT64
, 1);
2017 _mesa_ProgramUniform2ui64vARB(GLuint program
, GLint location
, GLsizei count
, const GLuint64
*value
)
2019 GET_CURRENT_CONTEXT(ctx
);
2020 struct gl_shader_program
*shProg
=
2021 _mesa_lookup_shader_program_err(ctx
, program
,
2022 "glProgramUniform2ui64vARB");
2023 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_UINT64
, 2);
2027 _mesa_ProgramUniform3ui64vARB(GLuint program
, GLint location
, GLsizei count
, const GLuint64
*value
)
2029 GET_CURRENT_CONTEXT(ctx
);
2030 struct gl_shader_program
*shProg
=
2031 _mesa_lookup_shader_program_err(ctx
, program
,
2032 "glProgramUniform3ui64vARB");
2033 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_UINT64
, 3);
2037 _mesa_ProgramUniform4ui64vARB(GLuint program
, GLint location
, GLsizei count
, const GLuint64
*value
)
2039 GET_CURRENT_CONTEXT(ctx
);
2040 struct gl_shader_program
*shProg
=
2041 _mesa_lookup_shader_program_err(ctx
, program
,
2042 "glProgramUniform4ui64vARB");
2043 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_UINT64
, 4);