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);
297 /** Same as above with direct state access **/
299 _mesa_ProgramUniform1f(GLuint program
, GLint location
, GLfloat v0
)
301 GET_CURRENT_CONTEXT(ctx
);
302 struct gl_shader_program
*shProg
=
303 _mesa_lookup_shader_program_err(ctx
, program
,
304 "glProgramUniform1f");
305 _mesa_uniform(location
, 1, &v0
, ctx
, shProg
, GLSL_TYPE_FLOAT
, 1);
309 _mesa_ProgramUniform2f(GLuint program
, GLint location
, GLfloat v0
, GLfloat v1
)
311 GET_CURRENT_CONTEXT(ctx
);
313 struct gl_shader_program
*shProg
;
316 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform2f");
317 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_FLOAT
, 2);
321 _mesa_ProgramUniform3f(GLuint program
, GLint location
, GLfloat v0
, GLfloat v1
,
324 GET_CURRENT_CONTEXT(ctx
);
326 struct gl_shader_program
*shProg
;
330 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform3f");
331 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_FLOAT
, 3);
335 _mesa_ProgramUniform4f(GLuint program
, GLint location
, GLfloat v0
, GLfloat v1
,
336 GLfloat v2
, GLfloat v3
)
338 GET_CURRENT_CONTEXT(ctx
);
340 struct gl_shader_program
*shProg
;
345 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform4f");
346 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_FLOAT
, 4);
350 _mesa_ProgramUniform1i(GLuint program
, GLint location
, GLint v0
)
352 GET_CURRENT_CONTEXT(ctx
);
353 struct gl_shader_program
*shProg
=
354 _mesa_lookup_shader_program_err(ctx
, program
,
355 "glProgramUniform1i");
356 _mesa_uniform(location
, 1, &v0
, ctx
, shProg
, GLSL_TYPE_INT
, 1);
360 _mesa_ProgramUniform2i(GLuint program
, GLint location
, GLint v0
, GLint v1
)
362 GET_CURRENT_CONTEXT(ctx
);
364 struct gl_shader_program
*shProg
;
367 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform2i");
368 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_INT
, 2);
372 _mesa_ProgramUniform3i(GLuint program
, GLint location
, GLint v0
, GLint v1
,
375 GET_CURRENT_CONTEXT(ctx
);
377 struct gl_shader_program
*shProg
;
381 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform3i");
382 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_INT
, 3);
386 _mesa_ProgramUniform4i(GLuint program
, GLint location
, GLint v0
, GLint v1
,
389 GET_CURRENT_CONTEXT(ctx
);
391 struct gl_shader_program
*shProg
;
396 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform4i");
397 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_INT
, 4);
401 _mesa_ProgramUniform1fv(GLuint program
, GLint location
, GLsizei count
,
402 const GLfloat
* value
)
404 GET_CURRENT_CONTEXT(ctx
);
405 struct gl_shader_program
*shProg
=
406 _mesa_lookup_shader_program_err(ctx
, program
,
407 "glProgramUniform1fv");
408 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_FLOAT
, 1);
412 _mesa_ProgramUniform2fv(GLuint program
, GLint location
, GLsizei count
,
413 const GLfloat
* value
)
415 GET_CURRENT_CONTEXT(ctx
);
416 struct gl_shader_program
*shProg
=
417 _mesa_lookup_shader_program_err(ctx
, program
,
418 "glProgramUniform2fv");
419 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_FLOAT
, 2);
423 _mesa_ProgramUniform3fv(GLuint program
, GLint location
, GLsizei count
,
424 const GLfloat
* value
)
426 GET_CURRENT_CONTEXT(ctx
);
427 struct gl_shader_program
*shProg
=
428 _mesa_lookup_shader_program_err(ctx
, program
,
429 "glProgramUniform3fv");
430 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_FLOAT
, 3);
434 _mesa_ProgramUniform4fv(GLuint program
, GLint location
, GLsizei count
,
435 const GLfloat
* value
)
437 GET_CURRENT_CONTEXT(ctx
);
438 struct gl_shader_program
*shProg
=
439 _mesa_lookup_shader_program_err(ctx
, program
,
440 "glProgramUniform4fv");
441 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_FLOAT
, 4);
445 _mesa_ProgramUniform1iv(GLuint program
, GLint location
, GLsizei count
,
448 GET_CURRENT_CONTEXT(ctx
);
449 struct gl_shader_program
*shProg
=
450 _mesa_lookup_shader_program_err(ctx
, program
,
451 "glProgramUniform1iv");
452 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_INT
, 1);
456 _mesa_ProgramUniform2iv(GLuint program
, GLint location
, GLsizei count
,
459 GET_CURRENT_CONTEXT(ctx
);
460 struct gl_shader_program
*shProg
=
461 _mesa_lookup_shader_program_err(ctx
, program
,
462 "glProgramUniform2iv");
463 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_INT
, 2);
467 _mesa_ProgramUniform3iv(GLuint program
, GLint location
, GLsizei count
,
470 GET_CURRENT_CONTEXT(ctx
);
471 struct gl_shader_program
*shProg
=
472 _mesa_lookup_shader_program_err(ctx
, program
,
473 "glProgramUniform3iv");
474 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_INT
, 3);
478 _mesa_ProgramUniform4iv(GLuint program
, GLint location
, GLsizei count
,
481 GET_CURRENT_CONTEXT(ctx
);
482 struct gl_shader_program
*shProg
=
483 _mesa_lookup_shader_program_err(ctx
, program
,
484 "glProgramUniform4iv");
485 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_INT
, 4);
489 /** OpenGL 3.0 GLuint-valued functions **/
491 _mesa_Uniform1ui(GLint location
, GLuint v0
)
493 GET_CURRENT_CONTEXT(ctx
);
494 _mesa_uniform(location
, 1, &v0
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT
, 1);
498 _mesa_Uniform2ui(GLint location
, GLuint v0
, GLuint v1
)
500 GET_CURRENT_CONTEXT(ctx
);
504 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT
, 2);
508 _mesa_Uniform3ui(GLint location
, GLuint v0
, GLuint v1
, GLuint v2
)
510 GET_CURRENT_CONTEXT(ctx
);
515 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT
, 3);
519 _mesa_Uniform4ui(GLint location
, GLuint v0
, GLuint v1
, GLuint v2
, GLuint v3
)
521 GET_CURRENT_CONTEXT(ctx
);
527 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT
, 4);
531 _mesa_Uniform1uiv(GLint location
, GLsizei count
, const GLuint
*value
)
533 GET_CURRENT_CONTEXT(ctx
);
534 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT
, 1);
538 _mesa_Uniform2uiv(GLint location
, GLsizei count
, const GLuint
*value
)
540 GET_CURRENT_CONTEXT(ctx
);
541 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT
, 2);
545 _mesa_Uniform3uiv(GLint location
, GLsizei count
, const GLuint
*value
)
547 GET_CURRENT_CONTEXT(ctx
);
548 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT
, 3);
552 _mesa_Uniform4uiv(GLint location
, GLsizei count
, const GLuint
*value
)
554 GET_CURRENT_CONTEXT(ctx
);
555 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT
, 4);
561 _mesa_UniformMatrix2fv(GLint location
, GLsizei count
, GLboolean transpose
,
562 const GLfloat
* value
)
564 GET_CURRENT_CONTEXT(ctx
);
565 _mesa_uniform_matrix(location
, count
, transpose
, value
,
566 ctx
, ctx
->_Shader
->ActiveProgram
, 2, 2, GLSL_TYPE_FLOAT
);
570 _mesa_UniformMatrix3fv(GLint location
, GLsizei count
, GLboolean transpose
,
571 const GLfloat
* value
)
573 GET_CURRENT_CONTEXT(ctx
);
574 _mesa_uniform_matrix(location
, count
, transpose
, value
,
575 ctx
, ctx
->_Shader
->ActiveProgram
, 3, 3, GLSL_TYPE_FLOAT
);
579 _mesa_UniformMatrix4fv(GLint location
, GLsizei count
, GLboolean transpose
,
580 const GLfloat
* value
)
582 GET_CURRENT_CONTEXT(ctx
);
583 _mesa_uniform_matrix(location
, count
, transpose
, value
,
584 ctx
, ctx
->_Shader
->ActiveProgram
, 4, 4, GLSL_TYPE_FLOAT
);
587 /** Same as above with direct state access **/
590 _mesa_ProgramUniform1ui(GLuint program
, GLint location
, GLuint v0
)
592 GET_CURRENT_CONTEXT(ctx
);
593 struct gl_shader_program
*shProg
=
594 _mesa_lookup_shader_program_err(ctx
, program
,
595 "glProgramUniform1ui");
596 _mesa_uniform(location
, 1, &v0
, ctx
, shProg
, GLSL_TYPE_UINT
, 1);
600 _mesa_ProgramUniform2ui(GLuint program
, GLint location
, GLuint v0
, GLuint v1
)
602 GET_CURRENT_CONTEXT(ctx
);
604 struct gl_shader_program
*shProg
;
607 shProg
= _mesa_lookup_shader_program_err(ctx
, program
,
608 "glProgramUniform2ui");
609 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_UINT
, 2);
613 _mesa_ProgramUniform3ui(GLuint program
, GLint location
, GLuint v0
, GLuint v1
,
616 GET_CURRENT_CONTEXT(ctx
);
618 struct gl_shader_program
*shProg
;
622 shProg
= _mesa_lookup_shader_program_err(ctx
, program
,
623 "glProgramUniform3ui");
624 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_UINT
, 3);
628 _mesa_ProgramUniform4ui(GLuint program
, GLint location
, GLuint v0
, GLuint v1
,
629 GLuint v2
, GLuint v3
)
631 GET_CURRENT_CONTEXT(ctx
);
633 struct gl_shader_program
*shProg
;
638 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform4ui");
639 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_UINT
, 4);
643 _mesa_ProgramUniform1uiv(GLuint program
, GLint location
, GLsizei count
,
646 GET_CURRENT_CONTEXT(ctx
);
647 struct gl_shader_program
*shProg
=
648 _mesa_lookup_shader_program_err(ctx
, program
,
649 "glProgramUniform1uiv");
650 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_UINT
, 1);
654 _mesa_ProgramUniform2uiv(GLuint program
, GLint location
, GLsizei count
,
657 GET_CURRENT_CONTEXT(ctx
);
658 struct gl_shader_program
*shProg
=
659 _mesa_lookup_shader_program_err(ctx
, program
,
660 "glProgramUniform2uiv");
661 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_UINT
, 2);
665 _mesa_ProgramUniform3uiv(GLuint program
, GLint location
, GLsizei count
,
668 GET_CURRENT_CONTEXT(ctx
);
669 struct gl_shader_program
*shProg
=
670 _mesa_lookup_shader_program_err(ctx
, program
,
671 "glProgramUniform3uiv");
672 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_UINT
, 3);
676 _mesa_ProgramUniform4uiv(GLuint program
, GLint location
, GLsizei count
,
679 GET_CURRENT_CONTEXT(ctx
);
680 struct gl_shader_program
*shProg
=
681 _mesa_lookup_shader_program_err(ctx
, program
,
682 "glProgramUniform4uiv");
683 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_UINT
, 4);
689 _mesa_ProgramUniformMatrix2fv(GLuint program
, GLint location
, GLsizei count
,
690 GLboolean transpose
, const GLfloat
* value
)
692 GET_CURRENT_CONTEXT(ctx
);
693 struct gl_shader_program
*shProg
=
694 _mesa_lookup_shader_program_err(ctx
, program
,
695 "glProgramUniformMatrix2fv");
696 _mesa_uniform_matrix(location
, count
, transpose
, value
, ctx
, shProg
, 2, 2, GLSL_TYPE_FLOAT
);
700 _mesa_ProgramUniformMatrix3fv(GLuint program
, GLint location
, GLsizei count
,
701 GLboolean transpose
, const GLfloat
* value
)
703 GET_CURRENT_CONTEXT(ctx
);
704 struct gl_shader_program
*shProg
=
705 _mesa_lookup_shader_program_err(ctx
, program
,
706 "glProgramUniformMatrix3fv");
707 _mesa_uniform_matrix(location
, count
, transpose
, value
, ctx
, shProg
, 3, 3, GLSL_TYPE_FLOAT
);
711 _mesa_ProgramUniformMatrix4fv(GLuint program
, GLint location
, GLsizei count
,
712 GLboolean transpose
, const GLfloat
* value
)
714 GET_CURRENT_CONTEXT(ctx
);
715 struct gl_shader_program
*shProg
=
716 _mesa_lookup_shader_program_err(ctx
, program
,
717 "glProgramUniformMatrix4fv");
718 _mesa_uniform_matrix(location
, count
, transpose
, value
, ctx
, shProg
, 4, 4, GLSL_TYPE_FLOAT
);
723 * Non-square UniformMatrix are OpenGL 2.1
726 _mesa_UniformMatrix2x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
727 const GLfloat
*value
)
729 GET_CURRENT_CONTEXT(ctx
);
730 _mesa_uniform_matrix(location
, count
, transpose
, value
,
731 ctx
, ctx
->_Shader
->ActiveProgram
, 2, 3, GLSL_TYPE_FLOAT
);
735 _mesa_UniformMatrix3x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
736 const GLfloat
*value
)
738 GET_CURRENT_CONTEXT(ctx
);
739 _mesa_uniform_matrix(location
, count
, transpose
, value
,
740 ctx
, ctx
->_Shader
->ActiveProgram
, 3, 2, GLSL_TYPE_FLOAT
);
744 _mesa_UniformMatrix2x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
745 const GLfloat
*value
)
747 GET_CURRENT_CONTEXT(ctx
);
748 _mesa_uniform_matrix(location
, count
, transpose
, value
,
749 ctx
, ctx
->_Shader
->ActiveProgram
, 2, 4, GLSL_TYPE_FLOAT
);
753 _mesa_UniformMatrix4x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
754 const GLfloat
*value
)
756 GET_CURRENT_CONTEXT(ctx
);
757 _mesa_uniform_matrix(location
, count
, transpose
, value
,
758 ctx
, ctx
->_Shader
->ActiveProgram
, 4, 2, GLSL_TYPE_FLOAT
);
762 _mesa_UniformMatrix3x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
763 const GLfloat
*value
)
765 GET_CURRENT_CONTEXT(ctx
);
766 _mesa_uniform_matrix(location
, count
, transpose
, value
,
767 ctx
, ctx
->_Shader
->ActiveProgram
, 3, 4, GLSL_TYPE_FLOAT
);
771 _mesa_UniformMatrix4x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
772 const GLfloat
*value
)
774 GET_CURRENT_CONTEXT(ctx
);
775 _mesa_uniform_matrix(location
, count
, transpose
, value
,
776 ctx
, ctx
->_Shader
->ActiveProgram
, 4, 3, GLSL_TYPE_FLOAT
);
779 /** Same as above with direct state access **/
782 _mesa_ProgramUniformMatrix2x3fv(GLuint program
, GLint location
, GLsizei count
,
783 GLboolean transpose
, const GLfloat
* value
)
785 GET_CURRENT_CONTEXT(ctx
);
786 struct gl_shader_program
*shProg
=
787 _mesa_lookup_shader_program_err(ctx
, program
,
788 "glProgramUniformMatrix2x3fv");
789 _mesa_uniform_matrix(location
, count
, transpose
, value
, ctx
, shProg
, 2, 3, GLSL_TYPE_FLOAT
);
793 _mesa_ProgramUniformMatrix3x2fv(GLuint program
, GLint location
, GLsizei count
,
794 GLboolean transpose
, const GLfloat
* value
)
796 GET_CURRENT_CONTEXT(ctx
);
797 struct gl_shader_program
*shProg
=
798 _mesa_lookup_shader_program_err(ctx
, program
,
799 "glProgramUniformMatrix3x2fv");
800 _mesa_uniform_matrix(location
, count
, transpose
, value
, ctx
, shProg
, 3, 2, GLSL_TYPE_FLOAT
);
804 _mesa_ProgramUniformMatrix2x4fv(GLuint program
, GLint location
, GLsizei count
,
805 GLboolean transpose
, const GLfloat
* value
)
807 GET_CURRENT_CONTEXT(ctx
);
808 struct gl_shader_program
*shProg
=
809 _mesa_lookup_shader_program_err(ctx
, program
,
810 "glProgramUniformMatrix2x4fv");
811 _mesa_uniform_matrix(location
, count
, transpose
, value
, ctx
, shProg
, 2, 4, GLSL_TYPE_FLOAT
);
815 _mesa_ProgramUniformMatrix4x2fv(GLuint program
, GLint location
, GLsizei count
,
816 GLboolean transpose
, const GLfloat
* value
)
818 GET_CURRENT_CONTEXT(ctx
);
819 struct gl_shader_program
*shProg
=
820 _mesa_lookup_shader_program_err(ctx
, program
,
821 "glProgramUniformMatrix4x2fv");
822 _mesa_uniform_matrix(location
, count
, transpose
, value
, ctx
, shProg
, 4, 2, GLSL_TYPE_FLOAT
);
826 _mesa_ProgramUniformMatrix3x4fv(GLuint program
, GLint location
, GLsizei count
,
827 GLboolean transpose
, const GLfloat
* value
)
829 GET_CURRENT_CONTEXT(ctx
);
830 struct gl_shader_program
*shProg
=
831 _mesa_lookup_shader_program_err(ctx
, program
,
832 "glProgramUniformMatrix3x4fv");
833 _mesa_uniform_matrix(location
, count
, transpose
, value
, ctx
, shProg
, 3, 4, GLSL_TYPE_FLOAT
);
837 _mesa_ProgramUniformMatrix4x3fv(GLuint program
, GLint location
, GLsizei count
,
838 GLboolean transpose
, const GLfloat
* value
)
840 GET_CURRENT_CONTEXT(ctx
);
841 struct gl_shader_program
*shProg
=
842 _mesa_lookup_shader_program_err(ctx
, program
,
843 "glProgramUniformMatrix4x3fv");
844 _mesa_uniform_matrix(location
, count
, transpose
, value
, ctx
, shProg
, 4, 3, GLSL_TYPE_FLOAT
);
849 _mesa_GetnUniformfvARB(GLuint program
, GLint location
,
850 GLsizei bufSize
, GLfloat
*params
)
852 GET_CURRENT_CONTEXT(ctx
);
853 _mesa_get_uniform(ctx
, program
, location
, bufSize
, GLSL_TYPE_FLOAT
, params
);
857 _mesa_GetUniformfv(GLuint program
, GLint location
, GLfloat
*params
)
859 _mesa_GetnUniformfvARB(program
, location
, INT_MAX
, params
);
864 _mesa_GetnUniformivARB(GLuint program
, GLint location
,
865 GLsizei bufSize
, GLint
*params
)
867 GET_CURRENT_CONTEXT(ctx
);
868 _mesa_get_uniform(ctx
, program
, location
, bufSize
, GLSL_TYPE_INT
, params
);
872 _mesa_GetUniformiv(GLuint program
, GLint location
, GLint
*params
)
874 _mesa_GetnUniformivARB(program
, location
, INT_MAX
, params
);
880 _mesa_GetnUniformuivARB(GLuint program
, GLint location
,
881 GLsizei bufSize
, GLuint
*params
)
883 GET_CURRENT_CONTEXT(ctx
);
884 _mesa_get_uniform(ctx
, program
, location
, bufSize
, GLSL_TYPE_UINT
, params
);
888 _mesa_GetUniformuiv(GLuint program
, GLint location
, GLuint
*params
)
890 _mesa_GetnUniformuivARB(program
, location
, INT_MAX
, params
);
896 _mesa_GetnUniformdvARB(GLuint program
, GLint location
,
897 GLsizei bufSize
, GLdouble
*params
)
899 GET_CURRENT_CONTEXT(ctx
);
901 _mesa_get_uniform(ctx
, program
, location
, bufSize
, GLSL_TYPE_DOUBLE
, params
);
905 _mesa_GetUniformdv(GLuint program
, GLint location
, GLdouble
*params
)
907 _mesa_GetnUniformdvARB(program
, location
, INT_MAX
, params
);
911 _mesa_GetnUniformi64vARB(GLuint program
, GLint location
,
912 GLsizei bufSize
, GLint64
*params
)
914 GET_CURRENT_CONTEXT(ctx
);
915 _mesa_get_uniform(ctx
, program
, location
, bufSize
, GLSL_TYPE_INT64
, params
);
918 _mesa_GetUniformi64vARB(GLuint program
, GLint location
, GLint64
*params
)
920 _mesa_GetnUniformi64vARB(program
, location
, INT_MAX
, params
);
924 _mesa_GetnUniformui64vARB(GLuint program
, GLint location
,
925 GLsizei bufSize
, GLuint64
*params
)
927 GET_CURRENT_CONTEXT(ctx
);
928 _mesa_get_uniform(ctx
, program
, location
, bufSize
, GLSL_TYPE_UINT64
, params
);
932 _mesa_GetUniformui64vARB(GLuint program
, GLint location
, GLuint64
*params
)
934 _mesa_GetnUniformui64vARB(program
, location
, INT_MAX
, params
);
939 _mesa_GetUniformLocation(GLuint programObj
, const GLcharARB
*name
)
941 struct gl_shader_program
*shProg
;
943 GET_CURRENT_CONTEXT(ctx
);
945 shProg
= _mesa_lookup_shader_program_err(ctx
, programObj
,
946 "glGetUniformLocation");
950 /* Page 80 (page 94 of the PDF) of the OpenGL 2.1 spec says:
952 * "If program has not been successfully linked, the error
953 * INVALID_OPERATION is generated."
955 if (shProg
->data
->LinkStatus
== linking_failure
) {
956 _mesa_error(ctx
, GL_INVALID_OPERATION
,
957 "glGetUniformLocation(program not linked)");
961 return _mesa_program_resource_location(shProg
, GL_UNIFORM
, name
);
965 _mesa_GetUniformBlockIndex(GLuint program
,
966 const GLchar
*uniformBlockName
)
968 GET_CURRENT_CONTEXT(ctx
);
969 struct gl_shader_program
*shProg
;
971 if (!ctx
->Extensions
.ARB_uniform_buffer_object
) {
972 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glGetUniformBlockIndex");
973 return GL_INVALID_INDEX
;
976 shProg
= _mesa_lookup_shader_program_err(ctx
, program
,
977 "glGetUniformBlockIndex");
979 return GL_INVALID_INDEX
;
981 struct gl_program_resource
*res
=
982 _mesa_program_resource_find_name(shProg
, GL_UNIFORM_BLOCK
,
983 uniformBlockName
, NULL
);
985 return GL_INVALID_INDEX
;
987 return _mesa_program_resource_index(shProg
, res
);
991 _mesa_GetUniformIndices(GLuint program
,
992 GLsizei uniformCount
,
993 const GLchar
* const *uniformNames
,
994 GLuint
*uniformIndices
)
996 GET_CURRENT_CONTEXT(ctx
);
998 struct gl_shader_program
*shProg
;
1000 if (!ctx
->Extensions
.ARB_uniform_buffer_object
) {
1001 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glGetUniformIndices");
1005 shProg
= _mesa_lookup_shader_program_err(ctx
, program
,
1006 "glGetUniformIndices");
1010 if (uniformCount
< 0) {
1011 _mesa_error(ctx
, GL_INVALID_VALUE
,
1012 "glGetUniformIndices(uniformCount < 0)");
1016 for (i
= 0; i
< uniformCount
; i
++) {
1017 struct gl_program_resource
*res
=
1018 _mesa_program_resource_find_name(shProg
, GL_UNIFORM
, uniformNames
[i
],
1020 uniformIndices
[i
] = _mesa_program_resource_index(shProg
, res
);
1025 _mesa_UniformBlockBinding(GLuint program
,
1026 GLuint uniformBlockIndex
,
1027 GLuint uniformBlockBinding
)
1029 GET_CURRENT_CONTEXT(ctx
);
1030 struct gl_shader_program
*shProg
;
1032 if (!ctx
->Extensions
.ARB_uniform_buffer_object
) {
1033 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glUniformBlockBinding");
1037 shProg
= _mesa_lookup_shader_program_err(ctx
, program
,
1038 "glUniformBlockBinding");
1042 if (uniformBlockIndex
>= shProg
->data
->NumUniformBlocks
) {
1043 _mesa_error(ctx
, GL_INVALID_VALUE
,
1044 "glUniformBlockBinding(block index %u >= %u)",
1045 uniformBlockIndex
, shProg
->data
->NumUniformBlocks
);
1049 if (uniformBlockBinding
>= ctx
->Const
.MaxUniformBufferBindings
) {
1050 _mesa_error(ctx
, GL_INVALID_VALUE
,
1051 "glUniformBlockBinding(block binding %u >= %u)",
1052 uniformBlockBinding
, ctx
->Const
.MaxUniformBufferBindings
);
1056 if (shProg
->data
->UniformBlocks
[uniformBlockIndex
].Binding
!=
1057 uniformBlockBinding
) {
1059 FLUSH_VERTICES(ctx
, 0);
1060 ctx
->NewDriverState
|= ctx
->DriverFlags
.NewUniformBuffer
;
1062 shProg
->data
->UniformBlocks
[uniformBlockIndex
].Binding
=
1063 uniformBlockBinding
;
1068 _mesa_ShaderStorageBlockBinding(GLuint program
,
1069 GLuint shaderStorageBlockIndex
,
1070 GLuint shaderStorageBlockBinding
)
1072 GET_CURRENT_CONTEXT(ctx
);
1073 struct gl_shader_program
*shProg
;
1075 if (!ctx
->Extensions
.ARB_shader_storage_buffer_object
) {
1076 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glShaderStorageBlockBinding");
1080 shProg
= _mesa_lookup_shader_program_err(ctx
, program
,
1081 "glShaderStorageBlockBinding");
1085 if (shaderStorageBlockIndex
>= shProg
->data
->NumShaderStorageBlocks
) {
1086 _mesa_error(ctx
, GL_INVALID_VALUE
,
1087 "glShaderStorageBlockBinding(block index %u >= %u)",
1088 shaderStorageBlockIndex
,
1089 shProg
->data
->NumShaderStorageBlocks
);
1093 if (shaderStorageBlockBinding
>= ctx
->Const
.MaxShaderStorageBufferBindings
) {
1094 _mesa_error(ctx
, GL_INVALID_VALUE
,
1095 "glShaderStorageBlockBinding(block binding %u >= %u)",
1096 shaderStorageBlockBinding
,
1097 ctx
->Const
.MaxShaderStorageBufferBindings
);
1101 if (shProg
->data
->ShaderStorageBlocks
[shaderStorageBlockIndex
].Binding
!=
1102 shaderStorageBlockBinding
) {
1104 FLUSH_VERTICES(ctx
, 0);
1105 ctx
->NewDriverState
|= ctx
->DriverFlags
.NewShaderStorageBuffer
;
1107 shProg
->data
->ShaderStorageBlocks
[shaderStorageBlockIndex
].Binding
=
1108 shaderStorageBlockBinding
;
1113 * Generic program resource property query.
1116 mesa_bufferiv(struct gl_shader_program
*shProg
, GLenum type
,
1117 GLuint index
, GLenum pname
, GLint
*params
, const char *caller
)
1119 GET_CURRENT_CONTEXT(ctx
);
1120 struct gl_program_resource
*res
=
1121 _mesa_program_resource_find_index(shProg
, type
, index
);
1124 _mesa_error(ctx
, GL_INVALID_VALUE
, "%s(bufferindex %d)", caller
, index
);
1129 case GL_UNIFORM_BLOCK_BINDING
:
1130 case GL_ATOMIC_COUNTER_BUFFER_BINDING
:
1131 _mesa_program_resource_prop(shProg
, res
, index
, GL_BUFFER_BINDING
,
1134 case GL_UNIFORM_BLOCK_DATA_SIZE
:
1135 case GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE
:
1136 _mesa_program_resource_prop(shProg
, res
, index
, GL_BUFFER_DATA_SIZE
,
1139 case GL_UNIFORM_BLOCK_NAME_LENGTH
:
1140 _mesa_program_resource_prop(shProg
, res
, index
, GL_NAME_LENGTH
,
1143 case GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS
:
1144 case GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS
:
1145 _mesa_program_resource_prop(shProg
, res
, index
, GL_NUM_ACTIVE_VARIABLES
,
1148 case GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES
:
1149 case GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES
:
1150 _mesa_program_resource_prop(shProg
, res
, index
, GL_ACTIVE_VARIABLES
,
1153 case GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER
:
1154 case GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER
:
1155 _mesa_program_resource_prop(shProg
, res
, index
,
1156 GL_REFERENCED_BY_VERTEX_SHADER
, params
,
1160 case GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER
:
1161 case GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER
:
1162 _mesa_program_resource_prop(shProg
, res
, index
,
1163 GL_REFERENCED_BY_TESS_CONTROL_SHADER
, params
,
1167 case GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER
:
1168 case GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER
:
1169 _mesa_program_resource_prop(shProg
, res
, index
,
1170 GL_REFERENCED_BY_TESS_EVALUATION_SHADER
, params
,
1174 case GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER
:
1175 case GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER
:
1176 _mesa_program_resource_prop(shProg
, res
, index
,
1177 GL_REFERENCED_BY_GEOMETRY_SHADER
, params
,
1180 case GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER
:
1181 case GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER
:
1182 _mesa_program_resource_prop(shProg
, res
, index
,
1183 GL_REFERENCED_BY_FRAGMENT_SHADER
, params
,
1186 case GL_UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER
:
1187 case GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER
:
1188 _mesa_program_resource_prop(shProg
, res
, index
,
1189 GL_REFERENCED_BY_COMPUTE_SHADER
, params
,
1193 _mesa_error(ctx
, GL_INVALID_ENUM
,
1194 "%s(pname 0x%x (%s))", caller
, pname
,
1195 _mesa_enum_to_string(pname
));
1202 _mesa_GetActiveUniformBlockiv(GLuint program
,
1203 GLuint uniformBlockIndex
,
1207 GET_CURRENT_CONTEXT(ctx
);
1208 struct gl_shader_program
*shProg
;
1210 if (!ctx
->Extensions
.ARB_uniform_buffer_object
) {
1211 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glGetActiveUniformBlockiv");
1215 shProg
= _mesa_lookup_shader_program_err(ctx
, program
,
1216 "glGetActiveUniformBlockiv");
1220 mesa_bufferiv(shProg
, GL_UNIFORM_BLOCK
, uniformBlockIndex
, pname
, params
,
1221 "glGetActiveUniformBlockiv");
1225 _mesa_GetActiveUniformBlockName(GLuint program
,
1226 GLuint uniformBlockIndex
,
1229 GLchar
*uniformBlockName
)
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");
1240 _mesa_error(ctx
, GL_INVALID_VALUE
,
1241 "glGetActiveUniformBlockName(bufSize %d < 0)",
1246 shProg
= _mesa_lookup_shader_program_err(ctx
, program
,
1247 "glGetActiveUniformBlockiv");
1251 if (uniformBlockName
)
1252 _mesa_get_program_resource_name(shProg
, GL_UNIFORM_BLOCK
,
1253 uniformBlockIndex
, bufSize
, length
,
1255 "glGetActiveUniformBlockName");
1259 _mesa_GetActiveUniformName(GLuint program
, GLuint uniformIndex
,
1260 GLsizei bufSize
, GLsizei
*length
,
1261 GLchar
*uniformName
)
1263 GET_CURRENT_CONTEXT(ctx
);
1264 struct gl_shader_program
*shProg
;
1266 if (!ctx
->Extensions
.ARB_uniform_buffer_object
) {
1267 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glGetActiveUniformName");
1272 _mesa_error(ctx
, GL_INVALID_VALUE
,
1273 "glGetActiveUniformName(bufSize %d < 0)",
1278 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glGetActiveUniformName");
1283 _mesa_get_program_resource_name(shProg
, GL_UNIFORM
, uniformIndex
, bufSize
,
1284 length
, uniformName
, "glGetActiveUniformName");
1288 _mesa_GetActiveAtomicCounterBufferiv(GLuint program
, GLuint bufferIndex
,
1289 GLenum pname
, GLint
*params
)
1291 GET_CURRENT_CONTEXT(ctx
);
1292 struct gl_shader_program
*shProg
;
1294 if (!ctx
->Extensions
.ARB_shader_atomic_counters
) {
1295 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1296 "glGetActiveAtomicCounterBufferiv");
1300 shProg
= _mesa_lookup_shader_program_err(ctx
, program
,
1301 "glGetActiveAtomicCounterBufferiv");
1305 mesa_bufferiv(shProg
, GL_ATOMIC_COUNTER_BUFFER
, bufferIndex
, pname
, params
,
1306 "glGetActiveAtomicCounterBufferiv");
1310 _mesa_Uniform1d(GLint location
, GLdouble v0
)
1312 GET_CURRENT_CONTEXT(ctx
);
1313 _mesa_uniform(location
, 1, &v0
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_DOUBLE
, 1);
1317 _mesa_Uniform2d(GLint location
, GLdouble v0
, GLdouble v1
)
1319 GET_CURRENT_CONTEXT(ctx
);
1323 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_DOUBLE
, 2);
1327 _mesa_Uniform3d(GLint location
, GLdouble v0
, GLdouble v1
, GLdouble v2
)
1329 GET_CURRENT_CONTEXT(ctx
);
1334 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_DOUBLE
, 3);
1338 _mesa_Uniform4d(GLint location
, GLdouble v0
, GLdouble v1
, GLdouble v2
,
1341 GET_CURRENT_CONTEXT(ctx
);
1347 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_DOUBLE
, 4);
1351 _mesa_Uniform1dv(GLint location
, GLsizei count
, const GLdouble
* value
)
1353 GET_CURRENT_CONTEXT(ctx
);
1354 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_DOUBLE
, 1);
1358 _mesa_Uniform2dv(GLint location
, GLsizei count
, const GLdouble
* value
)
1360 GET_CURRENT_CONTEXT(ctx
);
1361 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_DOUBLE
, 2);
1365 _mesa_Uniform3dv(GLint location
, GLsizei count
, const GLdouble
* value
)
1367 GET_CURRENT_CONTEXT(ctx
);
1368 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_DOUBLE
, 3);
1372 _mesa_Uniform4dv(GLint location
, GLsizei count
, const GLdouble
* value
)
1374 GET_CURRENT_CONTEXT(ctx
);
1375 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_DOUBLE
, 4);
1379 _mesa_UniformMatrix2dv(GLint location
, GLsizei count
, GLboolean transpose
,
1380 const GLdouble
* value
)
1382 GET_CURRENT_CONTEXT(ctx
);
1383 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1384 ctx
, ctx
->_Shader
->ActiveProgram
, 2, 2, GLSL_TYPE_DOUBLE
);
1388 _mesa_UniformMatrix3dv(GLint location
, GLsizei count
, GLboolean transpose
,
1389 const GLdouble
* value
)
1391 GET_CURRENT_CONTEXT(ctx
);
1392 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1393 ctx
, ctx
->_Shader
->ActiveProgram
, 3, 3, GLSL_TYPE_DOUBLE
);
1397 _mesa_UniformMatrix4dv(GLint location
, GLsizei count
, GLboolean transpose
,
1398 const GLdouble
* value
)
1400 GET_CURRENT_CONTEXT(ctx
);
1401 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1402 ctx
, ctx
->_Shader
->ActiveProgram
, 4, 4, GLSL_TYPE_DOUBLE
);
1406 _mesa_UniformMatrix2x3dv(GLint location
, GLsizei count
, GLboolean transpose
,
1407 const GLdouble
*value
)
1409 GET_CURRENT_CONTEXT(ctx
);
1410 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1411 ctx
, ctx
->_Shader
->ActiveProgram
, 2, 3, GLSL_TYPE_DOUBLE
);
1415 _mesa_UniformMatrix3x2dv(GLint location
, GLsizei count
, GLboolean transpose
,
1416 const GLdouble
*value
)
1418 GET_CURRENT_CONTEXT(ctx
);
1419 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1420 ctx
, ctx
->_Shader
->ActiveProgram
, 3, 2, GLSL_TYPE_DOUBLE
);
1424 _mesa_UniformMatrix2x4dv(GLint location
, GLsizei count
, GLboolean transpose
,
1425 const GLdouble
*value
)
1427 GET_CURRENT_CONTEXT(ctx
);
1428 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1429 ctx
, ctx
->_Shader
->ActiveProgram
, 2, 4, GLSL_TYPE_DOUBLE
);
1433 _mesa_UniformMatrix4x2dv(GLint location
, GLsizei count
, GLboolean transpose
,
1434 const GLdouble
*value
)
1436 GET_CURRENT_CONTEXT(ctx
);
1437 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1438 ctx
, ctx
->_Shader
->ActiveProgram
, 4, 2, GLSL_TYPE_DOUBLE
);
1442 _mesa_UniformMatrix3x4dv(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
, 3, 4, GLSL_TYPE_DOUBLE
);
1451 _mesa_UniformMatrix4x3dv(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
, 4, 3, GLSL_TYPE_DOUBLE
);
1460 _mesa_ProgramUniform1d(GLuint program
, GLint location
, GLdouble v0
)
1462 GET_CURRENT_CONTEXT(ctx
);
1463 struct gl_shader_program
*shProg
=
1464 _mesa_lookup_shader_program_err(ctx
, program
,
1465 "glProgramUniform1d");
1466 _mesa_uniform(location
, 1, &v0
, ctx
, shProg
, GLSL_TYPE_DOUBLE
, 1);
1470 _mesa_ProgramUniform2d(GLuint program
, GLint location
, GLdouble v0
, GLdouble v1
)
1472 GET_CURRENT_CONTEXT(ctx
);
1474 struct gl_shader_program
*shProg
;
1477 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform2d");
1478 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_DOUBLE
, 2);
1482 _mesa_ProgramUniform3d(GLuint program
, GLint location
, GLdouble v0
, GLdouble v1
,
1485 GET_CURRENT_CONTEXT(ctx
);
1487 struct gl_shader_program
*shProg
;
1491 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform3d");
1492 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_DOUBLE
, 3);
1496 _mesa_ProgramUniform4d(GLuint program
, GLint location
, GLdouble v0
, GLdouble v1
,
1497 GLdouble v2
, GLdouble v3
)
1499 GET_CURRENT_CONTEXT(ctx
);
1501 struct gl_shader_program
*shProg
;
1506 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform4d");
1507 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_DOUBLE
, 4);
1511 _mesa_ProgramUniform1dv(GLuint program
, GLint location
, GLsizei count
,
1512 const GLdouble
* value
)
1514 GET_CURRENT_CONTEXT(ctx
);
1515 struct gl_shader_program
*shProg
=
1516 _mesa_lookup_shader_program_err(ctx
, program
,
1517 "glProgramUniform1dv");
1518 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_DOUBLE
, 1);
1522 _mesa_ProgramUniform2dv(GLuint program
, GLint location
, GLsizei count
,
1523 const GLdouble
* value
)
1525 GET_CURRENT_CONTEXT(ctx
);
1526 struct gl_shader_program
*shProg
=
1527 _mesa_lookup_shader_program_err(ctx
, program
,
1528 "glProgramUniform2dv");
1529 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_DOUBLE
, 2);
1533 _mesa_ProgramUniform3dv(GLuint program
, GLint location
, GLsizei count
,
1534 const GLdouble
* value
)
1536 GET_CURRENT_CONTEXT(ctx
);
1537 struct gl_shader_program
*shProg
=
1538 _mesa_lookup_shader_program_err(ctx
, program
,
1539 "glProgramUniform3dv");
1540 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_DOUBLE
, 3);
1544 _mesa_ProgramUniform4dv(GLuint program
, GLint location
, GLsizei count
,
1545 const GLdouble
* value
)
1547 GET_CURRENT_CONTEXT(ctx
);
1548 struct gl_shader_program
*shProg
=
1549 _mesa_lookup_shader_program_err(ctx
, program
,
1550 "glProgramUniform4dv");
1551 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_DOUBLE
, 4);
1555 _mesa_ProgramUniformMatrix2dv(GLuint program
, GLint location
, GLsizei count
,
1556 GLboolean transpose
, const GLdouble
* value
)
1558 GET_CURRENT_CONTEXT(ctx
);
1559 struct gl_shader_program
*shProg
=
1560 _mesa_lookup_shader_program_err(ctx
, program
,
1561 "glProgramUniformMatrix2dv");
1562 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1563 ctx
, shProg
, 2, 2, GLSL_TYPE_DOUBLE
);
1567 _mesa_ProgramUniformMatrix3dv(GLuint program
, GLint location
, GLsizei count
,
1568 GLboolean transpose
, const GLdouble
* value
)
1570 GET_CURRENT_CONTEXT(ctx
);
1571 struct gl_shader_program
*shProg
=
1572 _mesa_lookup_shader_program_err(ctx
, program
,
1573 "glProgramUniformMatrix3dv");
1574 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1575 ctx
, shProg
, 3, 3, GLSL_TYPE_DOUBLE
);
1579 _mesa_ProgramUniformMatrix4dv(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 "glProgramUniformMatrix4dv");
1586 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1587 ctx
, shProg
, 4, 4, GLSL_TYPE_DOUBLE
);
1591 _mesa_ProgramUniformMatrix2x3dv(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 "glProgramUniformMatrix2x3dv");
1598 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1599 ctx
, shProg
, 2, 3, GLSL_TYPE_DOUBLE
);
1603 _mesa_ProgramUniformMatrix3x2dv(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 "glProgramUniformMatrix3x2dv");
1610 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1611 ctx
, shProg
, 3, 2, GLSL_TYPE_DOUBLE
);
1615 _mesa_ProgramUniformMatrix2x4dv(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 "glProgramUniformMatrix2x4dv");
1622 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1623 ctx
, shProg
, 2, 4, GLSL_TYPE_DOUBLE
);
1627 _mesa_ProgramUniformMatrix4x2dv(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 "glProgramUniformMatrix4x2dv");
1634 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1635 ctx
, shProg
, 4, 2, GLSL_TYPE_DOUBLE
);
1639 _mesa_ProgramUniformMatrix3x4dv(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 "glProgramUniformMatrix3x4dv");
1646 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1647 ctx
, shProg
, 3, 4, GLSL_TYPE_DOUBLE
);
1651 _mesa_ProgramUniformMatrix4x3dv(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 "glProgramUniformMatrix4x3dv");
1658 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1659 ctx
, shProg
, 4, 3, GLSL_TYPE_DOUBLE
);
1663 _mesa_Uniform1i64ARB(GLint location
, GLint64 v0
)
1665 GET_CURRENT_CONTEXT(ctx
);
1666 _mesa_uniform(location
, 1, &v0
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT64
, 1);
1670 _mesa_Uniform2i64ARB(GLint location
, GLint64 v0
, GLint64 v1
)
1672 GET_CURRENT_CONTEXT(ctx
);
1676 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT64
, 2);
1680 _mesa_Uniform3i64ARB(GLint location
, GLint64 v0
, GLint64 v1
, GLint64 v2
)
1682 GET_CURRENT_CONTEXT(ctx
);
1687 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT64
, 3);
1691 _mesa_Uniform4i64ARB(GLint location
, GLint64 v0
, GLint64 v1
, GLint64 v2
, GLint64 v3
)
1693 GET_CURRENT_CONTEXT(ctx
);
1699 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT64
, 4);
1703 _mesa_Uniform1i64vARB(GLint location
, GLsizei count
, const GLint64
*value
)
1705 GET_CURRENT_CONTEXT(ctx
);
1706 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT64
, 1);
1710 _mesa_Uniform2i64vARB(GLint location
, GLsizei count
, const GLint64
*value
)
1712 GET_CURRENT_CONTEXT(ctx
);
1713 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT64
, 2);
1717 _mesa_Uniform3i64vARB(GLint location
, GLsizei count
, const GLint64
*value
)
1719 GET_CURRENT_CONTEXT(ctx
);
1720 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT64
, 3);
1724 _mesa_Uniform4i64vARB(GLint location
, GLsizei count
, const GLint64
*value
)
1726 GET_CURRENT_CONTEXT(ctx
);
1727 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT64
, 4);
1731 _mesa_Uniform1ui64ARB(GLint location
, GLuint64 v0
)
1733 GET_CURRENT_CONTEXT(ctx
);
1734 _mesa_uniform(location
, 1, &v0
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT64
, 1);
1738 _mesa_Uniform2ui64ARB(GLint location
, GLuint64 v0
, GLuint64 v1
)
1740 GET_CURRENT_CONTEXT(ctx
);
1744 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT64
, 2);
1748 _mesa_Uniform3ui64ARB(GLint location
, GLuint64 v0
, GLuint64 v1
, GLuint64 v2
)
1750 GET_CURRENT_CONTEXT(ctx
);
1755 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT64
, 3);
1759 _mesa_Uniform4ui64ARB(GLint location
, GLuint64 v0
, GLuint64 v1
, GLuint64 v2
, GLuint64 v3
)
1761 GET_CURRENT_CONTEXT(ctx
);
1767 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT64
, 4);
1771 _mesa_Uniform1ui64vARB(GLint location
, GLsizei count
, const GLuint64
*value
)
1773 GET_CURRENT_CONTEXT(ctx
);
1774 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT64
, 1);
1778 _mesa_Uniform2ui64vARB(GLint location
, GLsizei count
, const GLuint64
*value
)
1780 GET_CURRENT_CONTEXT(ctx
);
1781 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT64
, 2);
1785 _mesa_Uniform3ui64vARB(GLint location
, GLsizei count
, const GLuint64
*value
)
1787 GET_CURRENT_CONTEXT(ctx
);
1788 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT64
, 3);
1792 _mesa_Uniform4ui64vARB(GLint location
, GLsizei count
, const GLuint64
*value
)
1794 GET_CURRENT_CONTEXT(ctx
);
1795 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT64
, 4);
1798 /* DSA entrypoints */
1800 _mesa_ProgramUniform1i64ARB(GLuint program
, GLint location
, GLint64 v0
)
1802 GET_CURRENT_CONTEXT(ctx
);
1803 struct gl_shader_program
*shProg
=
1804 _mesa_lookup_shader_program_err(ctx
, program
,
1805 "glProgramUniform1i64ARB");
1806 _mesa_uniform(location
, 1, &v0
, ctx
, shProg
, GLSL_TYPE_INT64
, 1);
1810 _mesa_ProgramUniform2i64ARB(GLuint program
, GLint location
, GLint64 v0
, GLint64 v1
)
1812 GET_CURRENT_CONTEXT(ctx
);
1813 struct gl_shader_program
*shProg
=
1814 _mesa_lookup_shader_program_err(ctx
, program
,
1815 "glProgramUniform2i64ARB");
1819 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_INT64
, 2);
1823 _mesa_ProgramUniform3i64ARB(GLuint program
, GLint location
, GLint64 v0
, GLint64 v1
, GLint64 v2
)
1825 GET_CURRENT_CONTEXT(ctx
);
1826 struct gl_shader_program
*shProg
=
1827 _mesa_lookup_shader_program_err(ctx
, program
,
1828 "glProgramUniform3i64ARB");
1833 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_INT64
, 3);
1837 _mesa_ProgramUniform4i64ARB(GLuint program
, GLint location
, GLint64 v0
, GLint64 v1
, GLint64 v2
, GLint64 v3
)
1839 GET_CURRENT_CONTEXT(ctx
);
1840 struct gl_shader_program
*shProg
=
1841 _mesa_lookup_shader_program_err(ctx
, program
,
1842 "glProgramUniform4i64ARB");
1848 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_INT64
, 4);
1852 _mesa_ProgramUniform1i64vARB(GLuint program
, GLint location
, GLsizei count
, const GLint64
*value
)
1854 GET_CURRENT_CONTEXT(ctx
);
1855 struct gl_shader_program
*shProg
=
1856 _mesa_lookup_shader_program_err(ctx
, program
,
1857 "glProgramUniform1i64vARB");
1858 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_INT64
, 1);
1862 _mesa_ProgramUniform2i64vARB(GLuint program
, GLint location
, GLsizei count
, const GLint64
*value
)
1864 GET_CURRENT_CONTEXT(ctx
);
1865 struct gl_shader_program
*shProg
=
1866 _mesa_lookup_shader_program_err(ctx
, program
,
1867 "glProgramUniform2i64vARB");
1868 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_INT64
, 2);
1872 _mesa_ProgramUniform3i64vARB(GLuint program
, GLint location
, GLsizei count
, const GLint64
*value
)
1874 GET_CURRENT_CONTEXT(ctx
);
1875 struct gl_shader_program
*shProg
=
1876 _mesa_lookup_shader_program_err(ctx
, program
,
1877 "glProgramUniform3i64vARB");
1878 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_INT64
, 3);
1882 _mesa_ProgramUniform4i64vARB(GLuint program
, GLint location
, GLsizei count
, const GLint64
*value
)
1884 GET_CURRENT_CONTEXT(ctx
);
1885 struct gl_shader_program
*shProg
=
1886 _mesa_lookup_shader_program_err(ctx
, program
,
1887 "glProgramUniform4i64vARB");
1888 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_INT64
, 4);
1892 _mesa_ProgramUniform1ui64ARB(GLuint program
, GLint location
, GLuint64 v0
)
1894 GET_CURRENT_CONTEXT(ctx
);
1895 struct gl_shader_program
*shProg
=
1896 _mesa_lookup_shader_program_err(ctx
, program
,
1897 "glProgramUniform1ui64ARB");
1898 _mesa_uniform(location
, 1, &v0
, ctx
, shProg
, GLSL_TYPE_UINT64
, 1);
1902 _mesa_ProgramUniform2ui64ARB(GLuint program
, GLint location
, GLuint64 v0
, GLuint64 v1
)
1904 GET_CURRENT_CONTEXT(ctx
);
1905 struct gl_shader_program
*shProg
=
1906 _mesa_lookup_shader_program_err(ctx
, program
,
1907 "glProgramUniform2ui64ARB");
1911 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_UINT64
, 2);
1915 _mesa_ProgramUniform3ui64ARB(GLuint program
, GLint location
, GLuint64 v0
, GLuint64 v1
, GLuint64 v2
)
1917 GET_CURRENT_CONTEXT(ctx
);
1918 struct gl_shader_program
*shProg
=
1919 _mesa_lookup_shader_program_err(ctx
, program
,
1920 "glProgramUniform3ui64ARB");
1925 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_UINT64
, 3);
1929 _mesa_ProgramUniform4ui64ARB(GLuint program
, GLint location
, GLuint64 v0
, GLuint64 v1
, GLuint64 v2
, GLuint64 v3
)
1931 GET_CURRENT_CONTEXT(ctx
);
1932 struct gl_shader_program
*shProg
=
1933 _mesa_lookup_shader_program_err(ctx
, program
,
1934 "glProgramUniform4ui64ARB");
1940 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_UINT64
, 4);
1944 _mesa_ProgramUniform1ui64vARB(GLuint program
, GLint location
, GLsizei count
, const GLuint64
*value
)
1946 GET_CURRENT_CONTEXT(ctx
);
1947 struct gl_shader_program
*shProg
=
1948 _mesa_lookup_shader_program_err(ctx
, program
,
1949 "glProgramUniform1ui64vARB");
1950 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_UINT64
, 1);
1954 _mesa_ProgramUniform2ui64vARB(GLuint program
, GLint location
, GLsizei count
, const GLuint64
*value
)
1956 GET_CURRENT_CONTEXT(ctx
);
1957 struct gl_shader_program
*shProg
=
1958 _mesa_lookup_shader_program_err(ctx
, program
,
1959 "glProgramUniform2ui64vARB");
1960 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_UINT64
, 2);
1964 _mesa_ProgramUniform3ui64vARB(GLuint program
, GLint location
, GLsizei count
, const GLuint64
*value
)
1966 GET_CURRENT_CONTEXT(ctx
);
1967 struct gl_shader_program
*shProg
=
1968 _mesa_lookup_shader_program_err(ctx
, program
,
1969 "glProgramUniform3ui64vARB");
1970 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_UINT64
, 3);
1974 _mesa_ProgramUniform4ui64vARB(GLuint program
, GLint location
, GLsizei count
, const GLuint64
*value
)
1976 GET_CURRENT_CONTEXT(ctx
);
1977 struct gl_shader_program
*shProg
=
1978 _mesa_lookup_shader_program_err(ctx
, program
,
1979 "glProgramUniform4ui64vARB");
1980 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_UINT64
, 4);