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/shaderapi.h"
42 #include "main/shaderobj.h"
43 #include "main/uniforms.h"
44 #include "main/enums.h"
45 #include "compiler/glsl/ir_uniform.h"
46 #include "compiler/glsl_types.h"
47 #include "program/program.h"
48 #include "util/bitscan.h"
51 * Update the vertex/fragment program's TexturesUsed array.
53 * This needs to be called after glUniform(set sampler var) is called.
54 * A call to glUniform(samplerVar, value) causes a sampler to point to a
55 * particular texture unit. We know the sampler's texture target
56 * (1D/2D/3D/etc) from compile time but the sampler's texture unit is
57 * set by glUniform() calls.
59 * So, scan the program->SamplerUnits[] and program->SamplerTargets[]
60 * information to update the prog->TexturesUsed[] values.
61 * Each value of TexturesUsed[unit] is one of zero, TEXTURE_1D_INDEX,
62 * TEXTURE_2D_INDEX, TEXTURE_3D_INDEX, etc.
63 * We'll use that info for state validation before rendering.
66 update_single_shader_texture_used(struct gl_shader_program
*shProg
,
67 struct gl_program
*prog
,
68 GLuint unit
, GLuint target
)
70 gl_shader_stage prog_stage
=
71 _mesa_program_enum_to_shader_stage(prog
->Target
);
73 assert(unit
< ARRAY_SIZE(prog
->TexturesUsed
));
74 assert(target
< NUM_TEXTURE_TARGETS
);
76 /* From section 7.10 (Samplers) of the OpenGL 4.5 spec:
78 * "It is not allowed to have variables of different sampler types pointing
79 * to the same texture image unit within a program object."
81 unsigned stages_mask
= shProg
->data
->linked_stages
;
83 const int stage
= u_bit_scan(&stages_mask
);
85 /* Skip validation if we are yet to update textures used in this
88 if (prog_stage
< stage
)
91 struct gl_program
*glprog
= shProg
->_LinkedShaders
[stage
]->Program
;
92 if (glprog
->TexturesUsed
[unit
] & ~(1 << target
))
93 shProg
->SamplersValidated
= GL_FALSE
;
96 prog
->TexturesUsed
[unit
] |= (1 << target
);
100 _mesa_update_shader_textures_used(struct gl_shader_program
*shProg
,
101 struct gl_program
*prog
)
103 GLbitfield mask
= prog
->SamplersUsed
;
104 ASSERTED gl_shader_stage prog_stage
=
105 _mesa_program_enum_to_shader_stage(prog
->Target
);
108 assert(shProg
->_LinkedShaders
[prog_stage
]);
110 memset(prog
->TexturesUsed
, 0, sizeof(prog
->TexturesUsed
));
113 s
= u_bit_scan(&mask
);
115 update_single_shader_texture_used(shProg
, prog
,
116 prog
->SamplerUnits
[s
],
117 prog
->sh
.SamplerTargets
[s
]);
120 if (unlikely(prog
->sh
.HasBoundBindlessSampler
)) {
121 /* Loop over bindless samplers bound to texture units.
123 for (s
= 0; s
< prog
->sh
.NumBindlessSamplers
; s
++) {
124 struct gl_bindless_sampler
*sampler
= &prog
->sh
.BindlessSamplers
[s
];
129 update_single_shader_texture_used(shProg
, prog
, sampler
->unit
,
136 * Connect a piece of driver storage with a part of a uniform
138 * \param uni The uniform with which the storage will be associated
139 * \param element_stride Byte-stride between array elements.
140 * \sa gl_uniform_driver_storage::element_stride.
141 * \param vector_stride Byte-stride between vectors (in a matrix).
142 * \sa gl_uniform_driver_storage::vector_stride.
143 * \param format Conversion from native format to driver format
144 * required by the driver.
145 * \param data Location to dump the data.
148 _mesa_uniform_attach_driver_storage(struct gl_uniform_storage
*uni
,
149 unsigned element_stride
,
150 unsigned vector_stride
,
151 enum gl_uniform_driver_format format
,
154 uni
->driver_storage
=
155 realloc(uni
->driver_storage
,
156 sizeof(struct gl_uniform_driver_storage
)
157 * (uni
->num_driver_storage
+ 1));
159 uni
->driver_storage
[uni
->num_driver_storage
].element_stride
= element_stride
;
160 uni
->driver_storage
[uni
->num_driver_storage
].vector_stride
= vector_stride
;
161 uni
->driver_storage
[uni
->num_driver_storage
].format
= format
;
162 uni
->driver_storage
[uni
->num_driver_storage
].data
= data
;
164 uni
->num_driver_storage
++;
168 * Sever all connections with all pieces of driver storage for all uniforms
171 * This function does \b not release any of the \c data pointers
172 * previously passed in to \c _mesa_uniform_attach_driver_stoarge.
175 _mesa_uniform_detach_all_driver_storage(struct gl_uniform_storage
*uni
)
177 free(uni
->driver_storage
);
178 uni
->driver_storage
= NULL
;
179 uni
->num_driver_storage
= 0;
183 _mesa_Uniform1f(GLint location
, GLfloat v0
)
185 GET_CURRENT_CONTEXT(ctx
);
186 _mesa_uniform(location
, 1, &v0
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_FLOAT
, 1);
190 _mesa_Uniform2f(GLint location
, GLfloat v0
, GLfloat v1
)
192 GET_CURRENT_CONTEXT(ctx
);
196 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_FLOAT
, 2);
200 _mesa_Uniform3f(GLint location
, GLfloat v0
, GLfloat v1
, GLfloat v2
)
202 GET_CURRENT_CONTEXT(ctx
);
207 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_FLOAT
, 3);
211 _mesa_Uniform4f(GLint location
, GLfloat v0
, GLfloat v1
, GLfloat v2
,
214 GET_CURRENT_CONTEXT(ctx
);
220 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_FLOAT
, 4);
224 _mesa_Uniform1i(GLint location
, GLint v0
)
226 GET_CURRENT_CONTEXT(ctx
);
227 _mesa_uniform(location
, 1, &v0
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT
, 1);
231 _mesa_Uniform2i(GLint location
, GLint v0
, GLint v1
)
233 GET_CURRENT_CONTEXT(ctx
);
237 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT
, 2);
241 _mesa_Uniform3i(GLint location
, GLint v0
, GLint v1
, GLint v2
)
243 GET_CURRENT_CONTEXT(ctx
);
248 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT
, 3);
252 _mesa_Uniform4i(GLint location
, GLint v0
, GLint v1
, GLint v2
, GLint v3
)
254 GET_CURRENT_CONTEXT(ctx
);
260 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT
, 4);
264 _mesa_Uniform1fv(GLint location
, GLsizei count
, const GLfloat
* value
)
266 GET_CURRENT_CONTEXT(ctx
);
267 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_FLOAT
, 1);
271 _mesa_Uniform2fv(GLint location
, GLsizei count
, const GLfloat
* value
)
273 GET_CURRENT_CONTEXT(ctx
);
274 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_FLOAT
, 2);
278 _mesa_Uniform3fv(GLint location
, GLsizei count
, const GLfloat
* value
)
280 GET_CURRENT_CONTEXT(ctx
);
281 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_FLOAT
, 3);
285 _mesa_Uniform4fv(GLint location
, GLsizei count
, const GLfloat
* value
)
287 GET_CURRENT_CONTEXT(ctx
);
288 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_FLOAT
, 4);
292 _mesa_Uniform1iv(GLint location
, GLsizei count
, const GLint
* value
)
294 GET_CURRENT_CONTEXT(ctx
);
295 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT
, 1);
299 _mesa_Uniform2iv(GLint location
, GLsizei count
, const GLint
* value
)
301 GET_CURRENT_CONTEXT(ctx
);
302 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT
, 2);
306 _mesa_Uniform3iv(GLint location
, GLsizei count
, const GLint
* value
)
308 GET_CURRENT_CONTEXT(ctx
);
309 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT
, 3);
313 _mesa_Uniform4iv(GLint location
, GLsizei count
, const GLint
* value
)
315 GET_CURRENT_CONTEXT(ctx
);
316 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT
, 4);
320 _mesa_UniformHandleui64ARB(GLint location
, GLuint64 value
)
322 GET_CURRENT_CONTEXT(ctx
);
323 _mesa_uniform_handle(location
, 1, &value
, ctx
, ctx
->_Shader
->ActiveProgram
);
327 _mesa_UniformHandleui64vARB(GLint location
, GLsizei count
,
328 const GLuint64
*value
)
330 GET_CURRENT_CONTEXT(ctx
);
331 _mesa_uniform_handle(location
, count
, value
, ctx
,
332 ctx
->_Shader
->ActiveProgram
);
336 /** Same as above with direct state access **/
338 _mesa_ProgramUniform1f(GLuint program
, GLint location
, GLfloat v0
)
340 GET_CURRENT_CONTEXT(ctx
);
341 struct gl_shader_program
*shProg
=
342 _mesa_lookup_shader_program_err(ctx
, program
,
343 "glProgramUniform1f");
344 _mesa_uniform(location
, 1, &v0
, ctx
, shProg
, GLSL_TYPE_FLOAT
, 1);
348 _mesa_ProgramUniform2f(GLuint program
, GLint location
, GLfloat v0
, GLfloat v1
)
350 GET_CURRENT_CONTEXT(ctx
);
352 struct gl_shader_program
*shProg
;
355 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform2f");
356 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_FLOAT
, 2);
360 _mesa_ProgramUniform3f(GLuint program
, GLint location
, GLfloat v0
, GLfloat v1
,
363 GET_CURRENT_CONTEXT(ctx
);
365 struct gl_shader_program
*shProg
;
369 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform3f");
370 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_FLOAT
, 3);
374 _mesa_ProgramUniform4f(GLuint program
, GLint location
, GLfloat v0
, GLfloat v1
,
375 GLfloat v2
, GLfloat v3
)
377 GET_CURRENT_CONTEXT(ctx
);
379 struct gl_shader_program
*shProg
;
384 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform4f");
385 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_FLOAT
, 4);
389 _mesa_ProgramUniform1i(GLuint program
, GLint location
, GLint v0
)
391 GET_CURRENT_CONTEXT(ctx
);
392 struct gl_shader_program
*shProg
=
393 _mesa_lookup_shader_program_err(ctx
, program
,
394 "glProgramUniform1i");
395 _mesa_uniform(location
, 1, &v0
, ctx
, shProg
, GLSL_TYPE_INT
, 1);
399 _mesa_ProgramUniform2i(GLuint program
, GLint location
, GLint v0
, GLint v1
)
401 GET_CURRENT_CONTEXT(ctx
);
403 struct gl_shader_program
*shProg
;
406 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform2i");
407 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_INT
, 2);
411 _mesa_ProgramUniform3i(GLuint program
, GLint location
, GLint v0
, GLint v1
,
414 GET_CURRENT_CONTEXT(ctx
);
416 struct gl_shader_program
*shProg
;
420 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform3i");
421 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_INT
, 3);
425 _mesa_ProgramUniform4i(GLuint program
, GLint location
, GLint v0
, GLint v1
,
428 GET_CURRENT_CONTEXT(ctx
);
430 struct gl_shader_program
*shProg
;
435 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform4i");
436 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_INT
, 4);
440 _mesa_ProgramUniform1fv(GLuint program
, GLint location
, GLsizei count
,
441 const GLfloat
* value
)
443 GET_CURRENT_CONTEXT(ctx
);
444 struct gl_shader_program
*shProg
=
445 _mesa_lookup_shader_program_err(ctx
, program
,
446 "glProgramUniform1fv");
447 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_FLOAT
, 1);
451 _mesa_ProgramUniform2fv(GLuint program
, GLint location
, GLsizei count
,
452 const GLfloat
* value
)
454 GET_CURRENT_CONTEXT(ctx
);
455 struct gl_shader_program
*shProg
=
456 _mesa_lookup_shader_program_err(ctx
, program
,
457 "glProgramUniform2fv");
458 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_FLOAT
, 2);
462 _mesa_ProgramUniform3fv(GLuint program
, GLint location
, GLsizei count
,
463 const GLfloat
* value
)
465 GET_CURRENT_CONTEXT(ctx
);
466 struct gl_shader_program
*shProg
=
467 _mesa_lookup_shader_program_err(ctx
, program
,
468 "glProgramUniform3fv");
469 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_FLOAT
, 3);
473 _mesa_ProgramUniform4fv(GLuint program
, GLint location
, GLsizei count
,
474 const GLfloat
* value
)
476 GET_CURRENT_CONTEXT(ctx
);
477 struct gl_shader_program
*shProg
=
478 _mesa_lookup_shader_program_err(ctx
, program
,
479 "glProgramUniform4fv");
480 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_FLOAT
, 4);
484 _mesa_ProgramUniform1iv(GLuint program
, GLint location
, GLsizei count
,
487 GET_CURRENT_CONTEXT(ctx
);
488 struct gl_shader_program
*shProg
=
489 _mesa_lookup_shader_program_err(ctx
, program
,
490 "glProgramUniform1iv");
491 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_INT
, 1);
495 _mesa_ProgramUniform2iv(GLuint program
, GLint location
, GLsizei count
,
498 GET_CURRENT_CONTEXT(ctx
);
499 struct gl_shader_program
*shProg
=
500 _mesa_lookup_shader_program_err(ctx
, program
,
501 "glProgramUniform2iv");
502 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_INT
, 2);
506 _mesa_ProgramUniform3iv(GLuint program
, GLint location
, GLsizei count
,
509 GET_CURRENT_CONTEXT(ctx
);
510 struct gl_shader_program
*shProg
=
511 _mesa_lookup_shader_program_err(ctx
, program
,
512 "glProgramUniform3iv");
513 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_INT
, 3);
517 _mesa_ProgramUniform4iv(GLuint program
, GLint location
, GLsizei count
,
520 GET_CURRENT_CONTEXT(ctx
);
521 struct gl_shader_program
*shProg
=
522 _mesa_lookup_shader_program_err(ctx
, program
,
523 "glProgramUniform4iv");
524 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_INT
, 4);
528 _mesa_ProgramUniformHandleui64ARB(GLuint program
, GLint location
,
531 GET_CURRENT_CONTEXT(ctx
);
532 struct gl_shader_program
*shProg
=
533 _mesa_lookup_shader_program_err(ctx
, program
,
534 "glProgramUniformHandleui64ARB");
535 _mesa_uniform_handle(location
, 1, &value
, ctx
, shProg
);
539 _mesa_ProgramUniformHandleui64vARB(GLuint program
, GLint location
,
540 GLsizei count
, const GLuint64
*values
)
542 GET_CURRENT_CONTEXT(ctx
);
543 struct gl_shader_program
*shProg
=
544 _mesa_lookup_shader_program_err(ctx
, program
,
545 "glProgramUniformHandleui64vARB");
546 _mesa_uniform_handle(location
, count
, values
, ctx
, shProg
);
550 /** OpenGL 3.0 GLuint-valued functions **/
552 _mesa_Uniform1ui(GLint location
, GLuint v0
)
554 GET_CURRENT_CONTEXT(ctx
);
555 _mesa_uniform(location
, 1, &v0
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT
, 1);
559 _mesa_Uniform2ui(GLint location
, GLuint v0
, GLuint v1
)
561 GET_CURRENT_CONTEXT(ctx
);
565 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT
, 2);
569 _mesa_Uniform3ui(GLint location
, GLuint v0
, GLuint v1
, GLuint v2
)
571 GET_CURRENT_CONTEXT(ctx
);
576 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT
, 3);
580 _mesa_Uniform4ui(GLint location
, GLuint v0
, GLuint v1
, GLuint v2
, GLuint v3
)
582 GET_CURRENT_CONTEXT(ctx
);
588 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT
, 4);
592 _mesa_Uniform1uiv(GLint location
, GLsizei count
, const GLuint
*value
)
594 GET_CURRENT_CONTEXT(ctx
);
595 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT
, 1);
599 _mesa_Uniform2uiv(GLint location
, GLsizei count
, const GLuint
*value
)
601 GET_CURRENT_CONTEXT(ctx
);
602 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT
, 2);
606 _mesa_Uniform3uiv(GLint location
, GLsizei count
, const GLuint
*value
)
608 GET_CURRENT_CONTEXT(ctx
);
609 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT
, 3);
613 _mesa_Uniform4uiv(GLint location
, GLsizei count
, const GLuint
*value
)
615 GET_CURRENT_CONTEXT(ctx
);
616 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT
, 4);
622 _mesa_UniformMatrix2fv(GLint location
, GLsizei count
, GLboolean transpose
,
623 const GLfloat
* value
)
625 GET_CURRENT_CONTEXT(ctx
);
626 _mesa_uniform_matrix(location
, count
, transpose
, value
,
627 ctx
, ctx
->_Shader
->ActiveProgram
, 2, 2, GLSL_TYPE_FLOAT
);
631 _mesa_UniformMatrix3fv(GLint location
, GLsizei count
, GLboolean transpose
,
632 const GLfloat
* value
)
634 GET_CURRENT_CONTEXT(ctx
);
635 _mesa_uniform_matrix(location
, count
, transpose
, value
,
636 ctx
, ctx
->_Shader
->ActiveProgram
, 3, 3, GLSL_TYPE_FLOAT
);
640 _mesa_UniformMatrix4fv(GLint location
, GLsizei count
, GLboolean transpose
,
641 const GLfloat
* value
)
643 GET_CURRENT_CONTEXT(ctx
);
644 _mesa_uniform_matrix(location
, count
, transpose
, value
,
645 ctx
, ctx
->_Shader
->ActiveProgram
, 4, 4, GLSL_TYPE_FLOAT
);
648 /** Same as above with direct state access **/
651 _mesa_ProgramUniform1ui(GLuint program
, GLint location
, GLuint v0
)
653 GET_CURRENT_CONTEXT(ctx
);
654 struct gl_shader_program
*shProg
=
655 _mesa_lookup_shader_program_err(ctx
, program
,
656 "glProgramUniform1ui");
657 _mesa_uniform(location
, 1, &v0
, ctx
, shProg
, GLSL_TYPE_UINT
, 1);
661 _mesa_ProgramUniform2ui(GLuint program
, GLint location
, GLuint v0
, GLuint v1
)
663 GET_CURRENT_CONTEXT(ctx
);
665 struct gl_shader_program
*shProg
;
668 shProg
= _mesa_lookup_shader_program_err(ctx
, program
,
669 "glProgramUniform2ui");
670 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_UINT
, 2);
674 _mesa_ProgramUniform3ui(GLuint program
, GLint location
, GLuint v0
, GLuint v1
,
677 GET_CURRENT_CONTEXT(ctx
);
679 struct gl_shader_program
*shProg
;
683 shProg
= _mesa_lookup_shader_program_err(ctx
, program
,
684 "glProgramUniform3ui");
685 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_UINT
, 3);
689 _mesa_ProgramUniform4ui(GLuint program
, GLint location
, GLuint v0
, GLuint v1
,
690 GLuint v2
, GLuint v3
)
692 GET_CURRENT_CONTEXT(ctx
);
694 struct gl_shader_program
*shProg
;
699 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform4ui");
700 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_UINT
, 4);
704 _mesa_ProgramUniform1uiv(GLuint program
, GLint location
, GLsizei count
,
707 GET_CURRENT_CONTEXT(ctx
);
708 struct gl_shader_program
*shProg
=
709 _mesa_lookup_shader_program_err(ctx
, program
,
710 "glProgramUniform1uiv");
711 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_UINT
, 1);
715 _mesa_ProgramUniform2uiv(GLuint program
, GLint location
, GLsizei count
,
718 GET_CURRENT_CONTEXT(ctx
);
719 struct gl_shader_program
*shProg
=
720 _mesa_lookup_shader_program_err(ctx
, program
,
721 "glProgramUniform2uiv");
722 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_UINT
, 2);
726 _mesa_ProgramUniform3uiv(GLuint program
, GLint location
, GLsizei count
,
729 GET_CURRENT_CONTEXT(ctx
);
730 struct gl_shader_program
*shProg
=
731 _mesa_lookup_shader_program_err(ctx
, program
,
732 "glProgramUniform3uiv");
733 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_UINT
, 3);
737 _mesa_ProgramUniform4uiv(GLuint program
, GLint location
, GLsizei count
,
740 GET_CURRENT_CONTEXT(ctx
);
741 struct gl_shader_program
*shProg
=
742 _mesa_lookup_shader_program_err(ctx
, program
,
743 "glProgramUniform4uiv");
744 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_UINT
, 4);
750 _mesa_ProgramUniformMatrix2fv(GLuint program
, GLint location
, GLsizei count
,
751 GLboolean transpose
, const GLfloat
* value
)
753 GET_CURRENT_CONTEXT(ctx
);
754 struct gl_shader_program
*shProg
=
755 _mesa_lookup_shader_program_err(ctx
, program
,
756 "glProgramUniformMatrix2fv");
757 _mesa_uniform_matrix(location
, count
, transpose
, value
, ctx
, shProg
, 2, 2, GLSL_TYPE_FLOAT
);
761 _mesa_ProgramUniformMatrix3fv(GLuint program
, GLint location
, GLsizei count
,
762 GLboolean transpose
, const GLfloat
* value
)
764 GET_CURRENT_CONTEXT(ctx
);
765 struct gl_shader_program
*shProg
=
766 _mesa_lookup_shader_program_err(ctx
, program
,
767 "glProgramUniformMatrix3fv");
768 _mesa_uniform_matrix(location
, count
, transpose
, value
, ctx
, shProg
, 3, 3, GLSL_TYPE_FLOAT
);
772 _mesa_ProgramUniformMatrix4fv(GLuint program
, GLint location
, GLsizei count
,
773 GLboolean transpose
, const GLfloat
* value
)
775 GET_CURRENT_CONTEXT(ctx
);
776 struct gl_shader_program
*shProg
=
777 _mesa_lookup_shader_program_err(ctx
, program
,
778 "glProgramUniformMatrix4fv");
779 _mesa_uniform_matrix(location
, count
, transpose
, value
, ctx
, shProg
, 4, 4, GLSL_TYPE_FLOAT
);
784 * Non-square UniformMatrix are OpenGL 2.1
787 _mesa_UniformMatrix2x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
788 const GLfloat
*value
)
790 GET_CURRENT_CONTEXT(ctx
);
791 _mesa_uniform_matrix(location
, count
, transpose
, value
,
792 ctx
, ctx
->_Shader
->ActiveProgram
, 2, 3, GLSL_TYPE_FLOAT
);
796 _mesa_UniformMatrix3x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
797 const GLfloat
*value
)
799 GET_CURRENT_CONTEXT(ctx
);
800 _mesa_uniform_matrix(location
, count
, transpose
, value
,
801 ctx
, ctx
->_Shader
->ActiveProgram
, 3, 2, GLSL_TYPE_FLOAT
);
805 _mesa_UniformMatrix2x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
806 const GLfloat
*value
)
808 GET_CURRENT_CONTEXT(ctx
);
809 _mesa_uniform_matrix(location
, count
, transpose
, value
,
810 ctx
, ctx
->_Shader
->ActiveProgram
, 2, 4, GLSL_TYPE_FLOAT
);
814 _mesa_UniformMatrix4x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
815 const GLfloat
*value
)
817 GET_CURRENT_CONTEXT(ctx
);
818 _mesa_uniform_matrix(location
, count
, transpose
, value
,
819 ctx
, ctx
->_Shader
->ActiveProgram
, 4, 2, GLSL_TYPE_FLOAT
);
823 _mesa_UniformMatrix3x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
824 const GLfloat
*value
)
826 GET_CURRENT_CONTEXT(ctx
);
827 _mesa_uniform_matrix(location
, count
, transpose
, value
,
828 ctx
, ctx
->_Shader
->ActiveProgram
, 3, 4, GLSL_TYPE_FLOAT
);
832 _mesa_UniformMatrix4x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
833 const GLfloat
*value
)
835 GET_CURRENT_CONTEXT(ctx
);
836 _mesa_uniform_matrix(location
, count
, transpose
, value
,
837 ctx
, ctx
->_Shader
->ActiveProgram
, 4, 3, GLSL_TYPE_FLOAT
);
840 /** Same as above with direct state access **/
843 _mesa_ProgramUniformMatrix2x3fv(GLuint program
, GLint location
, GLsizei count
,
844 GLboolean transpose
, const GLfloat
* value
)
846 GET_CURRENT_CONTEXT(ctx
);
847 struct gl_shader_program
*shProg
=
848 _mesa_lookup_shader_program_err(ctx
, program
,
849 "glProgramUniformMatrix2x3fv");
850 _mesa_uniform_matrix(location
, count
, transpose
, value
, ctx
, shProg
, 2, 3, GLSL_TYPE_FLOAT
);
854 _mesa_ProgramUniformMatrix3x2fv(GLuint program
, GLint location
, GLsizei count
,
855 GLboolean transpose
, const GLfloat
* value
)
857 GET_CURRENT_CONTEXT(ctx
);
858 struct gl_shader_program
*shProg
=
859 _mesa_lookup_shader_program_err(ctx
, program
,
860 "glProgramUniformMatrix3x2fv");
861 _mesa_uniform_matrix(location
, count
, transpose
, value
, ctx
, shProg
, 3, 2, GLSL_TYPE_FLOAT
);
865 _mesa_ProgramUniformMatrix2x4fv(GLuint program
, GLint location
, GLsizei count
,
866 GLboolean transpose
, const GLfloat
* value
)
868 GET_CURRENT_CONTEXT(ctx
);
869 struct gl_shader_program
*shProg
=
870 _mesa_lookup_shader_program_err(ctx
, program
,
871 "glProgramUniformMatrix2x4fv");
872 _mesa_uniform_matrix(location
, count
, transpose
, value
, ctx
, shProg
, 2, 4, GLSL_TYPE_FLOAT
);
876 _mesa_ProgramUniformMatrix4x2fv(GLuint program
, GLint location
, GLsizei count
,
877 GLboolean transpose
, const GLfloat
* value
)
879 GET_CURRENT_CONTEXT(ctx
);
880 struct gl_shader_program
*shProg
=
881 _mesa_lookup_shader_program_err(ctx
, program
,
882 "glProgramUniformMatrix4x2fv");
883 _mesa_uniform_matrix(location
, count
, transpose
, value
, ctx
, shProg
, 4, 2, GLSL_TYPE_FLOAT
);
887 _mesa_ProgramUniformMatrix3x4fv(GLuint program
, GLint location
, GLsizei count
,
888 GLboolean transpose
, const GLfloat
* value
)
890 GET_CURRENT_CONTEXT(ctx
);
891 struct gl_shader_program
*shProg
=
892 _mesa_lookup_shader_program_err(ctx
, program
,
893 "glProgramUniformMatrix3x4fv");
894 _mesa_uniform_matrix(location
, count
, transpose
, value
, ctx
, shProg
, 3, 4, GLSL_TYPE_FLOAT
);
898 _mesa_ProgramUniformMatrix4x3fv(GLuint program
, GLint location
, GLsizei count
,
899 GLboolean transpose
, const GLfloat
* value
)
901 GET_CURRENT_CONTEXT(ctx
);
902 struct gl_shader_program
*shProg
=
903 _mesa_lookup_shader_program_err(ctx
, program
,
904 "glProgramUniformMatrix4x3fv");
905 _mesa_uniform_matrix(location
, count
, transpose
, value
, ctx
, shProg
, 4, 3, GLSL_TYPE_FLOAT
);
910 _mesa_GetnUniformfvARB(GLuint program
, GLint location
,
911 GLsizei bufSize
, GLfloat
*params
)
913 GET_CURRENT_CONTEXT(ctx
);
914 _mesa_get_uniform(ctx
, program
, location
, bufSize
, GLSL_TYPE_FLOAT
, params
);
918 _mesa_GetUniformfv(GLuint program
, GLint location
, GLfloat
*params
)
920 _mesa_GetnUniformfvARB(program
, location
, INT_MAX
, params
);
925 _mesa_GetnUniformivARB(GLuint program
, GLint location
,
926 GLsizei bufSize
, GLint
*params
)
928 GET_CURRENT_CONTEXT(ctx
);
929 _mesa_get_uniform(ctx
, program
, location
, bufSize
, GLSL_TYPE_INT
, params
);
933 _mesa_GetUniformiv(GLuint program
, GLint location
, GLint
*params
)
935 _mesa_GetnUniformivARB(program
, location
, INT_MAX
, params
);
941 _mesa_GetnUniformuivARB(GLuint program
, GLint location
,
942 GLsizei bufSize
, GLuint
*params
)
944 GET_CURRENT_CONTEXT(ctx
);
945 _mesa_get_uniform(ctx
, program
, location
, bufSize
, GLSL_TYPE_UINT
, params
);
949 _mesa_GetUniformuiv(GLuint program
, GLint location
, GLuint
*params
)
951 _mesa_GetnUniformuivARB(program
, location
, INT_MAX
, params
);
957 _mesa_GetnUniformdvARB(GLuint program
, GLint location
,
958 GLsizei bufSize
, GLdouble
*params
)
960 GET_CURRENT_CONTEXT(ctx
);
962 _mesa_get_uniform(ctx
, program
, location
, bufSize
, GLSL_TYPE_DOUBLE
, params
);
966 _mesa_GetUniformdv(GLuint program
, GLint location
, GLdouble
*params
)
968 _mesa_GetnUniformdvARB(program
, location
, INT_MAX
, params
);
972 _mesa_GetnUniformi64vARB(GLuint program
, GLint location
,
973 GLsizei bufSize
, GLint64
*params
)
975 GET_CURRENT_CONTEXT(ctx
);
976 _mesa_get_uniform(ctx
, program
, location
, bufSize
, GLSL_TYPE_INT64
, params
);
979 _mesa_GetUniformi64vARB(GLuint program
, GLint location
, GLint64
*params
)
981 _mesa_GetnUniformi64vARB(program
, location
, INT_MAX
, params
);
985 _mesa_GetnUniformui64vARB(GLuint program
, GLint location
,
986 GLsizei bufSize
, GLuint64
*params
)
988 GET_CURRENT_CONTEXT(ctx
);
989 _mesa_get_uniform(ctx
, program
, location
, bufSize
, GLSL_TYPE_UINT64
, params
);
993 _mesa_GetUniformui64vARB(GLuint program
, GLint location
, GLuint64
*params
)
995 _mesa_GetnUniformui64vARB(program
, location
, INT_MAX
, params
);
1000 _mesa_GetUniformLocation(GLuint programObj
, const GLcharARB
*name
)
1002 struct gl_shader_program
*shProg
;
1004 GET_CURRENT_CONTEXT(ctx
);
1006 shProg
= _mesa_lookup_shader_program_err(ctx
, programObj
,
1007 "glGetUniformLocation");
1008 if (!shProg
|| !name
)
1011 /* Page 80 (page 94 of the PDF) of the OpenGL 2.1 spec says:
1013 * "If program has not been successfully linked, the error
1014 * INVALID_OPERATION is generated."
1016 if (shProg
->data
->LinkStatus
== LINKING_FAILURE
) {
1017 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1018 "glGetUniformLocation(program not linked)");
1022 return _mesa_program_resource_location(shProg
, GL_UNIFORM
, name
);
1026 _mesa_GetUniformLocation_no_error(GLuint programObj
, const GLcharARB
*name
)
1028 GET_CURRENT_CONTEXT(ctx
);
1030 struct gl_shader_program
*shProg
=
1031 _mesa_lookup_shader_program(ctx
, programObj
);
1033 return _mesa_program_resource_location(shProg
, GL_UNIFORM
, name
);
1037 _mesa_GetUniformBlockIndex(GLuint program
,
1038 const GLchar
*uniformBlockName
)
1040 GET_CURRENT_CONTEXT(ctx
);
1041 struct gl_shader_program
*shProg
;
1043 if (!ctx
->Extensions
.ARB_uniform_buffer_object
) {
1044 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glGetUniformBlockIndex");
1045 return GL_INVALID_INDEX
;
1048 shProg
= _mesa_lookup_shader_program_err(ctx
, program
,
1049 "glGetUniformBlockIndex");
1051 return GL_INVALID_INDEX
;
1053 struct gl_program_resource
*res
=
1054 _mesa_program_resource_find_name(shProg
, GL_UNIFORM_BLOCK
,
1055 uniformBlockName
, NULL
);
1057 return GL_INVALID_INDEX
;
1059 return _mesa_program_resource_index(shProg
, res
);
1063 _mesa_GetUniformIndices(GLuint program
,
1064 GLsizei uniformCount
,
1065 const GLchar
* const *uniformNames
,
1066 GLuint
*uniformIndices
)
1068 GET_CURRENT_CONTEXT(ctx
);
1070 struct gl_shader_program
*shProg
;
1072 if (!ctx
->Extensions
.ARB_uniform_buffer_object
) {
1073 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glGetUniformIndices");
1077 shProg
= _mesa_lookup_shader_program_err(ctx
, program
,
1078 "glGetUniformIndices");
1082 if (uniformCount
< 0) {
1083 _mesa_error(ctx
, GL_INVALID_VALUE
,
1084 "glGetUniformIndices(uniformCount < 0)");
1088 for (i
= 0; i
< uniformCount
; i
++) {
1089 struct gl_program_resource
*res
=
1090 _mesa_program_resource_find_name(shProg
, GL_UNIFORM
, uniformNames
[i
],
1092 uniformIndices
[i
] = _mesa_program_resource_index(shProg
, res
);
1097 uniform_block_binding(struct gl_context
*ctx
, struct gl_shader_program
*shProg
,
1098 GLuint uniformBlockIndex
, GLuint uniformBlockBinding
)
1100 if (shProg
->data
->UniformBlocks
[uniformBlockIndex
].Binding
!=
1101 uniformBlockBinding
) {
1103 FLUSH_VERTICES(ctx
, 0);
1104 ctx
->NewDriverState
|= ctx
->DriverFlags
.NewUniformBuffer
;
1106 shProg
->data
->UniformBlocks
[uniformBlockIndex
].Binding
=
1107 uniformBlockBinding
;
1112 _mesa_UniformBlockBinding_no_error(GLuint program
, GLuint uniformBlockIndex
,
1113 GLuint uniformBlockBinding
)
1115 GET_CURRENT_CONTEXT(ctx
);
1117 struct gl_shader_program
*shProg
= _mesa_lookup_shader_program(ctx
, program
);
1118 uniform_block_binding(ctx
, shProg
, uniformBlockIndex
, uniformBlockBinding
);
1122 _mesa_UniformBlockBinding(GLuint program
,
1123 GLuint uniformBlockIndex
,
1124 GLuint uniformBlockBinding
)
1126 GET_CURRENT_CONTEXT(ctx
);
1127 struct gl_shader_program
*shProg
;
1129 if (!ctx
->Extensions
.ARB_uniform_buffer_object
) {
1130 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glUniformBlockBinding");
1134 shProg
= _mesa_lookup_shader_program_err(ctx
, program
,
1135 "glUniformBlockBinding");
1139 if (uniformBlockIndex
>= shProg
->data
->NumUniformBlocks
) {
1140 _mesa_error(ctx
, GL_INVALID_VALUE
,
1141 "glUniformBlockBinding(block index %u >= %u)",
1142 uniformBlockIndex
, shProg
->data
->NumUniformBlocks
);
1146 if (uniformBlockBinding
>= ctx
->Const
.MaxUniformBufferBindings
) {
1147 _mesa_error(ctx
, GL_INVALID_VALUE
,
1148 "glUniformBlockBinding(block binding %u >= %u)",
1149 uniformBlockBinding
, ctx
->Const
.MaxUniformBufferBindings
);
1153 uniform_block_binding(ctx
, shProg
, uniformBlockIndex
, uniformBlockBinding
);
1157 shader_storage_block_binding(struct gl_context
*ctx
,
1158 struct gl_shader_program
*shProg
,
1159 GLuint shaderStorageBlockIndex
,
1160 GLuint shaderStorageBlockBinding
)
1162 if (shProg
->data
->ShaderStorageBlocks
[shaderStorageBlockIndex
].Binding
!=
1163 shaderStorageBlockBinding
) {
1165 FLUSH_VERTICES(ctx
, 0);
1166 ctx
->NewDriverState
|= ctx
->DriverFlags
.NewShaderStorageBuffer
;
1168 shProg
->data
->ShaderStorageBlocks
[shaderStorageBlockIndex
].Binding
=
1169 shaderStorageBlockBinding
;
1174 _mesa_ShaderStorageBlockBinding_no_error(GLuint program
,
1175 GLuint shaderStorageBlockIndex
,
1176 GLuint shaderStorageBlockBinding
)
1178 GET_CURRENT_CONTEXT(ctx
);
1180 struct gl_shader_program
*shProg
= _mesa_lookup_shader_program(ctx
, program
);
1181 shader_storage_block_binding(ctx
, shProg
, shaderStorageBlockIndex
,
1182 shaderStorageBlockBinding
);
1186 _mesa_ShaderStorageBlockBinding(GLuint program
,
1187 GLuint shaderStorageBlockIndex
,
1188 GLuint shaderStorageBlockBinding
)
1190 GET_CURRENT_CONTEXT(ctx
);
1191 struct gl_shader_program
*shProg
;
1193 if (!ctx
->Extensions
.ARB_shader_storage_buffer_object
) {
1194 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glShaderStorageBlockBinding");
1198 shProg
= _mesa_lookup_shader_program_err(ctx
, program
,
1199 "glShaderStorageBlockBinding");
1203 if (shaderStorageBlockIndex
>= shProg
->data
->NumShaderStorageBlocks
) {
1204 _mesa_error(ctx
, GL_INVALID_VALUE
,
1205 "glShaderStorageBlockBinding(block index %u >= %u)",
1206 shaderStorageBlockIndex
,
1207 shProg
->data
->NumShaderStorageBlocks
);
1211 if (shaderStorageBlockBinding
>= ctx
->Const
.MaxShaderStorageBufferBindings
) {
1212 _mesa_error(ctx
, GL_INVALID_VALUE
,
1213 "glShaderStorageBlockBinding(block binding %u >= %u)",
1214 shaderStorageBlockBinding
,
1215 ctx
->Const
.MaxShaderStorageBufferBindings
);
1219 shader_storage_block_binding(ctx
, shProg
, shaderStorageBlockIndex
,
1220 shaderStorageBlockBinding
);
1224 * Generic program resource property query.
1227 mesa_bufferiv(struct gl_shader_program
*shProg
, GLenum type
,
1228 GLuint index
, GLenum pname
, GLint
*params
, const char *caller
)
1230 GET_CURRENT_CONTEXT(ctx
);
1231 struct gl_program_resource
*res
=
1232 _mesa_program_resource_find_index(shProg
, type
, index
);
1235 _mesa_error(ctx
, GL_INVALID_VALUE
, "%s(bufferindex %d)", caller
, index
);
1240 case GL_UNIFORM_BLOCK_BINDING
:
1241 case GL_ATOMIC_COUNTER_BUFFER_BINDING
:
1242 _mesa_program_resource_prop(shProg
, res
, index
, GL_BUFFER_BINDING
,
1245 case GL_UNIFORM_BLOCK_DATA_SIZE
:
1246 case GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE
:
1247 _mesa_program_resource_prop(shProg
, res
, index
, GL_BUFFER_DATA_SIZE
,
1250 case GL_UNIFORM_BLOCK_NAME_LENGTH
:
1251 _mesa_program_resource_prop(shProg
, res
, index
, GL_NAME_LENGTH
,
1254 case GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS
:
1255 case GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS
:
1256 _mesa_program_resource_prop(shProg
, res
, index
, GL_NUM_ACTIVE_VARIABLES
,
1259 case GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES
:
1260 case GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES
:
1261 _mesa_program_resource_prop(shProg
, res
, index
, GL_ACTIVE_VARIABLES
,
1264 case GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER
:
1265 case GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER
:
1266 _mesa_program_resource_prop(shProg
, res
, index
,
1267 GL_REFERENCED_BY_VERTEX_SHADER
, params
,
1271 case GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER
:
1272 case GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER
:
1273 _mesa_program_resource_prop(shProg
, res
, index
,
1274 GL_REFERENCED_BY_TESS_CONTROL_SHADER
, params
,
1278 case GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER
:
1279 case GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER
:
1280 _mesa_program_resource_prop(shProg
, res
, index
,
1281 GL_REFERENCED_BY_TESS_EVALUATION_SHADER
, params
,
1285 case GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER
:
1286 case GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER
:
1287 _mesa_program_resource_prop(shProg
, res
, index
,
1288 GL_REFERENCED_BY_GEOMETRY_SHADER
, params
,
1291 case GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER
:
1292 case GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER
:
1293 _mesa_program_resource_prop(shProg
, res
, index
,
1294 GL_REFERENCED_BY_FRAGMENT_SHADER
, params
,
1297 case GL_UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER
:
1298 case GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER
:
1299 _mesa_program_resource_prop(shProg
, res
, index
,
1300 GL_REFERENCED_BY_COMPUTE_SHADER
, params
,
1304 _mesa_error(ctx
, GL_INVALID_ENUM
,
1305 "%s(pname 0x%x (%s))", caller
, pname
,
1306 _mesa_enum_to_string(pname
));
1313 _mesa_GetActiveUniformBlockiv(GLuint program
,
1314 GLuint uniformBlockIndex
,
1318 GET_CURRENT_CONTEXT(ctx
);
1319 struct gl_shader_program
*shProg
;
1321 if (!ctx
->Extensions
.ARB_uniform_buffer_object
) {
1322 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glGetActiveUniformBlockiv");
1326 shProg
= _mesa_lookup_shader_program_err(ctx
, program
,
1327 "glGetActiveUniformBlockiv");
1331 mesa_bufferiv(shProg
, GL_UNIFORM_BLOCK
, uniformBlockIndex
, pname
, params
,
1332 "glGetActiveUniformBlockiv");
1336 _mesa_GetActiveUniformBlockName(GLuint program
,
1337 GLuint uniformBlockIndex
,
1340 GLchar
*uniformBlockName
)
1342 GET_CURRENT_CONTEXT(ctx
);
1343 struct gl_shader_program
*shProg
;
1345 if (!ctx
->Extensions
.ARB_uniform_buffer_object
) {
1346 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glGetActiveUniformBlockiv");
1351 _mesa_error(ctx
, GL_INVALID_VALUE
,
1352 "glGetActiveUniformBlockName(bufSize %d < 0)",
1357 shProg
= _mesa_lookup_shader_program_err(ctx
, program
,
1358 "glGetActiveUniformBlockiv");
1362 if (uniformBlockName
)
1363 _mesa_get_program_resource_name(shProg
, GL_UNIFORM_BLOCK
,
1364 uniformBlockIndex
, bufSize
, length
,
1366 "glGetActiveUniformBlockName");
1370 _mesa_GetActiveUniformName(GLuint program
, GLuint uniformIndex
,
1371 GLsizei bufSize
, GLsizei
*length
,
1372 GLchar
*uniformName
)
1374 GET_CURRENT_CONTEXT(ctx
);
1375 struct gl_shader_program
*shProg
;
1377 if (!ctx
->Extensions
.ARB_uniform_buffer_object
) {
1378 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glGetActiveUniformName");
1383 _mesa_error(ctx
, GL_INVALID_VALUE
,
1384 "glGetActiveUniformName(bufSize %d < 0)",
1389 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glGetActiveUniformName");
1394 _mesa_get_program_resource_name(shProg
, GL_UNIFORM
, uniformIndex
, bufSize
,
1395 length
, uniformName
, "glGetActiveUniformName");
1399 _mesa_GetActiveAtomicCounterBufferiv(GLuint program
, GLuint bufferIndex
,
1400 GLenum pname
, GLint
*params
)
1402 GET_CURRENT_CONTEXT(ctx
);
1403 struct gl_shader_program
*shProg
;
1405 if (!ctx
->Extensions
.ARB_shader_atomic_counters
) {
1406 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1407 "glGetActiveAtomicCounterBufferiv");
1411 shProg
= _mesa_lookup_shader_program_err(ctx
, program
,
1412 "glGetActiveAtomicCounterBufferiv");
1416 mesa_bufferiv(shProg
, GL_ATOMIC_COUNTER_BUFFER
, bufferIndex
, pname
, params
,
1417 "glGetActiveAtomicCounterBufferiv");
1421 _mesa_Uniform1d(GLint location
, GLdouble v0
)
1423 GET_CURRENT_CONTEXT(ctx
);
1424 _mesa_uniform(location
, 1, &v0
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_DOUBLE
, 1);
1428 _mesa_Uniform2d(GLint location
, GLdouble v0
, GLdouble v1
)
1430 GET_CURRENT_CONTEXT(ctx
);
1434 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_DOUBLE
, 2);
1438 _mesa_Uniform3d(GLint location
, GLdouble v0
, GLdouble v1
, GLdouble v2
)
1440 GET_CURRENT_CONTEXT(ctx
);
1445 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_DOUBLE
, 3);
1449 _mesa_Uniform4d(GLint location
, GLdouble v0
, GLdouble v1
, GLdouble v2
,
1452 GET_CURRENT_CONTEXT(ctx
);
1458 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_DOUBLE
, 4);
1462 _mesa_Uniform1dv(GLint location
, GLsizei count
, const GLdouble
* value
)
1464 GET_CURRENT_CONTEXT(ctx
);
1465 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_DOUBLE
, 1);
1469 _mesa_Uniform2dv(GLint location
, GLsizei count
, const GLdouble
* value
)
1471 GET_CURRENT_CONTEXT(ctx
);
1472 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_DOUBLE
, 2);
1476 _mesa_Uniform3dv(GLint location
, GLsizei count
, const GLdouble
* value
)
1478 GET_CURRENT_CONTEXT(ctx
);
1479 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_DOUBLE
, 3);
1483 _mesa_Uniform4dv(GLint location
, GLsizei count
, const GLdouble
* value
)
1485 GET_CURRENT_CONTEXT(ctx
);
1486 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_DOUBLE
, 4);
1490 _mesa_UniformMatrix2dv(GLint location
, GLsizei count
, GLboolean transpose
,
1491 const GLdouble
* value
)
1493 GET_CURRENT_CONTEXT(ctx
);
1494 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1495 ctx
, ctx
->_Shader
->ActiveProgram
, 2, 2, GLSL_TYPE_DOUBLE
);
1499 _mesa_UniformMatrix3dv(GLint location
, GLsizei count
, GLboolean transpose
,
1500 const GLdouble
* value
)
1502 GET_CURRENT_CONTEXT(ctx
);
1503 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1504 ctx
, ctx
->_Shader
->ActiveProgram
, 3, 3, GLSL_TYPE_DOUBLE
);
1508 _mesa_UniformMatrix4dv(GLint location
, GLsizei count
, GLboolean transpose
,
1509 const GLdouble
* value
)
1511 GET_CURRENT_CONTEXT(ctx
);
1512 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1513 ctx
, ctx
->_Shader
->ActiveProgram
, 4, 4, GLSL_TYPE_DOUBLE
);
1517 _mesa_UniformMatrix2x3dv(GLint location
, GLsizei count
, GLboolean transpose
,
1518 const GLdouble
*value
)
1520 GET_CURRENT_CONTEXT(ctx
);
1521 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1522 ctx
, ctx
->_Shader
->ActiveProgram
, 2, 3, GLSL_TYPE_DOUBLE
);
1526 _mesa_UniformMatrix3x2dv(GLint location
, GLsizei count
, GLboolean transpose
,
1527 const GLdouble
*value
)
1529 GET_CURRENT_CONTEXT(ctx
);
1530 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1531 ctx
, ctx
->_Shader
->ActiveProgram
, 3, 2, GLSL_TYPE_DOUBLE
);
1535 _mesa_UniformMatrix2x4dv(GLint location
, GLsizei count
, GLboolean transpose
,
1536 const GLdouble
*value
)
1538 GET_CURRENT_CONTEXT(ctx
);
1539 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1540 ctx
, ctx
->_Shader
->ActiveProgram
, 2, 4, GLSL_TYPE_DOUBLE
);
1544 _mesa_UniformMatrix4x2dv(GLint location
, GLsizei count
, GLboolean transpose
,
1545 const GLdouble
*value
)
1547 GET_CURRENT_CONTEXT(ctx
);
1548 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1549 ctx
, ctx
->_Shader
->ActiveProgram
, 4, 2, GLSL_TYPE_DOUBLE
);
1553 _mesa_UniformMatrix3x4dv(GLint location
, GLsizei count
, GLboolean transpose
,
1554 const GLdouble
*value
)
1556 GET_CURRENT_CONTEXT(ctx
);
1557 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1558 ctx
, ctx
->_Shader
->ActiveProgram
, 3, 4, GLSL_TYPE_DOUBLE
);
1562 _mesa_UniformMatrix4x3dv(GLint location
, GLsizei count
, GLboolean transpose
,
1563 const GLdouble
*value
)
1565 GET_CURRENT_CONTEXT(ctx
);
1566 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1567 ctx
, ctx
->_Shader
->ActiveProgram
, 4, 3, GLSL_TYPE_DOUBLE
);
1571 _mesa_ProgramUniform1d(GLuint program
, GLint location
, GLdouble v0
)
1573 GET_CURRENT_CONTEXT(ctx
);
1574 struct gl_shader_program
*shProg
=
1575 _mesa_lookup_shader_program_err(ctx
, program
,
1576 "glProgramUniform1d");
1577 _mesa_uniform(location
, 1, &v0
, ctx
, shProg
, GLSL_TYPE_DOUBLE
, 1);
1581 _mesa_ProgramUniform2d(GLuint program
, GLint location
, GLdouble v0
, GLdouble v1
)
1583 GET_CURRENT_CONTEXT(ctx
);
1585 struct gl_shader_program
*shProg
;
1588 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform2d");
1589 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_DOUBLE
, 2);
1593 _mesa_ProgramUniform3d(GLuint program
, GLint location
, GLdouble v0
, GLdouble v1
,
1596 GET_CURRENT_CONTEXT(ctx
);
1598 struct gl_shader_program
*shProg
;
1602 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform3d");
1603 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_DOUBLE
, 3);
1607 _mesa_ProgramUniform4d(GLuint program
, GLint location
, GLdouble v0
, GLdouble v1
,
1608 GLdouble v2
, GLdouble v3
)
1610 GET_CURRENT_CONTEXT(ctx
);
1612 struct gl_shader_program
*shProg
;
1617 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform4d");
1618 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_DOUBLE
, 4);
1622 _mesa_ProgramUniform1dv(GLuint program
, GLint location
, GLsizei count
,
1623 const GLdouble
* value
)
1625 GET_CURRENT_CONTEXT(ctx
);
1626 struct gl_shader_program
*shProg
=
1627 _mesa_lookup_shader_program_err(ctx
, program
,
1628 "glProgramUniform1dv");
1629 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_DOUBLE
, 1);
1633 _mesa_ProgramUniform2dv(GLuint program
, GLint location
, GLsizei count
,
1634 const GLdouble
* value
)
1636 GET_CURRENT_CONTEXT(ctx
);
1637 struct gl_shader_program
*shProg
=
1638 _mesa_lookup_shader_program_err(ctx
, program
,
1639 "glProgramUniform2dv");
1640 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_DOUBLE
, 2);
1644 _mesa_ProgramUniform3dv(GLuint program
, GLint location
, GLsizei count
,
1645 const GLdouble
* value
)
1647 GET_CURRENT_CONTEXT(ctx
);
1648 struct gl_shader_program
*shProg
=
1649 _mesa_lookup_shader_program_err(ctx
, program
,
1650 "glProgramUniform3dv");
1651 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_DOUBLE
, 3);
1655 _mesa_ProgramUniform4dv(GLuint program
, GLint location
, GLsizei count
,
1656 const GLdouble
* value
)
1658 GET_CURRENT_CONTEXT(ctx
);
1659 struct gl_shader_program
*shProg
=
1660 _mesa_lookup_shader_program_err(ctx
, program
,
1661 "glProgramUniform4dv");
1662 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_DOUBLE
, 4);
1666 _mesa_ProgramUniformMatrix2dv(GLuint program
, GLint location
, GLsizei count
,
1667 GLboolean transpose
, const GLdouble
* value
)
1669 GET_CURRENT_CONTEXT(ctx
);
1670 struct gl_shader_program
*shProg
=
1671 _mesa_lookup_shader_program_err(ctx
, program
,
1672 "glProgramUniformMatrix2dv");
1673 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1674 ctx
, shProg
, 2, 2, GLSL_TYPE_DOUBLE
);
1678 _mesa_ProgramUniformMatrix3dv(GLuint program
, GLint location
, GLsizei count
,
1679 GLboolean transpose
, const GLdouble
* value
)
1681 GET_CURRENT_CONTEXT(ctx
);
1682 struct gl_shader_program
*shProg
=
1683 _mesa_lookup_shader_program_err(ctx
, program
,
1684 "glProgramUniformMatrix3dv");
1685 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1686 ctx
, shProg
, 3, 3, GLSL_TYPE_DOUBLE
);
1690 _mesa_ProgramUniformMatrix4dv(GLuint program
, GLint location
, GLsizei count
,
1691 GLboolean transpose
, const GLdouble
* value
)
1693 GET_CURRENT_CONTEXT(ctx
);
1694 struct gl_shader_program
*shProg
=
1695 _mesa_lookup_shader_program_err(ctx
, program
,
1696 "glProgramUniformMatrix4dv");
1697 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1698 ctx
, shProg
, 4, 4, GLSL_TYPE_DOUBLE
);
1702 _mesa_ProgramUniformMatrix2x3dv(GLuint program
, GLint location
, GLsizei count
,
1703 GLboolean transpose
, const GLdouble
* value
)
1705 GET_CURRENT_CONTEXT(ctx
);
1706 struct gl_shader_program
*shProg
=
1707 _mesa_lookup_shader_program_err(ctx
, program
,
1708 "glProgramUniformMatrix2x3dv");
1709 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1710 ctx
, shProg
, 2, 3, GLSL_TYPE_DOUBLE
);
1714 _mesa_ProgramUniformMatrix3x2dv(GLuint program
, GLint location
, GLsizei count
,
1715 GLboolean transpose
, const GLdouble
* value
)
1717 GET_CURRENT_CONTEXT(ctx
);
1718 struct gl_shader_program
*shProg
=
1719 _mesa_lookup_shader_program_err(ctx
, program
,
1720 "glProgramUniformMatrix3x2dv");
1721 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1722 ctx
, shProg
, 3, 2, GLSL_TYPE_DOUBLE
);
1726 _mesa_ProgramUniformMatrix2x4dv(GLuint program
, GLint location
, GLsizei count
,
1727 GLboolean transpose
, const GLdouble
* value
)
1729 GET_CURRENT_CONTEXT(ctx
);
1730 struct gl_shader_program
*shProg
=
1731 _mesa_lookup_shader_program_err(ctx
, program
,
1732 "glProgramUniformMatrix2x4dv");
1733 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1734 ctx
, shProg
, 2, 4, GLSL_TYPE_DOUBLE
);
1738 _mesa_ProgramUniformMatrix4x2dv(GLuint program
, GLint location
, GLsizei count
,
1739 GLboolean transpose
, const GLdouble
* value
)
1741 GET_CURRENT_CONTEXT(ctx
);
1742 struct gl_shader_program
*shProg
=
1743 _mesa_lookup_shader_program_err(ctx
, program
,
1744 "glProgramUniformMatrix4x2dv");
1745 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1746 ctx
, shProg
, 4, 2, GLSL_TYPE_DOUBLE
);
1750 _mesa_ProgramUniformMatrix3x4dv(GLuint program
, GLint location
, GLsizei count
,
1751 GLboolean transpose
, const GLdouble
* value
)
1753 GET_CURRENT_CONTEXT(ctx
);
1754 struct gl_shader_program
*shProg
=
1755 _mesa_lookup_shader_program_err(ctx
, program
,
1756 "glProgramUniformMatrix3x4dv");
1757 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1758 ctx
, shProg
, 3, 4, GLSL_TYPE_DOUBLE
);
1762 _mesa_ProgramUniformMatrix4x3dv(GLuint program
, GLint location
, GLsizei count
,
1763 GLboolean transpose
, const GLdouble
* value
)
1765 GET_CURRENT_CONTEXT(ctx
);
1766 struct gl_shader_program
*shProg
=
1767 _mesa_lookup_shader_program_err(ctx
, program
,
1768 "glProgramUniformMatrix4x3dv");
1769 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1770 ctx
, shProg
, 4, 3, GLSL_TYPE_DOUBLE
);
1774 _mesa_Uniform1i64ARB(GLint location
, GLint64 v0
)
1776 GET_CURRENT_CONTEXT(ctx
);
1777 _mesa_uniform(location
, 1, &v0
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT64
, 1);
1781 _mesa_Uniform2i64ARB(GLint location
, GLint64 v0
, GLint64 v1
)
1783 GET_CURRENT_CONTEXT(ctx
);
1787 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT64
, 2);
1791 _mesa_Uniform3i64ARB(GLint location
, GLint64 v0
, GLint64 v1
, GLint64 v2
)
1793 GET_CURRENT_CONTEXT(ctx
);
1798 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT64
, 3);
1802 _mesa_Uniform4i64ARB(GLint location
, GLint64 v0
, GLint64 v1
, GLint64 v2
, GLint64 v3
)
1804 GET_CURRENT_CONTEXT(ctx
);
1810 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT64
, 4);
1814 _mesa_Uniform1i64vARB(GLint location
, GLsizei count
, const GLint64
*value
)
1816 GET_CURRENT_CONTEXT(ctx
);
1817 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT64
, 1);
1821 _mesa_Uniform2i64vARB(GLint location
, GLsizei count
, const GLint64
*value
)
1823 GET_CURRENT_CONTEXT(ctx
);
1824 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT64
, 2);
1828 _mesa_Uniform3i64vARB(GLint location
, GLsizei count
, const GLint64
*value
)
1830 GET_CURRENT_CONTEXT(ctx
);
1831 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT64
, 3);
1835 _mesa_Uniform4i64vARB(GLint location
, GLsizei count
, const GLint64
*value
)
1837 GET_CURRENT_CONTEXT(ctx
);
1838 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT64
, 4);
1842 _mesa_Uniform1ui64ARB(GLint location
, GLuint64 v0
)
1844 GET_CURRENT_CONTEXT(ctx
);
1845 _mesa_uniform(location
, 1, &v0
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT64
, 1);
1849 _mesa_Uniform2ui64ARB(GLint location
, GLuint64 v0
, GLuint64 v1
)
1851 GET_CURRENT_CONTEXT(ctx
);
1855 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT64
, 2);
1859 _mesa_Uniform3ui64ARB(GLint location
, GLuint64 v0
, GLuint64 v1
, GLuint64 v2
)
1861 GET_CURRENT_CONTEXT(ctx
);
1866 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT64
, 3);
1870 _mesa_Uniform4ui64ARB(GLint location
, GLuint64 v0
, GLuint64 v1
, GLuint64 v2
, GLuint64 v3
)
1872 GET_CURRENT_CONTEXT(ctx
);
1878 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT64
, 4);
1882 _mesa_Uniform1ui64vARB(GLint location
, GLsizei count
, const GLuint64
*value
)
1884 GET_CURRENT_CONTEXT(ctx
);
1885 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT64
, 1);
1889 _mesa_Uniform2ui64vARB(GLint location
, GLsizei count
, const GLuint64
*value
)
1891 GET_CURRENT_CONTEXT(ctx
);
1892 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT64
, 2);
1896 _mesa_Uniform3ui64vARB(GLint location
, GLsizei count
, const GLuint64
*value
)
1898 GET_CURRENT_CONTEXT(ctx
);
1899 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT64
, 3);
1903 _mesa_Uniform4ui64vARB(GLint location
, GLsizei count
, const GLuint64
*value
)
1905 GET_CURRENT_CONTEXT(ctx
);
1906 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT64
, 4);
1909 /* DSA entrypoints */
1911 _mesa_ProgramUniform1i64ARB(GLuint program
, GLint location
, GLint64 v0
)
1913 GET_CURRENT_CONTEXT(ctx
);
1914 struct gl_shader_program
*shProg
=
1915 _mesa_lookup_shader_program_err(ctx
, program
,
1916 "glProgramUniform1i64ARB");
1917 _mesa_uniform(location
, 1, &v0
, ctx
, shProg
, GLSL_TYPE_INT64
, 1);
1921 _mesa_ProgramUniform2i64ARB(GLuint program
, GLint location
, GLint64 v0
, GLint64 v1
)
1923 GET_CURRENT_CONTEXT(ctx
);
1924 struct gl_shader_program
*shProg
=
1925 _mesa_lookup_shader_program_err(ctx
, program
,
1926 "glProgramUniform2i64ARB");
1930 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_INT64
, 2);
1934 _mesa_ProgramUniform3i64ARB(GLuint program
, GLint location
, GLint64 v0
, GLint64 v1
, GLint64 v2
)
1936 GET_CURRENT_CONTEXT(ctx
);
1937 struct gl_shader_program
*shProg
=
1938 _mesa_lookup_shader_program_err(ctx
, program
,
1939 "glProgramUniform3i64ARB");
1944 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_INT64
, 3);
1948 _mesa_ProgramUniform4i64ARB(GLuint program
, GLint location
, GLint64 v0
, GLint64 v1
, GLint64 v2
, GLint64 v3
)
1950 GET_CURRENT_CONTEXT(ctx
);
1951 struct gl_shader_program
*shProg
=
1952 _mesa_lookup_shader_program_err(ctx
, program
,
1953 "glProgramUniform4i64ARB");
1959 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_INT64
, 4);
1963 _mesa_ProgramUniform1i64vARB(GLuint program
, GLint location
, GLsizei count
, const GLint64
*value
)
1965 GET_CURRENT_CONTEXT(ctx
);
1966 struct gl_shader_program
*shProg
=
1967 _mesa_lookup_shader_program_err(ctx
, program
,
1968 "glProgramUniform1i64vARB");
1969 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_INT64
, 1);
1973 _mesa_ProgramUniform2i64vARB(GLuint program
, GLint location
, GLsizei count
, const GLint64
*value
)
1975 GET_CURRENT_CONTEXT(ctx
);
1976 struct gl_shader_program
*shProg
=
1977 _mesa_lookup_shader_program_err(ctx
, program
,
1978 "glProgramUniform2i64vARB");
1979 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_INT64
, 2);
1983 _mesa_ProgramUniform3i64vARB(GLuint program
, GLint location
, GLsizei count
, const GLint64
*value
)
1985 GET_CURRENT_CONTEXT(ctx
);
1986 struct gl_shader_program
*shProg
=
1987 _mesa_lookup_shader_program_err(ctx
, program
,
1988 "glProgramUniform3i64vARB");
1989 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_INT64
, 3);
1993 _mesa_ProgramUniform4i64vARB(GLuint program
, GLint location
, GLsizei count
, const GLint64
*value
)
1995 GET_CURRENT_CONTEXT(ctx
);
1996 struct gl_shader_program
*shProg
=
1997 _mesa_lookup_shader_program_err(ctx
, program
,
1998 "glProgramUniform4i64vARB");
1999 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_INT64
, 4);
2003 _mesa_ProgramUniform1ui64ARB(GLuint program
, GLint location
, GLuint64 v0
)
2005 GET_CURRENT_CONTEXT(ctx
);
2006 struct gl_shader_program
*shProg
=
2007 _mesa_lookup_shader_program_err(ctx
, program
,
2008 "glProgramUniform1ui64ARB");
2009 _mesa_uniform(location
, 1, &v0
, ctx
, shProg
, GLSL_TYPE_UINT64
, 1);
2013 _mesa_ProgramUniform2ui64ARB(GLuint program
, GLint location
, GLuint64 v0
, GLuint64 v1
)
2015 GET_CURRENT_CONTEXT(ctx
);
2016 struct gl_shader_program
*shProg
=
2017 _mesa_lookup_shader_program_err(ctx
, program
,
2018 "glProgramUniform2ui64ARB");
2022 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_UINT64
, 2);
2026 _mesa_ProgramUniform3ui64ARB(GLuint program
, GLint location
, GLuint64 v0
, GLuint64 v1
, GLuint64 v2
)
2028 GET_CURRENT_CONTEXT(ctx
);
2029 struct gl_shader_program
*shProg
=
2030 _mesa_lookup_shader_program_err(ctx
, program
,
2031 "glProgramUniform3ui64ARB");
2036 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_UINT64
, 3);
2040 _mesa_ProgramUniform4ui64ARB(GLuint program
, GLint location
, GLuint64 v0
, GLuint64 v1
, GLuint64 v2
, GLuint64 v3
)
2042 GET_CURRENT_CONTEXT(ctx
);
2043 struct gl_shader_program
*shProg
=
2044 _mesa_lookup_shader_program_err(ctx
, program
,
2045 "glProgramUniform4ui64ARB");
2051 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_UINT64
, 4);
2055 _mesa_ProgramUniform1ui64vARB(GLuint program
, GLint location
, GLsizei count
, const GLuint64
*value
)
2057 GET_CURRENT_CONTEXT(ctx
);
2058 struct gl_shader_program
*shProg
=
2059 _mesa_lookup_shader_program_err(ctx
, program
,
2060 "glProgramUniform1ui64vARB");
2061 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_UINT64
, 1);
2065 _mesa_ProgramUniform2ui64vARB(GLuint program
, GLint location
, GLsizei count
, const GLuint64
*value
)
2067 GET_CURRENT_CONTEXT(ctx
);
2068 struct gl_shader_program
*shProg
=
2069 _mesa_lookup_shader_program_err(ctx
, program
,
2070 "glProgramUniform2ui64vARB");
2071 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_UINT64
, 2);
2075 _mesa_ProgramUniform3ui64vARB(GLuint program
, GLint location
, GLsizei count
, const GLuint64
*value
)
2077 GET_CURRENT_CONTEXT(ctx
);
2078 struct gl_shader_program
*shProg
=
2079 _mesa_lookup_shader_program_err(ctx
, program
,
2080 "glProgramUniform3ui64vARB");
2081 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_UINT64
, 3);
2085 _mesa_ProgramUniform4ui64vARB(GLuint program
, GLint location
, GLsizei count
, const GLuint64
*value
)
2087 GET_CURRENT_CONTEXT(ctx
);
2088 struct gl_shader_program
*shProg
=
2089 _mesa_lookup_shader_program_err(ctx
, program
,
2090 "glProgramUniform4ui64vARB");
2091 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_UINT64
, 4);