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 gl_shader_stage prog_stage
=
72 _mesa_program_enum_to_shader_stage(prog
->Target
);
73 struct gl_linked_shader
*shader
= shProg
->_LinkedShaders
[prog_stage
];
77 memset(prog
->TexturesUsed
, 0, sizeof(prog
->TexturesUsed
));
80 const int s
= u_bit_scan(&mask
);
81 GLuint unit
= prog
->SamplerUnits
[s
];
82 GLuint tgt
= prog
->sh
.SamplerTargets
[s
];
83 assert(unit
< ARRAY_SIZE(prog
->TexturesUsed
));
84 assert(tgt
< NUM_TEXTURE_TARGETS
);
86 /* The types of the samplers associated with a particular texture
87 * unit must be an exact match. Page 74 (page 89 of the PDF) of the
88 * OpenGL 3.3 core spec says:
90 * "It is not allowed to have variables of different sampler
91 * types pointing to the same texture image unit within a program
94 unsigned stages_mask
= shProg
->data
->linked_stages
;
96 const int stage
= u_bit_scan(&stages_mask
);
98 /* Skip validation if we are yet to update textures used in this
101 if (prog_stage
< stage
)
104 struct gl_program
*glprog
= shProg
->_LinkedShaders
[stage
]->Program
;
105 if (glprog
->TexturesUsed
[unit
] & ~(1 << tgt
))
106 shProg
->SamplersValidated
= GL_FALSE
;
109 prog
->TexturesUsed
[unit
] |= (1 << tgt
);
114 * Connect a piece of driver storage with a part of a uniform
116 * \param uni The uniform with which the storage will be associated
117 * \param element_stride Byte-stride between array elements.
118 * \sa gl_uniform_driver_storage::element_stride.
119 * \param vector_stride Byte-stride between vectors (in a matrix).
120 * \sa gl_uniform_driver_storage::vector_stride.
121 * \param format Conversion from native format to driver format
122 * required by the driver.
123 * \param data Location to dump the data.
126 _mesa_uniform_attach_driver_storage(struct gl_uniform_storage
*uni
,
127 unsigned element_stride
,
128 unsigned vector_stride
,
129 enum gl_uniform_driver_format format
,
132 uni
->driver_storage
=
133 realloc(uni
->driver_storage
,
134 sizeof(struct gl_uniform_driver_storage
)
135 * (uni
->num_driver_storage
+ 1));
137 uni
->driver_storage
[uni
->num_driver_storage
].element_stride
= element_stride
;
138 uni
->driver_storage
[uni
->num_driver_storage
].vector_stride
= vector_stride
;
139 uni
->driver_storage
[uni
->num_driver_storage
].format
= format
;
140 uni
->driver_storage
[uni
->num_driver_storage
].data
= data
;
142 uni
->num_driver_storage
++;
146 * Sever all connections with all pieces of driver storage for all uniforms
149 * This function does \b not release any of the \c data pointers
150 * previously passed in to \c _mesa_uniform_attach_driver_stoarge.
153 _mesa_uniform_detach_all_driver_storage(struct gl_uniform_storage
*uni
)
155 free(uni
->driver_storage
);
156 uni
->driver_storage
= NULL
;
157 uni
->num_driver_storage
= 0;
161 _mesa_Uniform1f(GLint location
, GLfloat v0
)
163 GET_CURRENT_CONTEXT(ctx
);
164 _mesa_uniform(location
, 1, &v0
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_FLOAT
, 1);
168 _mesa_Uniform2f(GLint location
, GLfloat v0
, GLfloat v1
)
170 GET_CURRENT_CONTEXT(ctx
);
174 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_FLOAT
, 2);
178 _mesa_Uniform3f(GLint location
, GLfloat v0
, GLfloat v1
, GLfloat v2
)
180 GET_CURRENT_CONTEXT(ctx
);
185 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_FLOAT
, 3);
189 _mesa_Uniform4f(GLint location
, GLfloat v0
, GLfloat v1
, GLfloat v2
,
192 GET_CURRENT_CONTEXT(ctx
);
198 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_FLOAT
, 4);
202 _mesa_Uniform1i(GLint location
, GLint v0
)
204 GET_CURRENT_CONTEXT(ctx
);
205 _mesa_uniform(location
, 1, &v0
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT
, 1);
209 _mesa_Uniform2i(GLint location
, GLint v0
, GLint v1
)
211 GET_CURRENT_CONTEXT(ctx
);
215 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT
, 2);
219 _mesa_Uniform3i(GLint location
, GLint v0
, GLint v1
, GLint v2
)
221 GET_CURRENT_CONTEXT(ctx
);
226 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT
, 3);
230 _mesa_Uniform4i(GLint location
, GLint v0
, GLint v1
, GLint v2
, GLint v3
)
232 GET_CURRENT_CONTEXT(ctx
);
238 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT
, 4);
242 _mesa_Uniform1fv(GLint location
, GLsizei count
, const GLfloat
* value
)
244 GET_CURRENT_CONTEXT(ctx
);
245 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_FLOAT
, 1);
249 _mesa_Uniform2fv(GLint location
, GLsizei count
, const GLfloat
* value
)
251 GET_CURRENT_CONTEXT(ctx
);
252 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_FLOAT
, 2);
256 _mesa_Uniform3fv(GLint location
, GLsizei count
, const GLfloat
* value
)
258 GET_CURRENT_CONTEXT(ctx
);
259 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_FLOAT
, 3);
263 _mesa_Uniform4fv(GLint location
, GLsizei count
, const GLfloat
* value
)
265 GET_CURRENT_CONTEXT(ctx
);
266 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_FLOAT
, 4);
270 _mesa_Uniform1iv(GLint location
, GLsizei count
, const GLint
* value
)
272 GET_CURRENT_CONTEXT(ctx
);
273 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT
, 1);
277 _mesa_Uniform2iv(GLint location
, GLsizei count
, const GLint
* value
)
279 GET_CURRENT_CONTEXT(ctx
);
280 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT
, 2);
284 _mesa_Uniform3iv(GLint location
, GLsizei count
, const GLint
* value
)
286 GET_CURRENT_CONTEXT(ctx
);
287 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT
, 3);
291 _mesa_Uniform4iv(GLint location
, GLsizei count
, const GLint
* value
)
293 GET_CURRENT_CONTEXT(ctx
);
294 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT
, 4);
298 _mesa_UniformHandleui64ARB(GLint location
, GLuint64 value
)
303 _mesa_UniformHandleui64vARB(GLint location
, GLsizei count
,
304 const GLuint64
*value
)
309 /** Same as above with direct state access **/
311 _mesa_ProgramUniform1f(GLuint program
, GLint location
, GLfloat v0
)
313 GET_CURRENT_CONTEXT(ctx
);
314 struct gl_shader_program
*shProg
=
315 _mesa_lookup_shader_program_err(ctx
, program
,
316 "glProgramUniform1f");
317 _mesa_uniform(location
, 1, &v0
, ctx
, shProg
, GLSL_TYPE_FLOAT
, 1);
321 _mesa_ProgramUniform2f(GLuint program
, GLint location
, GLfloat v0
, GLfloat v1
)
323 GET_CURRENT_CONTEXT(ctx
);
325 struct gl_shader_program
*shProg
;
328 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform2f");
329 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_FLOAT
, 2);
333 _mesa_ProgramUniform3f(GLuint program
, GLint location
, GLfloat v0
, GLfloat v1
,
336 GET_CURRENT_CONTEXT(ctx
);
338 struct gl_shader_program
*shProg
;
342 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform3f");
343 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_FLOAT
, 3);
347 _mesa_ProgramUniform4f(GLuint program
, GLint location
, GLfloat v0
, GLfloat v1
,
348 GLfloat v2
, GLfloat v3
)
350 GET_CURRENT_CONTEXT(ctx
);
352 struct gl_shader_program
*shProg
;
357 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform4f");
358 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_FLOAT
, 4);
362 _mesa_ProgramUniform1i(GLuint program
, GLint location
, GLint v0
)
364 GET_CURRENT_CONTEXT(ctx
);
365 struct gl_shader_program
*shProg
=
366 _mesa_lookup_shader_program_err(ctx
, program
,
367 "glProgramUniform1i");
368 _mesa_uniform(location
, 1, &v0
, ctx
, shProg
, GLSL_TYPE_INT
, 1);
372 _mesa_ProgramUniform2i(GLuint program
, GLint location
, GLint v0
, GLint v1
)
374 GET_CURRENT_CONTEXT(ctx
);
376 struct gl_shader_program
*shProg
;
379 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform2i");
380 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_INT
, 2);
384 _mesa_ProgramUniform3i(GLuint program
, GLint location
, GLint v0
, GLint v1
,
387 GET_CURRENT_CONTEXT(ctx
);
389 struct gl_shader_program
*shProg
;
393 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform3i");
394 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_INT
, 3);
398 _mesa_ProgramUniform4i(GLuint program
, GLint location
, GLint v0
, GLint v1
,
401 GET_CURRENT_CONTEXT(ctx
);
403 struct gl_shader_program
*shProg
;
408 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform4i");
409 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_INT
, 4);
413 _mesa_ProgramUniform1fv(GLuint program
, GLint location
, GLsizei count
,
414 const GLfloat
* value
)
416 GET_CURRENT_CONTEXT(ctx
);
417 struct gl_shader_program
*shProg
=
418 _mesa_lookup_shader_program_err(ctx
, program
,
419 "glProgramUniform1fv");
420 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_FLOAT
, 1);
424 _mesa_ProgramUniform2fv(GLuint program
, GLint location
, GLsizei count
,
425 const GLfloat
* value
)
427 GET_CURRENT_CONTEXT(ctx
);
428 struct gl_shader_program
*shProg
=
429 _mesa_lookup_shader_program_err(ctx
, program
,
430 "glProgramUniform2fv");
431 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_FLOAT
, 2);
435 _mesa_ProgramUniform3fv(GLuint program
, GLint location
, GLsizei count
,
436 const GLfloat
* value
)
438 GET_CURRENT_CONTEXT(ctx
);
439 struct gl_shader_program
*shProg
=
440 _mesa_lookup_shader_program_err(ctx
, program
,
441 "glProgramUniform3fv");
442 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_FLOAT
, 3);
446 _mesa_ProgramUniform4fv(GLuint program
, GLint location
, GLsizei count
,
447 const GLfloat
* value
)
449 GET_CURRENT_CONTEXT(ctx
);
450 struct gl_shader_program
*shProg
=
451 _mesa_lookup_shader_program_err(ctx
, program
,
452 "glProgramUniform4fv");
453 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_FLOAT
, 4);
457 _mesa_ProgramUniform1iv(GLuint program
, GLint location
, GLsizei count
,
460 GET_CURRENT_CONTEXT(ctx
);
461 struct gl_shader_program
*shProg
=
462 _mesa_lookup_shader_program_err(ctx
, program
,
463 "glProgramUniform1iv");
464 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_INT
, 1);
468 _mesa_ProgramUniform2iv(GLuint program
, GLint location
, GLsizei count
,
471 GET_CURRENT_CONTEXT(ctx
);
472 struct gl_shader_program
*shProg
=
473 _mesa_lookup_shader_program_err(ctx
, program
,
474 "glProgramUniform2iv");
475 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_INT
, 2);
479 _mesa_ProgramUniform3iv(GLuint program
, GLint location
, GLsizei count
,
482 GET_CURRENT_CONTEXT(ctx
);
483 struct gl_shader_program
*shProg
=
484 _mesa_lookup_shader_program_err(ctx
, program
,
485 "glProgramUniform3iv");
486 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_INT
, 3);
490 _mesa_ProgramUniform4iv(GLuint program
, GLint location
, GLsizei count
,
493 GET_CURRENT_CONTEXT(ctx
);
494 struct gl_shader_program
*shProg
=
495 _mesa_lookup_shader_program_err(ctx
, program
,
496 "glProgramUniform4iv");
497 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_INT
, 4);
501 _mesa_ProgramUniformHandleui64ARB(GLuint program
, GLint location
,
507 _mesa_ProgramUniformHandleui64vARB(GLuint program
, GLint location
,
508 GLsizei count
, const GLuint64
*values
)
513 /** OpenGL 3.0 GLuint-valued functions **/
515 _mesa_Uniform1ui(GLint location
, GLuint v0
)
517 GET_CURRENT_CONTEXT(ctx
);
518 _mesa_uniform(location
, 1, &v0
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT
, 1);
522 _mesa_Uniform2ui(GLint location
, GLuint v0
, GLuint v1
)
524 GET_CURRENT_CONTEXT(ctx
);
528 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT
, 2);
532 _mesa_Uniform3ui(GLint location
, GLuint v0
, GLuint v1
, GLuint v2
)
534 GET_CURRENT_CONTEXT(ctx
);
539 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT
, 3);
543 _mesa_Uniform4ui(GLint location
, GLuint v0
, GLuint v1
, GLuint v2
, GLuint v3
)
545 GET_CURRENT_CONTEXT(ctx
);
551 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT
, 4);
555 _mesa_Uniform1uiv(GLint location
, GLsizei count
, const GLuint
*value
)
557 GET_CURRENT_CONTEXT(ctx
);
558 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT
, 1);
562 _mesa_Uniform2uiv(GLint location
, GLsizei count
, const GLuint
*value
)
564 GET_CURRENT_CONTEXT(ctx
);
565 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT
, 2);
569 _mesa_Uniform3uiv(GLint location
, GLsizei count
, const GLuint
*value
)
571 GET_CURRENT_CONTEXT(ctx
);
572 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT
, 3);
576 _mesa_Uniform4uiv(GLint location
, GLsizei count
, const GLuint
*value
)
578 GET_CURRENT_CONTEXT(ctx
);
579 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT
, 4);
585 _mesa_UniformMatrix2fv(GLint location
, GLsizei count
, GLboolean transpose
,
586 const GLfloat
* value
)
588 GET_CURRENT_CONTEXT(ctx
);
589 _mesa_uniform_matrix(location
, count
, transpose
, value
,
590 ctx
, ctx
->_Shader
->ActiveProgram
, 2, 2, GLSL_TYPE_FLOAT
);
594 _mesa_UniformMatrix3fv(GLint location
, GLsizei count
, GLboolean transpose
,
595 const GLfloat
* value
)
597 GET_CURRENT_CONTEXT(ctx
);
598 _mesa_uniform_matrix(location
, count
, transpose
, value
,
599 ctx
, ctx
->_Shader
->ActiveProgram
, 3, 3, GLSL_TYPE_FLOAT
);
603 _mesa_UniformMatrix4fv(GLint location
, GLsizei count
, GLboolean transpose
,
604 const GLfloat
* value
)
606 GET_CURRENT_CONTEXT(ctx
);
607 _mesa_uniform_matrix(location
, count
, transpose
, value
,
608 ctx
, ctx
->_Shader
->ActiveProgram
, 4, 4, GLSL_TYPE_FLOAT
);
611 /** Same as above with direct state access **/
614 _mesa_ProgramUniform1ui(GLuint program
, GLint location
, GLuint v0
)
616 GET_CURRENT_CONTEXT(ctx
);
617 struct gl_shader_program
*shProg
=
618 _mesa_lookup_shader_program_err(ctx
, program
,
619 "glProgramUniform1ui");
620 _mesa_uniform(location
, 1, &v0
, ctx
, shProg
, GLSL_TYPE_UINT
, 1);
624 _mesa_ProgramUniform2ui(GLuint program
, GLint location
, GLuint v0
, GLuint v1
)
626 GET_CURRENT_CONTEXT(ctx
);
628 struct gl_shader_program
*shProg
;
631 shProg
= _mesa_lookup_shader_program_err(ctx
, program
,
632 "glProgramUniform2ui");
633 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_UINT
, 2);
637 _mesa_ProgramUniform3ui(GLuint program
, GLint location
, GLuint v0
, GLuint v1
,
640 GET_CURRENT_CONTEXT(ctx
);
642 struct gl_shader_program
*shProg
;
646 shProg
= _mesa_lookup_shader_program_err(ctx
, program
,
647 "glProgramUniform3ui");
648 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_UINT
, 3);
652 _mesa_ProgramUniform4ui(GLuint program
, GLint location
, GLuint v0
, GLuint v1
,
653 GLuint v2
, GLuint v3
)
655 GET_CURRENT_CONTEXT(ctx
);
657 struct gl_shader_program
*shProg
;
662 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform4ui");
663 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_UINT
, 4);
667 _mesa_ProgramUniform1uiv(GLuint program
, GLint location
, GLsizei count
,
670 GET_CURRENT_CONTEXT(ctx
);
671 struct gl_shader_program
*shProg
=
672 _mesa_lookup_shader_program_err(ctx
, program
,
673 "glProgramUniform1uiv");
674 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_UINT
, 1);
678 _mesa_ProgramUniform2uiv(GLuint program
, GLint location
, GLsizei count
,
681 GET_CURRENT_CONTEXT(ctx
);
682 struct gl_shader_program
*shProg
=
683 _mesa_lookup_shader_program_err(ctx
, program
,
684 "glProgramUniform2uiv");
685 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_UINT
, 2);
689 _mesa_ProgramUniform3uiv(GLuint program
, GLint location
, GLsizei count
,
692 GET_CURRENT_CONTEXT(ctx
);
693 struct gl_shader_program
*shProg
=
694 _mesa_lookup_shader_program_err(ctx
, program
,
695 "glProgramUniform3uiv");
696 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_UINT
, 3);
700 _mesa_ProgramUniform4uiv(GLuint program
, GLint location
, GLsizei count
,
703 GET_CURRENT_CONTEXT(ctx
);
704 struct gl_shader_program
*shProg
=
705 _mesa_lookup_shader_program_err(ctx
, program
,
706 "glProgramUniform4uiv");
707 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_UINT
, 4);
713 _mesa_ProgramUniformMatrix2fv(GLuint program
, GLint location
, GLsizei count
,
714 GLboolean transpose
, const GLfloat
* value
)
716 GET_CURRENT_CONTEXT(ctx
);
717 struct gl_shader_program
*shProg
=
718 _mesa_lookup_shader_program_err(ctx
, program
,
719 "glProgramUniformMatrix2fv");
720 _mesa_uniform_matrix(location
, count
, transpose
, value
, ctx
, shProg
, 2, 2, GLSL_TYPE_FLOAT
);
724 _mesa_ProgramUniformMatrix3fv(GLuint program
, GLint location
, GLsizei count
,
725 GLboolean transpose
, const GLfloat
* value
)
727 GET_CURRENT_CONTEXT(ctx
);
728 struct gl_shader_program
*shProg
=
729 _mesa_lookup_shader_program_err(ctx
, program
,
730 "glProgramUniformMatrix3fv");
731 _mesa_uniform_matrix(location
, count
, transpose
, value
, ctx
, shProg
, 3, 3, GLSL_TYPE_FLOAT
);
735 _mesa_ProgramUniformMatrix4fv(GLuint program
, GLint location
, GLsizei count
,
736 GLboolean transpose
, const GLfloat
* value
)
738 GET_CURRENT_CONTEXT(ctx
);
739 struct gl_shader_program
*shProg
=
740 _mesa_lookup_shader_program_err(ctx
, program
,
741 "glProgramUniformMatrix4fv");
742 _mesa_uniform_matrix(location
, count
, transpose
, value
, ctx
, shProg
, 4, 4, GLSL_TYPE_FLOAT
);
747 * Non-square UniformMatrix are OpenGL 2.1
750 _mesa_UniformMatrix2x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
751 const GLfloat
*value
)
753 GET_CURRENT_CONTEXT(ctx
);
754 _mesa_uniform_matrix(location
, count
, transpose
, value
,
755 ctx
, ctx
->_Shader
->ActiveProgram
, 2, 3, GLSL_TYPE_FLOAT
);
759 _mesa_UniformMatrix3x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
760 const GLfloat
*value
)
762 GET_CURRENT_CONTEXT(ctx
);
763 _mesa_uniform_matrix(location
, count
, transpose
, value
,
764 ctx
, ctx
->_Shader
->ActiveProgram
, 3, 2, GLSL_TYPE_FLOAT
);
768 _mesa_UniformMatrix2x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
769 const GLfloat
*value
)
771 GET_CURRENT_CONTEXT(ctx
);
772 _mesa_uniform_matrix(location
, count
, transpose
, value
,
773 ctx
, ctx
->_Shader
->ActiveProgram
, 2, 4, GLSL_TYPE_FLOAT
);
777 _mesa_UniformMatrix4x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
778 const GLfloat
*value
)
780 GET_CURRENT_CONTEXT(ctx
);
781 _mesa_uniform_matrix(location
, count
, transpose
, value
,
782 ctx
, ctx
->_Shader
->ActiveProgram
, 4, 2, GLSL_TYPE_FLOAT
);
786 _mesa_UniformMatrix3x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
787 const GLfloat
*value
)
789 GET_CURRENT_CONTEXT(ctx
);
790 _mesa_uniform_matrix(location
, count
, transpose
, value
,
791 ctx
, ctx
->_Shader
->ActiveProgram
, 3, 4, GLSL_TYPE_FLOAT
);
795 _mesa_UniformMatrix4x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
796 const GLfloat
*value
)
798 GET_CURRENT_CONTEXT(ctx
);
799 _mesa_uniform_matrix(location
, count
, transpose
, value
,
800 ctx
, ctx
->_Shader
->ActiveProgram
, 4, 3, GLSL_TYPE_FLOAT
);
803 /** Same as above with direct state access **/
806 _mesa_ProgramUniformMatrix2x3fv(GLuint program
, GLint location
, GLsizei count
,
807 GLboolean transpose
, const GLfloat
* value
)
809 GET_CURRENT_CONTEXT(ctx
);
810 struct gl_shader_program
*shProg
=
811 _mesa_lookup_shader_program_err(ctx
, program
,
812 "glProgramUniformMatrix2x3fv");
813 _mesa_uniform_matrix(location
, count
, transpose
, value
, ctx
, shProg
, 2, 3, GLSL_TYPE_FLOAT
);
817 _mesa_ProgramUniformMatrix3x2fv(GLuint program
, GLint location
, GLsizei count
,
818 GLboolean transpose
, const GLfloat
* value
)
820 GET_CURRENT_CONTEXT(ctx
);
821 struct gl_shader_program
*shProg
=
822 _mesa_lookup_shader_program_err(ctx
, program
,
823 "glProgramUniformMatrix3x2fv");
824 _mesa_uniform_matrix(location
, count
, transpose
, value
, ctx
, shProg
, 3, 2, GLSL_TYPE_FLOAT
);
828 _mesa_ProgramUniformMatrix2x4fv(GLuint program
, GLint location
, GLsizei count
,
829 GLboolean transpose
, const GLfloat
* value
)
831 GET_CURRENT_CONTEXT(ctx
);
832 struct gl_shader_program
*shProg
=
833 _mesa_lookup_shader_program_err(ctx
, program
,
834 "glProgramUniformMatrix2x4fv");
835 _mesa_uniform_matrix(location
, count
, transpose
, value
, ctx
, shProg
, 2, 4, GLSL_TYPE_FLOAT
);
839 _mesa_ProgramUniformMatrix4x2fv(GLuint program
, GLint location
, GLsizei count
,
840 GLboolean transpose
, const GLfloat
* value
)
842 GET_CURRENT_CONTEXT(ctx
);
843 struct gl_shader_program
*shProg
=
844 _mesa_lookup_shader_program_err(ctx
, program
,
845 "glProgramUniformMatrix4x2fv");
846 _mesa_uniform_matrix(location
, count
, transpose
, value
, ctx
, shProg
, 4, 2, GLSL_TYPE_FLOAT
);
850 _mesa_ProgramUniformMatrix3x4fv(GLuint program
, GLint location
, GLsizei count
,
851 GLboolean transpose
, const GLfloat
* value
)
853 GET_CURRENT_CONTEXT(ctx
);
854 struct gl_shader_program
*shProg
=
855 _mesa_lookup_shader_program_err(ctx
, program
,
856 "glProgramUniformMatrix3x4fv");
857 _mesa_uniform_matrix(location
, count
, transpose
, value
, ctx
, shProg
, 3, 4, GLSL_TYPE_FLOAT
);
861 _mesa_ProgramUniformMatrix4x3fv(GLuint program
, GLint location
, GLsizei count
,
862 GLboolean transpose
, const GLfloat
* value
)
864 GET_CURRENT_CONTEXT(ctx
);
865 struct gl_shader_program
*shProg
=
866 _mesa_lookup_shader_program_err(ctx
, program
,
867 "glProgramUniformMatrix4x3fv");
868 _mesa_uniform_matrix(location
, count
, transpose
, value
, ctx
, shProg
, 4, 3, GLSL_TYPE_FLOAT
);
873 _mesa_GetnUniformfvARB(GLuint program
, GLint location
,
874 GLsizei bufSize
, GLfloat
*params
)
876 GET_CURRENT_CONTEXT(ctx
);
877 _mesa_get_uniform(ctx
, program
, location
, bufSize
, GLSL_TYPE_FLOAT
, params
);
881 _mesa_GetUniformfv(GLuint program
, GLint location
, GLfloat
*params
)
883 _mesa_GetnUniformfvARB(program
, location
, INT_MAX
, params
);
888 _mesa_GetnUniformivARB(GLuint program
, GLint location
,
889 GLsizei bufSize
, GLint
*params
)
891 GET_CURRENT_CONTEXT(ctx
);
892 _mesa_get_uniform(ctx
, program
, location
, bufSize
, GLSL_TYPE_INT
, params
);
896 _mesa_GetUniformiv(GLuint program
, GLint location
, GLint
*params
)
898 _mesa_GetnUniformivARB(program
, location
, INT_MAX
, params
);
904 _mesa_GetnUniformuivARB(GLuint program
, GLint location
,
905 GLsizei bufSize
, GLuint
*params
)
907 GET_CURRENT_CONTEXT(ctx
);
908 _mesa_get_uniform(ctx
, program
, location
, bufSize
, GLSL_TYPE_UINT
, params
);
912 _mesa_GetUniformuiv(GLuint program
, GLint location
, GLuint
*params
)
914 _mesa_GetnUniformuivARB(program
, location
, INT_MAX
, params
);
920 _mesa_GetnUniformdvARB(GLuint program
, GLint location
,
921 GLsizei bufSize
, GLdouble
*params
)
923 GET_CURRENT_CONTEXT(ctx
);
925 _mesa_get_uniform(ctx
, program
, location
, bufSize
, GLSL_TYPE_DOUBLE
, params
);
929 _mesa_GetUniformdv(GLuint program
, GLint location
, GLdouble
*params
)
931 _mesa_GetnUniformdvARB(program
, location
, INT_MAX
, params
);
935 _mesa_GetnUniformi64vARB(GLuint program
, GLint location
,
936 GLsizei bufSize
, GLint64
*params
)
938 GET_CURRENT_CONTEXT(ctx
);
939 _mesa_get_uniform(ctx
, program
, location
, bufSize
, GLSL_TYPE_INT64
, params
);
942 _mesa_GetUniformi64vARB(GLuint program
, GLint location
, GLint64
*params
)
944 _mesa_GetnUniformi64vARB(program
, location
, INT_MAX
, params
);
948 _mesa_GetnUniformui64vARB(GLuint program
, GLint location
,
949 GLsizei bufSize
, GLuint64
*params
)
951 GET_CURRENT_CONTEXT(ctx
);
952 _mesa_get_uniform(ctx
, program
, location
, bufSize
, GLSL_TYPE_UINT64
, params
);
956 _mesa_GetUniformui64vARB(GLuint program
, GLint location
, GLuint64
*params
)
958 _mesa_GetnUniformui64vARB(program
, location
, INT_MAX
, params
);
963 _mesa_GetUniformLocation(GLuint programObj
, const GLcharARB
*name
)
965 struct gl_shader_program
*shProg
;
967 GET_CURRENT_CONTEXT(ctx
);
969 shProg
= _mesa_lookup_shader_program_err(ctx
, programObj
,
970 "glGetUniformLocation");
974 /* Page 80 (page 94 of the PDF) of the OpenGL 2.1 spec says:
976 * "If program has not been successfully linked, the error
977 * INVALID_OPERATION is generated."
979 if (shProg
->data
->LinkStatus
== linking_failure
) {
980 _mesa_error(ctx
, GL_INVALID_OPERATION
,
981 "glGetUniformLocation(program not linked)");
985 return _mesa_program_resource_location(shProg
, GL_UNIFORM
, name
);
989 _mesa_GetUniformBlockIndex(GLuint program
,
990 const GLchar
*uniformBlockName
)
992 GET_CURRENT_CONTEXT(ctx
);
993 struct gl_shader_program
*shProg
;
995 if (!ctx
->Extensions
.ARB_uniform_buffer_object
) {
996 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glGetUniformBlockIndex");
997 return GL_INVALID_INDEX
;
1000 shProg
= _mesa_lookup_shader_program_err(ctx
, program
,
1001 "glGetUniformBlockIndex");
1003 return GL_INVALID_INDEX
;
1005 struct gl_program_resource
*res
=
1006 _mesa_program_resource_find_name(shProg
, GL_UNIFORM_BLOCK
,
1007 uniformBlockName
, NULL
);
1009 return GL_INVALID_INDEX
;
1011 return _mesa_program_resource_index(shProg
, res
);
1015 _mesa_GetUniformIndices(GLuint program
,
1016 GLsizei uniformCount
,
1017 const GLchar
* const *uniformNames
,
1018 GLuint
*uniformIndices
)
1020 GET_CURRENT_CONTEXT(ctx
);
1022 struct gl_shader_program
*shProg
;
1024 if (!ctx
->Extensions
.ARB_uniform_buffer_object
) {
1025 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glGetUniformIndices");
1029 shProg
= _mesa_lookup_shader_program_err(ctx
, program
,
1030 "glGetUniformIndices");
1034 if (uniformCount
< 0) {
1035 _mesa_error(ctx
, GL_INVALID_VALUE
,
1036 "glGetUniformIndices(uniformCount < 0)");
1040 for (i
= 0; i
< uniformCount
; i
++) {
1041 struct gl_program_resource
*res
=
1042 _mesa_program_resource_find_name(shProg
, GL_UNIFORM
, uniformNames
[i
],
1044 uniformIndices
[i
] = _mesa_program_resource_index(shProg
, res
);
1049 _mesa_UniformBlockBinding(GLuint program
,
1050 GLuint uniformBlockIndex
,
1051 GLuint uniformBlockBinding
)
1053 GET_CURRENT_CONTEXT(ctx
);
1054 struct gl_shader_program
*shProg
;
1056 if (!ctx
->Extensions
.ARB_uniform_buffer_object
) {
1057 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glUniformBlockBinding");
1061 shProg
= _mesa_lookup_shader_program_err(ctx
, program
,
1062 "glUniformBlockBinding");
1066 if (uniformBlockIndex
>= shProg
->data
->NumUniformBlocks
) {
1067 _mesa_error(ctx
, GL_INVALID_VALUE
,
1068 "glUniformBlockBinding(block index %u >= %u)",
1069 uniformBlockIndex
, shProg
->data
->NumUniformBlocks
);
1073 if (uniformBlockBinding
>= ctx
->Const
.MaxUniformBufferBindings
) {
1074 _mesa_error(ctx
, GL_INVALID_VALUE
,
1075 "glUniformBlockBinding(block binding %u >= %u)",
1076 uniformBlockBinding
, ctx
->Const
.MaxUniformBufferBindings
);
1080 if (shProg
->data
->UniformBlocks
[uniformBlockIndex
].Binding
!=
1081 uniformBlockBinding
) {
1083 FLUSH_VERTICES(ctx
, 0);
1084 ctx
->NewDriverState
|= ctx
->DriverFlags
.NewUniformBuffer
;
1086 shProg
->data
->UniformBlocks
[uniformBlockIndex
].Binding
=
1087 uniformBlockBinding
;
1092 _mesa_ShaderStorageBlockBinding(GLuint program
,
1093 GLuint shaderStorageBlockIndex
,
1094 GLuint shaderStorageBlockBinding
)
1096 GET_CURRENT_CONTEXT(ctx
);
1097 struct gl_shader_program
*shProg
;
1099 if (!ctx
->Extensions
.ARB_shader_storage_buffer_object
) {
1100 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glShaderStorageBlockBinding");
1104 shProg
= _mesa_lookup_shader_program_err(ctx
, program
,
1105 "glShaderStorageBlockBinding");
1109 if (shaderStorageBlockIndex
>= shProg
->data
->NumShaderStorageBlocks
) {
1110 _mesa_error(ctx
, GL_INVALID_VALUE
,
1111 "glShaderStorageBlockBinding(block index %u >= %u)",
1112 shaderStorageBlockIndex
,
1113 shProg
->data
->NumShaderStorageBlocks
);
1117 if (shaderStorageBlockBinding
>= ctx
->Const
.MaxShaderStorageBufferBindings
) {
1118 _mesa_error(ctx
, GL_INVALID_VALUE
,
1119 "glShaderStorageBlockBinding(block binding %u >= %u)",
1120 shaderStorageBlockBinding
,
1121 ctx
->Const
.MaxShaderStorageBufferBindings
);
1125 if (shProg
->data
->ShaderStorageBlocks
[shaderStorageBlockIndex
].Binding
!=
1126 shaderStorageBlockBinding
) {
1128 FLUSH_VERTICES(ctx
, 0);
1129 ctx
->NewDriverState
|= ctx
->DriverFlags
.NewShaderStorageBuffer
;
1131 shProg
->data
->ShaderStorageBlocks
[shaderStorageBlockIndex
].Binding
=
1132 shaderStorageBlockBinding
;
1137 * Generic program resource property query.
1140 mesa_bufferiv(struct gl_shader_program
*shProg
, GLenum type
,
1141 GLuint index
, GLenum pname
, GLint
*params
, const char *caller
)
1143 GET_CURRENT_CONTEXT(ctx
);
1144 struct gl_program_resource
*res
=
1145 _mesa_program_resource_find_index(shProg
, type
, index
);
1148 _mesa_error(ctx
, GL_INVALID_VALUE
, "%s(bufferindex %d)", caller
, index
);
1153 case GL_UNIFORM_BLOCK_BINDING
:
1154 case GL_ATOMIC_COUNTER_BUFFER_BINDING
:
1155 _mesa_program_resource_prop(shProg
, res
, index
, GL_BUFFER_BINDING
,
1158 case GL_UNIFORM_BLOCK_DATA_SIZE
:
1159 case GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE
:
1160 _mesa_program_resource_prop(shProg
, res
, index
, GL_BUFFER_DATA_SIZE
,
1163 case GL_UNIFORM_BLOCK_NAME_LENGTH
:
1164 _mesa_program_resource_prop(shProg
, res
, index
, GL_NAME_LENGTH
,
1167 case GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS
:
1168 case GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS
:
1169 _mesa_program_resource_prop(shProg
, res
, index
, GL_NUM_ACTIVE_VARIABLES
,
1172 case GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES
:
1173 case GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES
:
1174 _mesa_program_resource_prop(shProg
, res
, index
, GL_ACTIVE_VARIABLES
,
1177 case GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER
:
1178 case GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER
:
1179 _mesa_program_resource_prop(shProg
, res
, index
,
1180 GL_REFERENCED_BY_VERTEX_SHADER
, params
,
1184 case GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER
:
1185 case GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER
:
1186 _mesa_program_resource_prop(shProg
, res
, index
,
1187 GL_REFERENCED_BY_TESS_CONTROL_SHADER
, params
,
1191 case GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER
:
1192 case GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER
:
1193 _mesa_program_resource_prop(shProg
, res
, index
,
1194 GL_REFERENCED_BY_TESS_EVALUATION_SHADER
, params
,
1198 case GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER
:
1199 case GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER
:
1200 _mesa_program_resource_prop(shProg
, res
, index
,
1201 GL_REFERENCED_BY_GEOMETRY_SHADER
, params
,
1204 case GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER
:
1205 case GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER
:
1206 _mesa_program_resource_prop(shProg
, res
, index
,
1207 GL_REFERENCED_BY_FRAGMENT_SHADER
, params
,
1210 case GL_UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER
:
1211 case GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER
:
1212 _mesa_program_resource_prop(shProg
, res
, index
,
1213 GL_REFERENCED_BY_COMPUTE_SHADER
, params
,
1217 _mesa_error(ctx
, GL_INVALID_ENUM
,
1218 "%s(pname 0x%x (%s))", caller
, pname
,
1219 _mesa_enum_to_string(pname
));
1226 _mesa_GetActiveUniformBlockiv(GLuint program
,
1227 GLuint uniformBlockIndex
,
1231 GET_CURRENT_CONTEXT(ctx
);
1232 struct gl_shader_program
*shProg
;
1234 if (!ctx
->Extensions
.ARB_uniform_buffer_object
) {
1235 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glGetActiveUniformBlockiv");
1239 shProg
= _mesa_lookup_shader_program_err(ctx
, program
,
1240 "glGetActiveUniformBlockiv");
1244 mesa_bufferiv(shProg
, GL_UNIFORM_BLOCK
, uniformBlockIndex
, pname
, params
,
1245 "glGetActiveUniformBlockiv");
1249 _mesa_GetActiveUniformBlockName(GLuint program
,
1250 GLuint uniformBlockIndex
,
1253 GLchar
*uniformBlockName
)
1255 GET_CURRENT_CONTEXT(ctx
);
1256 struct gl_shader_program
*shProg
;
1258 if (!ctx
->Extensions
.ARB_uniform_buffer_object
) {
1259 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glGetActiveUniformBlockiv");
1264 _mesa_error(ctx
, GL_INVALID_VALUE
,
1265 "glGetActiveUniformBlockName(bufSize %d < 0)",
1270 shProg
= _mesa_lookup_shader_program_err(ctx
, program
,
1271 "glGetActiveUniformBlockiv");
1275 if (uniformBlockName
)
1276 _mesa_get_program_resource_name(shProg
, GL_UNIFORM_BLOCK
,
1277 uniformBlockIndex
, bufSize
, length
,
1279 "glGetActiveUniformBlockName");
1283 _mesa_GetActiveUniformName(GLuint program
, GLuint uniformIndex
,
1284 GLsizei bufSize
, GLsizei
*length
,
1285 GLchar
*uniformName
)
1287 GET_CURRENT_CONTEXT(ctx
);
1288 struct gl_shader_program
*shProg
;
1290 if (!ctx
->Extensions
.ARB_uniform_buffer_object
) {
1291 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glGetActiveUniformName");
1296 _mesa_error(ctx
, GL_INVALID_VALUE
,
1297 "glGetActiveUniformName(bufSize %d < 0)",
1302 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glGetActiveUniformName");
1307 _mesa_get_program_resource_name(shProg
, GL_UNIFORM
, uniformIndex
, bufSize
,
1308 length
, uniformName
, "glGetActiveUniformName");
1312 _mesa_GetActiveAtomicCounterBufferiv(GLuint program
, GLuint bufferIndex
,
1313 GLenum pname
, GLint
*params
)
1315 GET_CURRENT_CONTEXT(ctx
);
1316 struct gl_shader_program
*shProg
;
1318 if (!ctx
->Extensions
.ARB_shader_atomic_counters
) {
1319 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1320 "glGetActiveAtomicCounterBufferiv");
1324 shProg
= _mesa_lookup_shader_program_err(ctx
, program
,
1325 "glGetActiveAtomicCounterBufferiv");
1329 mesa_bufferiv(shProg
, GL_ATOMIC_COUNTER_BUFFER
, bufferIndex
, pname
, params
,
1330 "glGetActiveAtomicCounterBufferiv");
1334 _mesa_Uniform1d(GLint location
, GLdouble v0
)
1336 GET_CURRENT_CONTEXT(ctx
);
1337 _mesa_uniform(location
, 1, &v0
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_DOUBLE
, 1);
1341 _mesa_Uniform2d(GLint location
, GLdouble v0
, GLdouble v1
)
1343 GET_CURRENT_CONTEXT(ctx
);
1347 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_DOUBLE
, 2);
1351 _mesa_Uniform3d(GLint location
, GLdouble v0
, GLdouble v1
, GLdouble v2
)
1353 GET_CURRENT_CONTEXT(ctx
);
1358 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_DOUBLE
, 3);
1362 _mesa_Uniform4d(GLint location
, GLdouble v0
, GLdouble v1
, GLdouble v2
,
1365 GET_CURRENT_CONTEXT(ctx
);
1371 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_DOUBLE
, 4);
1375 _mesa_Uniform1dv(GLint location
, GLsizei count
, const GLdouble
* value
)
1377 GET_CURRENT_CONTEXT(ctx
);
1378 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_DOUBLE
, 1);
1382 _mesa_Uniform2dv(GLint location
, GLsizei count
, const GLdouble
* value
)
1384 GET_CURRENT_CONTEXT(ctx
);
1385 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_DOUBLE
, 2);
1389 _mesa_Uniform3dv(GLint location
, GLsizei count
, const GLdouble
* value
)
1391 GET_CURRENT_CONTEXT(ctx
);
1392 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_DOUBLE
, 3);
1396 _mesa_Uniform4dv(GLint location
, GLsizei count
, const GLdouble
* value
)
1398 GET_CURRENT_CONTEXT(ctx
);
1399 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_DOUBLE
, 4);
1403 _mesa_UniformMatrix2dv(GLint location
, GLsizei count
, GLboolean transpose
,
1404 const GLdouble
* value
)
1406 GET_CURRENT_CONTEXT(ctx
);
1407 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1408 ctx
, ctx
->_Shader
->ActiveProgram
, 2, 2, GLSL_TYPE_DOUBLE
);
1412 _mesa_UniformMatrix3dv(GLint location
, GLsizei count
, GLboolean transpose
,
1413 const GLdouble
* value
)
1415 GET_CURRENT_CONTEXT(ctx
);
1416 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1417 ctx
, ctx
->_Shader
->ActiveProgram
, 3, 3, GLSL_TYPE_DOUBLE
);
1421 _mesa_UniformMatrix4dv(GLint location
, GLsizei count
, GLboolean transpose
,
1422 const GLdouble
* value
)
1424 GET_CURRENT_CONTEXT(ctx
);
1425 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1426 ctx
, ctx
->_Shader
->ActiveProgram
, 4, 4, GLSL_TYPE_DOUBLE
);
1430 _mesa_UniformMatrix2x3dv(GLint location
, GLsizei count
, GLboolean transpose
,
1431 const GLdouble
*value
)
1433 GET_CURRENT_CONTEXT(ctx
);
1434 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1435 ctx
, ctx
->_Shader
->ActiveProgram
, 2, 3, GLSL_TYPE_DOUBLE
);
1439 _mesa_UniformMatrix3x2dv(GLint location
, GLsizei count
, GLboolean transpose
,
1440 const GLdouble
*value
)
1442 GET_CURRENT_CONTEXT(ctx
);
1443 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1444 ctx
, ctx
->_Shader
->ActiveProgram
, 3, 2, GLSL_TYPE_DOUBLE
);
1448 _mesa_UniformMatrix2x4dv(GLint location
, GLsizei count
, GLboolean transpose
,
1449 const GLdouble
*value
)
1451 GET_CURRENT_CONTEXT(ctx
);
1452 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1453 ctx
, ctx
->_Shader
->ActiveProgram
, 2, 4, GLSL_TYPE_DOUBLE
);
1457 _mesa_UniformMatrix4x2dv(GLint location
, GLsizei count
, GLboolean transpose
,
1458 const GLdouble
*value
)
1460 GET_CURRENT_CONTEXT(ctx
);
1461 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1462 ctx
, ctx
->_Shader
->ActiveProgram
, 4, 2, GLSL_TYPE_DOUBLE
);
1466 _mesa_UniformMatrix3x4dv(GLint location
, GLsizei count
, GLboolean transpose
,
1467 const GLdouble
*value
)
1469 GET_CURRENT_CONTEXT(ctx
);
1470 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1471 ctx
, ctx
->_Shader
->ActiveProgram
, 3, 4, GLSL_TYPE_DOUBLE
);
1475 _mesa_UniformMatrix4x3dv(GLint location
, GLsizei count
, GLboolean transpose
,
1476 const GLdouble
*value
)
1478 GET_CURRENT_CONTEXT(ctx
);
1479 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1480 ctx
, ctx
->_Shader
->ActiveProgram
, 4, 3, GLSL_TYPE_DOUBLE
);
1484 _mesa_ProgramUniform1d(GLuint program
, GLint location
, GLdouble v0
)
1486 GET_CURRENT_CONTEXT(ctx
);
1487 struct gl_shader_program
*shProg
=
1488 _mesa_lookup_shader_program_err(ctx
, program
,
1489 "glProgramUniform1d");
1490 _mesa_uniform(location
, 1, &v0
, ctx
, shProg
, GLSL_TYPE_DOUBLE
, 1);
1494 _mesa_ProgramUniform2d(GLuint program
, GLint location
, GLdouble v0
, GLdouble v1
)
1496 GET_CURRENT_CONTEXT(ctx
);
1498 struct gl_shader_program
*shProg
;
1501 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform2d");
1502 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_DOUBLE
, 2);
1506 _mesa_ProgramUniform3d(GLuint program
, GLint location
, GLdouble v0
, GLdouble v1
,
1509 GET_CURRENT_CONTEXT(ctx
);
1511 struct gl_shader_program
*shProg
;
1515 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform3d");
1516 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_DOUBLE
, 3);
1520 _mesa_ProgramUniform4d(GLuint program
, GLint location
, GLdouble v0
, GLdouble v1
,
1521 GLdouble v2
, GLdouble v3
)
1523 GET_CURRENT_CONTEXT(ctx
);
1525 struct gl_shader_program
*shProg
;
1530 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform4d");
1531 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_DOUBLE
, 4);
1535 _mesa_ProgramUniform1dv(GLuint program
, GLint location
, GLsizei count
,
1536 const GLdouble
* value
)
1538 GET_CURRENT_CONTEXT(ctx
);
1539 struct gl_shader_program
*shProg
=
1540 _mesa_lookup_shader_program_err(ctx
, program
,
1541 "glProgramUniform1dv");
1542 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_DOUBLE
, 1);
1546 _mesa_ProgramUniform2dv(GLuint program
, GLint location
, GLsizei count
,
1547 const GLdouble
* value
)
1549 GET_CURRENT_CONTEXT(ctx
);
1550 struct gl_shader_program
*shProg
=
1551 _mesa_lookup_shader_program_err(ctx
, program
,
1552 "glProgramUniform2dv");
1553 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_DOUBLE
, 2);
1557 _mesa_ProgramUniform3dv(GLuint program
, GLint location
, GLsizei count
,
1558 const GLdouble
* value
)
1560 GET_CURRENT_CONTEXT(ctx
);
1561 struct gl_shader_program
*shProg
=
1562 _mesa_lookup_shader_program_err(ctx
, program
,
1563 "glProgramUniform3dv");
1564 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_DOUBLE
, 3);
1568 _mesa_ProgramUniform4dv(GLuint program
, GLint location
, GLsizei count
,
1569 const GLdouble
* value
)
1571 GET_CURRENT_CONTEXT(ctx
);
1572 struct gl_shader_program
*shProg
=
1573 _mesa_lookup_shader_program_err(ctx
, program
,
1574 "glProgramUniform4dv");
1575 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_DOUBLE
, 4);
1579 _mesa_ProgramUniformMatrix2dv(GLuint program
, GLint location
, GLsizei count
,
1580 GLboolean transpose
, const GLdouble
* value
)
1582 GET_CURRENT_CONTEXT(ctx
);
1583 struct gl_shader_program
*shProg
=
1584 _mesa_lookup_shader_program_err(ctx
, program
,
1585 "glProgramUniformMatrix2dv");
1586 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1587 ctx
, shProg
, 2, 2, GLSL_TYPE_DOUBLE
);
1591 _mesa_ProgramUniformMatrix3dv(GLuint program
, GLint location
, GLsizei count
,
1592 GLboolean transpose
, const GLdouble
* value
)
1594 GET_CURRENT_CONTEXT(ctx
);
1595 struct gl_shader_program
*shProg
=
1596 _mesa_lookup_shader_program_err(ctx
, program
,
1597 "glProgramUniformMatrix3dv");
1598 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1599 ctx
, shProg
, 3, 3, GLSL_TYPE_DOUBLE
);
1603 _mesa_ProgramUniformMatrix4dv(GLuint program
, GLint location
, GLsizei count
,
1604 GLboolean transpose
, const GLdouble
* value
)
1606 GET_CURRENT_CONTEXT(ctx
);
1607 struct gl_shader_program
*shProg
=
1608 _mesa_lookup_shader_program_err(ctx
, program
,
1609 "glProgramUniformMatrix4dv");
1610 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1611 ctx
, shProg
, 4, 4, GLSL_TYPE_DOUBLE
);
1615 _mesa_ProgramUniformMatrix2x3dv(GLuint program
, GLint location
, GLsizei count
,
1616 GLboolean transpose
, const GLdouble
* value
)
1618 GET_CURRENT_CONTEXT(ctx
);
1619 struct gl_shader_program
*shProg
=
1620 _mesa_lookup_shader_program_err(ctx
, program
,
1621 "glProgramUniformMatrix2x3dv");
1622 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1623 ctx
, shProg
, 2, 3, GLSL_TYPE_DOUBLE
);
1627 _mesa_ProgramUniformMatrix3x2dv(GLuint program
, GLint location
, GLsizei count
,
1628 GLboolean transpose
, const GLdouble
* value
)
1630 GET_CURRENT_CONTEXT(ctx
);
1631 struct gl_shader_program
*shProg
=
1632 _mesa_lookup_shader_program_err(ctx
, program
,
1633 "glProgramUniformMatrix3x2dv");
1634 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1635 ctx
, shProg
, 3, 2, GLSL_TYPE_DOUBLE
);
1639 _mesa_ProgramUniformMatrix2x4dv(GLuint program
, GLint location
, GLsizei count
,
1640 GLboolean transpose
, const GLdouble
* value
)
1642 GET_CURRENT_CONTEXT(ctx
);
1643 struct gl_shader_program
*shProg
=
1644 _mesa_lookup_shader_program_err(ctx
, program
,
1645 "glProgramUniformMatrix2x4dv");
1646 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1647 ctx
, shProg
, 2, 4, GLSL_TYPE_DOUBLE
);
1651 _mesa_ProgramUniformMatrix4x2dv(GLuint program
, GLint location
, GLsizei count
,
1652 GLboolean transpose
, const GLdouble
* value
)
1654 GET_CURRENT_CONTEXT(ctx
);
1655 struct gl_shader_program
*shProg
=
1656 _mesa_lookup_shader_program_err(ctx
, program
,
1657 "glProgramUniformMatrix4x2dv");
1658 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1659 ctx
, shProg
, 4, 2, GLSL_TYPE_DOUBLE
);
1663 _mesa_ProgramUniformMatrix3x4dv(GLuint program
, GLint location
, GLsizei count
,
1664 GLboolean transpose
, const GLdouble
* value
)
1666 GET_CURRENT_CONTEXT(ctx
);
1667 struct gl_shader_program
*shProg
=
1668 _mesa_lookup_shader_program_err(ctx
, program
,
1669 "glProgramUniformMatrix3x4dv");
1670 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1671 ctx
, shProg
, 3, 4, GLSL_TYPE_DOUBLE
);
1675 _mesa_ProgramUniformMatrix4x3dv(GLuint program
, GLint location
, GLsizei count
,
1676 GLboolean transpose
, const GLdouble
* value
)
1678 GET_CURRENT_CONTEXT(ctx
);
1679 struct gl_shader_program
*shProg
=
1680 _mesa_lookup_shader_program_err(ctx
, program
,
1681 "glProgramUniformMatrix4x3dv");
1682 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1683 ctx
, shProg
, 4, 3, GLSL_TYPE_DOUBLE
);
1687 _mesa_Uniform1i64ARB(GLint location
, GLint64 v0
)
1689 GET_CURRENT_CONTEXT(ctx
);
1690 _mesa_uniform(location
, 1, &v0
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT64
, 1);
1694 _mesa_Uniform2i64ARB(GLint location
, GLint64 v0
, GLint64 v1
)
1696 GET_CURRENT_CONTEXT(ctx
);
1700 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT64
, 2);
1704 _mesa_Uniform3i64ARB(GLint location
, GLint64 v0
, GLint64 v1
, GLint64 v2
)
1706 GET_CURRENT_CONTEXT(ctx
);
1711 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT64
, 3);
1715 _mesa_Uniform4i64ARB(GLint location
, GLint64 v0
, GLint64 v1
, GLint64 v2
, GLint64 v3
)
1717 GET_CURRENT_CONTEXT(ctx
);
1723 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT64
, 4);
1727 _mesa_Uniform1i64vARB(GLint location
, GLsizei count
, const GLint64
*value
)
1729 GET_CURRENT_CONTEXT(ctx
);
1730 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT64
, 1);
1734 _mesa_Uniform2i64vARB(GLint location
, GLsizei count
, const GLint64
*value
)
1736 GET_CURRENT_CONTEXT(ctx
);
1737 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT64
, 2);
1741 _mesa_Uniform3i64vARB(GLint location
, GLsizei count
, const GLint64
*value
)
1743 GET_CURRENT_CONTEXT(ctx
);
1744 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT64
, 3);
1748 _mesa_Uniform4i64vARB(GLint location
, GLsizei count
, const GLint64
*value
)
1750 GET_CURRENT_CONTEXT(ctx
);
1751 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT64
, 4);
1755 _mesa_Uniform1ui64ARB(GLint location
, GLuint64 v0
)
1757 GET_CURRENT_CONTEXT(ctx
);
1758 _mesa_uniform(location
, 1, &v0
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT64
, 1);
1762 _mesa_Uniform2ui64ARB(GLint location
, GLuint64 v0
, GLuint64 v1
)
1764 GET_CURRENT_CONTEXT(ctx
);
1768 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT64
, 2);
1772 _mesa_Uniform3ui64ARB(GLint location
, GLuint64 v0
, GLuint64 v1
, GLuint64 v2
)
1774 GET_CURRENT_CONTEXT(ctx
);
1779 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT64
, 3);
1783 _mesa_Uniform4ui64ARB(GLint location
, GLuint64 v0
, GLuint64 v1
, GLuint64 v2
, GLuint64 v3
)
1785 GET_CURRENT_CONTEXT(ctx
);
1791 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT64
, 4);
1795 _mesa_Uniform1ui64vARB(GLint location
, GLsizei count
, const GLuint64
*value
)
1797 GET_CURRENT_CONTEXT(ctx
);
1798 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT64
, 1);
1802 _mesa_Uniform2ui64vARB(GLint location
, GLsizei count
, const GLuint64
*value
)
1804 GET_CURRENT_CONTEXT(ctx
);
1805 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT64
, 2);
1809 _mesa_Uniform3ui64vARB(GLint location
, GLsizei count
, const GLuint64
*value
)
1811 GET_CURRENT_CONTEXT(ctx
);
1812 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT64
, 3);
1816 _mesa_Uniform4ui64vARB(GLint location
, GLsizei count
, const GLuint64
*value
)
1818 GET_CURRENT_CONTEXT(ctx
);
1819 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT64
, 4);
1822 /* DSA entrypoints */
1824 _mesa_ProgramUniform1i64ARB(GLuint program
, GLint location
, GLint64 v0
)
1826 GET_CURRENT_CONTEXT(ctx
);
1827 struct gl_shader_program
*shProg
=
1828 _mesa_lookup_shader_program_err(ctx
, program
,
1829 "glProgramUniform1i64ARB");
1830 _mesa_uniform(location
, 1, &v0
, ctx
, shProg
, GLSL_TYPE_INT64
, 1);
1834 _mesa_ProgramUniform2i64ARB(GLuint program
, GLint location
, GLint64 v0
, GLint64 v1
)
1836 GET_CURRENT_CONTEXT(ctx
);
1837 struct gl_shader_program
*shProg
=
1838 _mesa_lookup_shader_program_err(ctx
, program
,
1839 "glProgramUniform2i64ARB");
1843 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_INT64
, 2);
1847 _mesa_ProgramUniform3i64ARB(GLuint program
, GLint location
, GLint64 v0
, GLint64 v1
, GLint64 v2
)
1849 GET_CURRENT_CONTEXT(ctx
);
1850 struct gl_shader_program
*shProg
=
1851 _mesa_lookup_shader_program_err(ctx
, program
,
1852 "glProgramUniform3i64ARB");
1857 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_INT64
, 3);
1861 _mesa_ProgramUniform4i64ARB(GLuint program
, GLint location
, GLint64 v0
, GLint64 v1
, GLint64 v2
, GLint64 v3
)
1863 GET_CURRENT_CONTEXT(ctx
);
1864 struct gl_shader_program
*shProg
=
1865 _mesa_lookup_shader_program_err(ctx
, program
,
1866 "glProgramUniform4i64ARB");
1872 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_INT64
, 4);
1876 _mesa_ProgramUniform1i64vARB(GLuint program
, GLint location
, GLsizei count
, const GLint64
*value
)
1878 GET_CURRENT_CONTEXT(ctx
);
1879 struct gl_shader_program
*shProg
=
1880 _mesa_lookup_shader_program_err(ctx
, program
,
1881 "glProgramUniform1i64vARB");
1882 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_INT64
, 1);
1886 _mesa_ProgramUniform2i64vARB(GLuint program
, GLint location
, GLsizei count
, const GLint64
*value
)
1888 GET_CURRENT_CONTEXT(ctx
);
1889 struct gl_shader_program
*shProg
=
1890 _mesa_lookup_shader_program_err(ctx
, program
,
1891 "glProgramUniform2i64vARB");
1892 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_INT64
, 2);
1896 _mesa_ProgramUniform3i64vARB(GLuint program
, GLint location
, GLsizei count
, const GLint64
*value
)
1898 GET_CURRENT_CONTEXT(ctx
);
1899 struct gl_shader_program
*shProg
=
1900 _mesa_lookup_shader_program_err(ctx
, program
,
1901 "glProgramUniform3i64vARB");
1902 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_INT64
, 3);
1906 _mesa_ProgramUniform4i64vARB(GLuint program
, GLint location
, GLsizei count
, const GLint64
*value
)
1908 GET_CURRENT_CONTEXT(ctx
);
1909 struct gl_shader_program
*shProg
=
1910 _mesa_lookup_shader_program_err(ctx
, program
,
1911 "glProgramUniform4i64vARB");
1912 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_INT64
, 4);
1916 _mesa_ProgramUniform1ui64ARB(GLuint program
, GLint location
, GLuint64 v0
)
1918 GET_CURRENT_CONTEXT(ctx
);
1919 struct gl_shader_program
*shProg
=
1920 _mesa_lookup_shader_program_err(ctx
, program
,
1921 "glProgramUniform1ui64ARB");
1922 _mesa_uniform(location
, 1, &v0
, ctx
, shProg
, GLSL_TYPE_UINT64
, 1);
1926 _mesa_ProgramUniform2ui64ARB(GLuint program
, GLint location
, GLuint64 v0
, GLuint64 v1
)
1928 GET_CURRENT_CONTEXT(ctx
);
1929 struct gl_shader_program
*shProg
=
1930 _mesa_lookup_shader_program_err(ctx
, program
,
1931 "glProgramUniform2ui64ARB");
1935 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_UINT64
, 2);
1939 _mesa_ProgramUniform3ui64ARB(GLuint program
, GLint location
, GLuint64 v0
, GLuint64 v1
, GLuint64 v2
)
1941 GET_CURRENT_CONTEXT(ctx
);
1942 struct gl_shader_program
*shProg
=
1943 _mesa_lookup_shader_program_err(ctx
, program
,
1944 "glProgramUniform3ui64ARB");
1949 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_UINT64
, 3);
1953 _mesa_ProgramUniform4ui64ARB(GLuint program
, GLint location
, GLuint64 v0
, GLuint64 v1
, GLuint64 v2
, GLuint64 v3
)
1955 GET_CURRENT_CONTEXT(ctx
);
1956 struct gl_shader_program
*shProg
=
1957 _mesa_lookup_shader_program_err(ctx
, program
,
1958 "glProgramUniform4ui64ARB");
1964 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_UINT64
, 4);
1968 _mesa_ProgramUniform1ui64vARB(GLuint program
, GLint location
, GLsizei count
, const GLuint64
*value
)
1970 GET_CURRENT_CONTEXT(ctx
);
1971 struct gl_shader_program
*shProg
=
1972 _mesa_lookup_shader_program_err(ctx
, program
,
1973 "glProgramUniform1ui64vARB");
1974 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_UINT64
, 1);
1978 _mesa_ProgramUniform2ui64vARB(GLuint program
, GLint location
, GLsizei count
, const GLuint64
*value
)
1980 GET_CURRENT_CONTEXT(ctx
);
1981 struct gl_shader_program
*shProg
=
1982 _mesa_lookup_shader_program_err(ctx
, program
,
1983 "glProgramUniform2ui64vARB");
1984 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_UINT64
, 2);
1988 _mesa_ProgramUniform3ui64vARB(GLuint program
, GLint location
, GLsizei count
, const GLuint64
*value
)
1990 GET_CURRENT_CONTEXT(ctx
);
1991 struct gl_shader_program
*shProg
=
1992 _mesa_lookup_shader_program_err(ctx
, program
,
1993 "glProgramUniform3ui64vARB");
1994 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_UINT64
, 3);
1998 _mesa_ProgramUniform4ui64vARB(GLuint program
, GLint location
, GLsizei count
, const GLuint64
*value
)
2000 GET_CURRENT_CONTEXT(ctx
);
2001 struct gl_shader_program
*shProg
=
2002 _mesa_lookup_shader_program_err(ctx
, program
,
2003 "glProgramUniform4ui64vARB");
2004 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_UINT64
, 4);