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 gl_shader_stage prog_stage
=
105 _mesa_program_enum_to_shader_stage(prog
->Target
);
106 MAYBE_UNUSED
struct gl_linked_shader
*shader
=
107 shProg
->_LinkedShaders
[prog_stage
];
112 memset(prog
->TexturesUsed
, 0, sizeof(prog
->TexturesUsed
));
115 s
= u_bit_scan(&mask
);
117 update_single_shader_texture_used(shProg
, prog
,
118 prog
->SamplerUnits
[s
],
119 prog
->sh
.SamplerTargets
[s
]);
122 if (unlikely(prog
->sh
.HasBoundBindlessSampler
)) {
123 /* Loop over bindless samplers bound to texture units.
125 for (s
= 0; s
< prog
->sh
.NumBindlessSamplers
; s
++) {
126 struct gl_bindless_sampler
*sampler
= &prog
->sh
.BindlessSamplers
[s
];
131 update_single_shader_texture_used(shProg
, prog
, sampler
->unit
,
138 * Connect a piece of driver storage with a part of a uniform
140 * \param uni The uniform with which the storage will be associated
141 * \param element_stride Byte-stride between array elements.
142 * \sa gl_uniform_driver_storage::element_stride.
143 * \param vector_stride Byte-stride between vectors (in a matrix).
144 * \sa gl_uniform_driver_storage::vector_stride.
145 * \param format Conversion from native format to driver format
146 * required by the driver.
147 * \param data Location to dump the data.
150 _mesa_uniform_attach_driver_storage(struct gl_uniform_storage
*uni
,
151 unsigned element_stride
,
152 unsigned vector_stride
,
153 enum gl_uniform_driver_format format
,
156 uni
->driver_storage
=
157 realloc(uni
->driver_storage
,
158 sizeof(struct gl_uniform_driver_storage
)
159 * (uni
->num_driver_storage
+ 1));
161 uni
->driver_storage
[uni
->num_driver_storage
].element_stride
= element_stride
;
162 uni
->driver_storage
[uni
->num_driver_storage
].vector_stride
= vector_stride
;
163 uni
->driver_storage
[uni
->num_driver_storage
].format
= format
;
164 uni
->driver_storage
[uni
->num_driver_storage
].data
= data
;
166 uni
->num_driver_storage
++;
170 * Sever all connections with all pieces of driver storage for all uniforms
173 * This function does \b not release any of the \c data pointers
174 * previously passed in to \c _mesa_uniform_attach_driver_stoarge.
177 _mesa_uniform_detach_all_driver_storage(struct gl_uniform_storage
*uni
)
179 free(uni
->driver_storage
);
180 uni
->driver_storage
= NULL
;
181 uni
->num_driver_storage
= 0;
185 _mesa_Uniform1f(GLint location
, GLfloat v0
)
187 GET_CURRENT_CONTEXT(ctx
);
188 _mesa_uniform(location
, 1, &v0
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_FLOAT
, 1);
192 _mesa_Uniform2f(GLint location
, GLfloat v0
, GLfloat v1
)
194 GET_CURRENT_CONTEXT(ctx
);
198 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_FLOAT
, 2);
202 _mesa_Uniform3f(GLint location
, GLfloat v0
, GLfloat v1
, GLfloat v2
)
204 GET_CURRENT_CONTEXT(ctx
);
209 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_FLOAT
, 3);
213 _mesa_Uniform4f(GLint location
, GLfloat v0
, GLfloat v1
, GLfloat v2
,
216 GET_CURRENT_CONTEXT(ctx
);
222 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_FLOAT
, 4);
226 _mesa_Uniform1i(GLint location
, GLint v0
)
228 GET_CURRENT_CONTEXT(ctx
);
229 _mesa_uniform(location
, 1, &v0
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT
, 1);
233 _mesa_Uniform2i(GLint location
, GLint v0
, GLint v1
)
235 GET_CURRENT_CONTEXT(ctx
);
239 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT
, 2);
243 _mesa_Uniform3i(GLint location
, GLint v0
, GLint v1
, GLint v2
)
245 GET_CURRENT_CONTEXT(ctx
);
250 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT
, 3);
254 _mesa_Uniform4i(GLint location
, GLint v0
, GLint v1
, GLint v2
, GLint v3
)
256 GET_CURRENT_CONTEXT(ctx
);
262 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT
, 4);
266 _mesa_Uniform1fv(GLint location
, GLsizei count
, const GLfloat
* value
)
268 GET_CURRENT_CONTEXT(ctx
);
269 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_FLOAT
, 1);
273 _mesa_Uniform2fv(GLint location
, GLsizei count
, const GLfloat
* value
)
275 GET_CURRENT_CONTEXT(ctx
);
276 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_FLOAT
, 2);
280 _mesa_Uniform3fv(GLint location
, GLsizei count
, const GLfloat
* value
)
282 GET_CURRENT_CONTEXT(ctx
);
283 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_FLOAT
, 3);
287 _mesa_Uniform4fv(GLint location
, GLsizei count
, const GLfloat
* value
)
289 GET_CURRENT_CONTEXT(ctx
);
290 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_FLOAT
, 4);
294 _mesa_Uniform1iv(GLint location
, GLsizei count
, const GLint
* value
)
296 GET_CURRENT_CONTEXT(ctx
);
297 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT
, 1);
301 _mesa_Uniform2iv(GLint location
, GLsizei count
, const GLint
* value
)
303 GET_CURRENT_CONTEXT(ctx
);
304 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT
, 2);
308 _mesa_Uniform3iv(GLint location
, GLsizei count
, const GLint
* value
)
310 GET_CURRENT_CONTEXT(ctx
);
311 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT
, 3);
315 _mesa_Uniform4iv(GLint location
, GLsizei count
, const GLint
* value
)
317 GET_CURRENT_CONTEXT(ctx
);
318 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT
, 4);
322 _mesa_UniformHandleui64ARB(GLint location
, GLuint64 value
)
324 GET_CURRENT_CONTEXT(ctx
);
325 _mesa_uniform_handle(location
, 1, &value
, ctx
, ctx
->_Shader
->ActiveProgram
);
329 _mesa_UniformHandleui64vARB(GLint location
, GLsizei count
,
330 const GLuint64
*value
)
332 GET_CURRENT_CONTEXT(ctx
);
333 _mesa_uniform_handle(location
, count
, value
, ctx
,
334 ctx
->_Shader
->ActiveProgram
);
338 /** Same as above with direct state access **/
340 _mesa_ProgramUniform1f(GLuint program
, GLint location
, GLfloat v0
)
342 GET_CURRENT_CONTEXT(ctx
);
343 struct gl_shader_program
*shProg
=
344 _mesa_lookup_shader_program_err(ctx
, program
,
345 "glProgramUniform1f");
346 _mesa_uniform(location
, 1, &v0
, ctx
, shProg
, GLSL_TYPE_FLOAT
, 1);
350 _mesa_ProgramUniform2f(GLuint program
, GLint location
, GLfloat v0
, GLfloat v1
)
352 GET_CURRENT_CONTEXT(ctx
);
354 struct gl_shader_program
*shProg
;
357 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform2f");
358 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_FLOAT
, 2);
362 _mesa_ProgramUniform3f(GLuint program
, GLint location
, GLfloat v0
, GLfloat v1
,
365 GET_CURRENT_CONTEXT(ctx
);
367 struct gl_shader_program
*shProg
;
371 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform3f");
372 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_FLOAT
, 3);
376 _mesa_ProgramUniform4f(GLuint program
, GLint location
, GLfloat v0
, GLfloat v1
,
377 GLfloat v2
, GLfloat v3
)
379 GET_CURRENT_CONTEXT(ctx
);
381 struct gl_shader_program
*shProg
;
386 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform4f");
387 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_FLOAT
, 4);
391 _mesa_ProgramUniform1i(GLuint program
, GLint location
, GLint v0
)
393 GET_CURRENT_CONTEXT(ctx
);
394 struct gl_shader_program
*shProg
=
395 _mesa_lookup_shader_program_err(ctx
, program
,
396 "glProgramUniform1i");
397 _mesa_uniform(location
, 1, &v0
, ctx
, shProg
, GLSL_TYPE_INT
, 1);
401 _mesa_ProgramUniform2i(GLuint program
, GLint location
, GLint v0
, GLint v1
)
403 GET_CURRENT_CONTEXT(ctx
);
405 struct gl_shader_program
*shProg
;
408 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform2i");
409 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_INT
, 2);
413 _mesa_ProgramUniform3i(GLuint program
, GLint location
, GLint v0
, GLint v1
,
416 GET_CURRENT_CONTEXT(ctx
);
418 struct gl_shader_program
*shProg
;
422 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform3i");
423 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_INT
, 3);
427 _mesa_ProgramUniform4i(GLuint program
, GLint location
, GLint v0
, GLint v1
,
430 GET_CURRENT_CONTEXT(ctx
);
432 struct gl_shader_program
*shProg
;
437 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform4i");
438 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_INT
, 4);
442 _mesa_ProgramUniform1fv(GLuint program
, GLint location
, GLsizei count
,
443 const GLfloat
* value
)
445 GET_CURRENT_CONTEXT(ctx
);
446 struct gl_shader_program
*shProg
=
447 _mesa_lookup_shader_program_err(ctx
, program
,
448 "glProgramUniform1fv");
449 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_FLOAT
, 1);
453 _mesa_ProgramUniform2fv(GLuint program
, GLint location
, GLsizei count
,
454 const GLfloat
* value
)
456 GET_CURRENT_CONTEXT(ctx
);
457 struct gl_shader_program
*shProg
=
458 _mesa_lookup_shader_program_err(ctx
, program
,
459 "glProgramUniform2fv");
460 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_FLOAT
, 2);
464 _mesa_ProgramUniform3fv(GLuint program
, GLint location
, GLsizei count
,
465 const GLfloat
* value
)
467 GET_CURRENT_CONTEXT(ctx
);
468 struct gl_shader_program
*shProg
=
469 _mesa_lookup_shader_program_err(ctx
, program
,
470 "glProgramUniform3fv");
471 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_FLOAT
, 3);
475 _mesa_ProgramUniform4fv(GLuint program
, GLint location
, GLsizei count
,
476 const GLfloat
* value
)
478 GET_CURRENT_CONTEXT(ctx
);
479 struct gl_shader_program
*shProg
=
480 _mesa_lookup_shader_program_err(ctx
, program
,
481 "glProgramUniform4fv");
482 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_FLOAT
, 4);
486 _mesa_ProgramUniform1iv(GLuint program
, GLint location
, GLsizei count
,
489 GET_CURRENT_CONTEXT(ctx
);
490 struct gl_shader_program
*shProg
=
491 _mesa_lookup_shader_program_err(ctx
, program
,
492 "glProgramUniform1iv");
493 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_INT
, 1);
497 _mesa_ProgramUniform2iv(GLuint program
, GLint location
, GLsizei count
,
500 GET_CURRENT_CONTEXT(ctx
);
501 struct gl_shader_program
*shProg
=
502 _mesa_lookup_shader_program_err(ctx
, program
,
503 "glProgramUniform2iv");
504 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_INT
, 2);
508 _mesa_ProgramUniform3iv(GLuint program
, GLint location
, GLsizei count
,
511 GET_CURRENT_CONTEXT(ctx
);
512 struct gl_shader_program
*shProg
=
513 _mesa_lookup_shader_program_err(ctx
, program
,
514 "glProgramUniform3iv");
515 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_INT
, 3);
519 _mesa_ProgramUniform4iv(GLuint program
, GLint location
, GLsizei count
,
522 GET_CURRENT_CONTEXT(ctx
);
523 struct gl_shader_program
*shProg
=
524 _mesa_lookup_shader_program_err(ctx
, program
,
525 "glProgramUniform4iv");
526 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_INT
, 4);
530 _mesa_ProgramUniformHandleui64ARB(GLuint program
, GLint location
,
533 GET_CURRENT_CONTEXT(ctx
);
534 struct gl_shader_program
*shProg
=
535 _mesa_lookup_shader_program_err(ctx
, program
,
536 "glProgramUniformHandleui64ARB");
537 _mesa_uniform_handle(location
, 1, &value
, ctx
, shProg
);
541 _mesa_ProgramUniformHandleui64vARB(GLuint program
, GLint location
,
542 GLsizei count
, const GLuint64
*values
)
544 GET_CURRENT_CONTEXT(ctx
);
545 struct gl_shader_program
*shProg
=
546 _mesa_lookup_shader_program_err(ctx
, program
,
547 "glProgramUniformHandleui64vARB");
548 _mesa_uniform_handle(location
, count
, values
, ctx
, shProg
);
552 /** OpenGL 3.0 GLuint-valued functions **/
554 _mesa_Uniform1ui(GLint location
, GLuint v0
)
556 GET_CURRENT_CONTEXT(ctx
);
557 _mesa_uniform(location
, 1, &v0
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT
, 1);
561 _mesa_Uniform2ui(GLint location
, GLuint v0
, GLuint v1
)
563 GET_CURRENT_CONTEXT(ctx
);
567 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT
, 2);
571 _mesa_Uniform3ui(GLint location
, GLuint v0
, GLuint v1
, GLuint v2
)
573 GET_CURRENT_CONTEXT(ctx
);
578 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT
, 3);
582 _mesa_Uniform4ui(GLint location
, GLuint v0
, GLuint v1
, GLuint v2
, GLuint v3
)
584 GET_CURRENT_CONTEXT(ctx
);
590 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT
, 4);
594 _mesa_Uniform1uiv(GLint location
, GLsizei count
, const GLuint
*value
)
596 GET_CURRENT_CONTEXT(ctx
);
597 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT
, 1);
601 _mesa_Uniform2uiv(GLint location
, GLsizei count
, const GLuint
*value
)
603 GET_CURRENT_CONTEXT(ctx
);
604 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT
, 2);
608 _mesa_Uniform3uiv(GLint location
, GLsizei count
, const GLuint
*value
)
610 GET_CURRENT_CONTEXT(ctx
);
611 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT
, 3);
615 _mesa_Uniform4uiv(GLint location
, GLsizei count
, const GLuint
*value
)
617 GET_CURRENT_CONTEXT(ctx
);
618 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT
, 4);
624 _mesa_UniformMatrix2fv(GLint location
, GLsizei count
, GLboolean transpose
,
625 const GLfloat
* value
)
627 GET_CURRENT_CONTEXT(ctx
);
628 _mesa_uniform_matrix(location
, count
, transpose
, value
,
629 ctx
, ctx
->_Shader
->ActiveProgram
, 2, 2, GLSL_TYPE_FLOAT
);
633 _mesa_UniformMatrix3fv(GLint location
, GLsizei count
, GLboolean transpose
,
634 const GLfloat
* value
)
636 GET_CURRENT_CONTEXT(ctx
);
637 _mesa_uniform_matrix(location
, count
, transpose
, value
,
638 ctx
, ctx
->_Shader
->ActiveProgram
, 3, 3, GLSL_TYPE_FLOAT
);
642 _mesa_UniformMatrix4fv(GLint location
, GLsizei count
, GLboolean transpose
,
643 const GLfloat
* value
)
645 GET_CURRENT_CONTEXT(ctx
);
646 _mesa_uniform_matrix(location
, count
, transpose
, value
,
647 ctx
, ctx
->_Shader
->ActiveProgram
, 4, 4, GLSL_TYPE_FLOAT
);
650 /** Same as above with direct state access **/
653 _mesa_ProgramUniform1ui(GLuint program
, GLint location
, GLuint v0
)
655 GET_CURRENT_CONTEXT(ctx
);
656 struct gl_shader_program
*shProg
=
657 _mesa_lookup_shader_program_err(ctx
, program
,
658 "glProgramUniform1ui");
659 _mesa_uniform(location
, 1, &v0
, ctx
, shProg
, GLSL_TYPE_UINT
, 1);
663 _mesa_ProgramUniform2ui(GLuint program
, GLint location
, GLuint v0
, GLuint v1
)
665 GET_CURRENT_CONTEXT(ctx
);
667 struct gl_shader_program
*shProg
;
670 shProg
= _mesa_lookup_shader_program_err(ctx
, program
,
671 "glProgramUniform2ui");
672 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_UINT
, 2);
676 _mesa_ProgramUniform3ui(GLuint program
, GLint location
, GLuint v0
, GLuint v1
,
679 GET_CURRENT_CONTEXT(ctx
);
681 struct gl_shader_program
*shProg
;
685 shProg
= _mesa_lookup_shader_program_err(ctx
, program
,
686 "glProgramUniform3ui");
687 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_UINT
, 3);
691 _mesa_ProgramUniform4ui(GLuint program
, GLint location
, GLuint v0
, GLuint v1
,
692 GLuint v2
, GLuint v3
)
694 GET_CURRENT_CONTEXT(ctx
);
696 struct gl_shader_program
*shProg
;
701 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform4ui");
702 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_UINT
, 4);
706 _mesa_ProgramUniform1uiv(GLuint program
, GLint location
, GLsizei count
,
709 GET_CURRENT_CONTEXT(ctx
);
710 struct gl_shader_program
*shProg
=
711 _mesa_lookup_shader_program_err(ctx
, program
,
712 "glProgramUniform1uiv");
713 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_UINT
, 1);
717 _mesa_ProgramUniform2uiv(GLuint program
, GLint location
, GLsizei count
,
720 GET_CURRENT_CONTEXT(ctx
);
721 struct gl_shader_program
*shProg
=
722 _mesa_lookup_shader_program_err(ctx
, program
,
723 "glProgramUniform2uiv");
724 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_UINT
, 2);
728 _mesa_ProgramUniform3uiv(GLuint program
, GLint location
, GLsizei count
,
731 GET_CURRENT_CONTEXT(ctx
);
732 struct gl_shader_program
*shProg
=
733 _mesa_lookup_shader_program_err(ctx
, program
,
734 "glProgramUniform3uiv");
735 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_UINT
, 3);
739 _mesa_ProgramUniform4uiv(GLuint program
, GLint location
, GLsizei count
,
742 GET_CURRENT_CONTEXT(ctx
);
743 struct gl_shader_program
*shProg
=
744 _mesa_lookup_shader_program_err(ctx
, program
,
745 "glProgramUniform4uiv");
746 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_UINT
, 4);
752 _mesa_ProgramUniformMatrix2fv(GLuint program
, GLint location
, GLsizei count
,
753 GLboolean transpose
, const GLfloat
* value
)
755 GET_CURRENT_CONTEXT(ctx
);
756 struct gl_shader_program
*shProg
=
757 _mesa_lookup_shader_program_err(ctx
, program
,
758 "glProgramUniformMatrix2fv");
759 _mesa_uniform_matrix(location
, count
, transpose
, value
, ctx
, shProg
, 2, 2, GLSL_TYPE_FLOAT
);
763 _mesa_ProgramUniformMatrix3fv(GLuint program
, GLint location
, GLsizei count
,
764 GLboolean transpose
, const GLfloat
* value
)
766 GET_CURRENT_CONTEXT(ctx
);
767 struct gl_shader_program
*shProg
=
768 _mesa_lookup_shader_program_err(ctx
, program
,
769 "glProgramUniformMatrix3fv");
770 _mesa_uniform_matrix(location
, count
, transpose
, value
, ctx
, shProg
, 3, 3, GLSL_TYPE_FLOAT
);
774 _mesa_ProgramUniformMatrix4fv(GLuint program
, GLint location
, GLsizei count
,
775 GLboolean transpose
, const GLfloat
* value
)
777 GET_CURRENT_CONTEXT(ctx
);
778 struct gl_shader_program
*shProg
=
779 _mesa_lookup_shader_program_err(ctx
, program
,
780 "glProgramUniformMatrix4fv");
781 _mesa_uniform_matrix(location
, count
, transpose
, value
, ctx
, shProg
, 4, 4, GLSL_TYPE_FLOAT
);
786 * Non-square UniformMatrix are OpenGL 2.1
789 _mesa_UniformMatrix2x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
790 const GLfloat
*value
)
792 GET_CURRENT_CONTEXT(ctx
);
793 _mesa_uniform_matrix(location
, count
, transpose
, value
,
794 ctx
, ctx
->_Shader
->ActiveProgram
, 2, 3, GLSL_TYPE_FLOAT
);
798 _mesa_UniformMatrix3x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
799 const GLfloat
*value
)
801 GET_CURRENT_CONTEXT(ctx
);
802 _mesa_uniform_matrix(location
, count
, transpose
, value
,
803 ctx
, ctx
->_Shader
->ActiveProgram
, 3, 2, GLSL_TYPE_FLOAT
);
807 _mesa_UniformMatrix2x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
808 const GLfloat
*value
)
810 GET_CURRENT_CONTEXT(ctx
);
811 _mesa_uniform_matrix(location
, count
, transpose
, value
,
812 ctx
, ctx
->_Shader
->ActiveProgram
, 2, 4, GLSL_TYPE_FLOAT
);
816 _mesa_UniformMatrix4x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
817 const GLfloat
*value
)
819 GET_CURRENT_CONTEXT(ctx
);
820 _mesa_uniform_matrix(location
, count
, transpose
, value
,
821 ctx
, ctx
->_Shader
->ActiveProgram
, 4, 2, GLSL_TYPE_FLOAT
);
825 _mesa_UniformMatrix3x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
826 const GLfloat
*value
)
828 GET_CURRENT_CONTEXT(ctx
);
829 _mesa_uniform_matrix(location
, count
, transpose
, value
,
830 ctx
, ctx
->_Shader
->ActiveProgram
, 3, 4, GLSL_TYPE_FLOAT
);
834 _mesa_UniformMatrix4x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
835 const GLfloat
*value
)
837 GET_CURRENT_CONTEXT(ctx
);
838 _mesa_uniform_matrix(location
, count
, transpose
, value
,
839 ctx
, ctx
->_Shader
->ActiveProgram
, 4, 3, GLSL_TYPE_FLOAT
);
842 /** Same as above with direct state access **/
845 _mesa_ProgramUniformMatrix2x3fv(GLuint program
, GLint location
, GLsizei count
,
846 GLboolean transpose
, const GLfloat
* value
)
848 GET_CURRENT_CONTEXT(ctx
);
849 struct gl_shader_program
*shProg
=
850 _mesa_lookup_shader_program_err(ctx
, program
,
851 "glProgramUniformMatrix2x3fv");
852 _mesa_uniform_matrix(location
, count
, transpose
, value
, ctx
, shProg
, 2, 3, GLSL_TYPE_FLOAT
);
856 _mesa_ProgramUniformMatrix3x2fv(GLuint program
, GLint location
, GLsizei count
,
857 GLboolean transpose
, const GLfloat
* value
)
859 GET_CURRENT_CONTEXT(ctx
);
860 struct gl_shader_program
*shProg
=
861 _mesa_lookup_shader_program_err(ctx
, program
,
862 "glProgramUniformMatrix3x2fv");
863 _mesa_uniform_matrix(location
, count
, transpose
, value
, ctx
, shProg
, 3, 2, GLSL_TYPE_FLOAT
);
867 _mesa_ProgramUniformMatrix2x4fv(GLuint program
, GLint location
, GLsizei count
,
868 GLboolean transpose
, const GLfloat
* value
)
870 GET_CURRENT_CONTEXT(ctx
);
871 struct gl_shader_program
*shProg
=
872 _mesa_lookup_shader_program_err(ctx
, program
,
873 "glProgramUniformMatrix2x4fv");
874 _mesa_uniform_matrix(location
, count
, transpose
, value
, ctx
, shProg
, 2, 4, GLSL_TYPE_FLOAT
);
878 _mesa_ProgramUniformMatrix4x2fv(GLuint program
, GLint location
, GLsizei count
,
879 GLboolean transpose
, const GLfloat
* value
)
881 GET_CURRENT_CONTEXT(ctx
);
882 struct gl_shader_program
*shProg
=
883 _mesa_lookup_shader_program_err(ctx
, program
,
884 "glProgramUniformMatrix4x2fv");
885 _mesa_uniform_matrix(location
, count
, transpose
, value
, ctx
, shProg
, 4, 2, GLSL_TYPE_FLOAT
);
889 _mesa_ProgramUniformMatrix3x4fv(GLuint program
, GLint location
, GLsizei count
,
890 GLboolean transpose
, const GLfloat
* value
)
892 GET_CURRENT_CONTEXT(ctx
);
893 struct gl_shader_program
*shProg
=
894 _mesa_lookup_shader_program_err(ctx
, program
,
895 "glProgramUniformMatrix3x4fv");
896 _mesa_uniform_matrix(location
, count
, transpose
, value
, ctx
, shProg
, 3, 4, GLSL_TYPE_FLOAT
);
900 _mesa_ProgramUniformMatrix4x3fv(GLuint program
, GLint location
, GLsizei count
,
901 GLboolean transpose
, const GLfloat
* value
)
903 GET_CURRENT_CONTEXT(ctx
);
904 struct gl_shader_program
*shProg
=
905 _mesa_lookup_shader_program_err(ctx
, program
,
906 "glProgramUniformMatrix4x3fv");
907 _mesa_uniform_matrix(location
, count
, transpose
, value
, ctx
, shProg
, 4, 3, GLSL_TYPE_FLOAT
);
912 _mesa_GetnUniformfvARB(GLuint program
, GLint location
,
913 GLsizei bufSize
, GLfloat
*params
)
915 GET_CURRENT_CONTEXT(ctx
);
916 _mesa_get_uniform(ctx
, program
, location
, bufSize
, GLSL_TYPE_FLOAT
, params
);
920 _mesa_GetUniformfv(GLuint program
, GLint location
, GLfloat
*params
)
922 _mesa_GetnUniformfvARB(program
, location
, INT_MAX
, params
);
927 _mesa_GetnUniformivARB(GLuint program
, GLint location
,
928 GLsizei bufSize
, GLint
*params
)
930 GET_CURRENT_CONTEXT(ctx
);
931 _mesa_get_uniform(ctx
, program
, location
, bufSize
, GLSL_TYPE_INT
, params
);
935 _mesa_GetUniformiv(GLuint program
, GLint location
, GLint
*params
)
937 _mesa_GetnUniformivARB(program
, location
, INT_MAX
, params
);
943 _mesa_GetnUniformuivARB(GLuint program
, GLint location
,
944 GLsizei bufSize
, GLuint
*params
)
946 GET_CURRENT_CONTEXT(ctx
);
947 _mesa_get_uniform(ctx
, program
, location
, bufSize
, GLSL_TYPE_UINT
, params
);
951 _mesa_GetUniformuiv(GLuint program
, GLint location
, GLuint
*params
)
953 _mesa_GetnUniformuivARB(program
, location
, INT_MAX
, params
);
959 _mesa_GetnUniformdvARB(GLuint program
, GLint location
,
960 GLsizei bufSize
, GLdouble
*params
)
962 GET_CURRENT_CONTEXT(ctx
);
964 _mesa_get_uniform(ctx
, program
, location
, bufSize
, GLSL_TYPE_DOUBLE
, params
);
968 _mesa_GetUniformdv(GLuint program
, GLint location
, GLdouble
*params
)
970 _mesa_GetnUniformdvARB(program
, location
, INT_MAX
, params
);
974 _mesa_GetnUniformi64vARB(GLuint program
, GLint location
,
975 GLsizei bufSize
, GLint64
*params
)
977 GET_CURRENT_CONTEXT(ctx
);
978 _mesa_get_uniform(ctx
, program
, location
, bufSize
, GLSL_TYPE_INT64
, params
);
981 _mesa_GetUniformi64vARB(GLuint program
, GLint location
, GLint64
*params
)
983 _mesa_GetnUniformi64vARB(program
, location
, INT_MAX
, params
);
987 _mesa_GetnUniformui64vARB(GLuint program
, GLint location
,
988 GLsizei bufSize
, GLuint64
*params
)
990 GET_CURRENT_CONTEXT(ctx
);
991 _mesa_get_uniform(ctx
, program
, location
, bufSize
, GLSL_TYPE_UINT64
, params
);
995 _mesa_GetUniformui64vARB(GLuint program
, GLint location
, GLuint64
*params
)
997 _mesa_GetnUniformui64vARB(program
, location
, INT_MAX
, params
);
1002 _mesa_GetUniformLocation(GLuint programObj
, const GLcharARB
*name
)
1004 struct gl_shader_program
*shProg
;
1006 GET_CURRENT_CONTEXT(ctx
);
1008 shProg
= _mesa_lookup_shader_program_err(ctx
, programObj
,
1009 "glGetUniformLocation");
1013 /* Page 80 (page 94 of the PDF) of the OpenGL 2.1 spec says:
1015 * "If program has not been successfully linked, the error
1016 * INVALID_OPERATION is generated."
1018 if (shProg
->data
->LinkStatus
== LINKING_FAILURE
) {
1019 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1020 "glGetUniformLocation(program not linked)");
1024 return _mesa_program_resource_location(shProg
, GL_UNIFORM
, name
);
1028 _mesa_GetUniformLocation_no_error(GLuint programObj
, const GLcharARB
*name
)
1030 GET_CURRENT_CONTEXT(ctx
);
1032 struct gl_shader_program
*shProg
=
1033 _mesa_lookup_shader_program(ctx
, programObj
);
1035 return _mesa_program_resource_location(shProg
, GL_UNIFORM
, name
);
1039 _mesa_GetUniformBlockIndex(GLuint program
,
1040 const GLchar
*uniformBlockName
)
1042 GET_CURRENT_CONTEXT(ctx
);
1043 struct gl_shader_program
*shProg
;
1045 if (!ctx
->Extensions
.ARB_uniform_buffer_object
) {
1046 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glGetUniformBlockIndex");
1047 return GL_INVALID_INDEX
;
1050 shProg
= _mesa_lookup_shader_program_err(ctx
, program
,
1051 "glGetUniformBlockIndex");
1053 return GL_INVALID_INDEX
;
1055 struct gl_program_resource
*res
=
1056 _mesa_program_resource_find_name(shProg
, GL_UNIFORM_BLOCK
,
1057 uniformBlockName
, NULL
);
1059 return GL_INVALID_INDEX
;
1061 return _mesa_program_resource_index(shProg
, res
);
1065 _mesa_GetUniformIndices(GLuint program
,
1066 GLsizei uniformCount
,
1067 const GLchar
* const *uniformNames
,
1068 GLuint
*uniformIndices
)
1070 GET_CURRENT_CONTEXT(ctx
);
1072 struct gl_shader_program
*shProg
;
1074 if (!ctx
->Extensions
.ARB_uniform_buffer_object
) {
1075 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glGetUniformIndices");
1079 shProg
= _mesa_lookup_shader_program_err(ctx
, program
,
1080 "glGetUniformIndices");
1084 if (uniformCount
< 0) {
1085 _mesa_error(ctx
, GL_INVALID_VALUE
,
1086 "glGetUniformIndices(uniformCount < 0)");
1090 for (i
= 0; i
< uniformCount
; i
++) {
1091 struct gl_program_resource
*res
=
1092 _mesa_program_resource_find_name(shProg
, GL_UNIFORM
, uniformNames
[i
],
1094 uniformIndices
[i
] = _mesa_program_resource_index(shProg
, res
);
1099 uniform_block_binding(struct gl_context
*ctx
, struct gl_shader_program
*shProg
,
1100 GLuint uniformBlockIndex
, GLuint uniformBlockBinding
)
1102 if (shProg
->data
->UniformBlocks
[uniformBlockIndex
].Binding
!=
1103 uniformBlockBinding
) {
1105 FLUSH_VERTICES(ctx
, 0);
1106 ctx
->NewDriverState
|= ctx
->DriverFlags
.NewUniformBuffer
;
1108 shProg
->data
->UniformBlocks
[uniformBlockIndex
].Binding
=
1109 uniformBlockBinding
;
1114 _mesa_UniformBlockBinding_no_error(GLuint program
, GLuint uniformBlockIndex
,
1115 GLuint uniformBlockBinding
)
1117 GET_CURRENT_CONTEXT(ctx
);
1119 struct gl_shader_program
*shProg
= _mesa_lookup_shader_program(ctx
, program
);
1120 uniform_block_binding(ctx
, shProg
, uniformBlockIndex
, uniformBlockBinding
);
1124 _mesa_UniformBlockBinding(GLuint program
,
1125 GLuint uniformBlockIndex
,
1126 GLuint uniformBlockBinding
)
1128 GET_CURRENT_CONTEXT(ctx
);
1129 struct gl_shader_program
*shProg
;
1131 if (!ctx
->Extensions
.ARB_uniform_buffer_object
) {
1132 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glUniformBlockBinding");
1136 shProg
= _mesa_lookup_shader_program_err(ctx
, program
,
1137 "glUniformBlockBinding");
1141 if (uniformBlockIndex
>= shProg
->data
->NumUniformBlocks
) {
1142 _mesa_error(ctx
, GL_INVALID_VALUE
,
1143 "glUniformBlockBinding(block index %u >= %u)",
1144 uniformBlockIndex
, shProg
->data
->NumUniformBlocks
);
1148 if (uniformBlockBinding
>= ctx
->Const
.MaxUniformBufferBindings
) {
1149 _mesa_error(ctx
, GL_INVALID_VALUE
,
1150 "glUniformBlockBinding(block binding %u >= %u)",
1151 uniformBlockBinding
, ctx
->Const
.MaxUniformBufferBindings
);
1155 uniform_block_binding(ctx
, shProg
, uniformBlockIndex
, uniformBlockBinding
);
1159 shader_storage_block_binding(struct gl_context
*ctx
,
1160 struct gl_shader_program
*shProg
,
1161 GLuint shaderStorageBlockIndex
,
1162 GLuint shaderStorageBlockBinding
)
1164 if (shProg
->data
->ShaderStorageBlocks
[shaderStorageBlockIndex
].Binding
!=
1165 shaderStorageBlockBinding
) {
1167 FLUSH_VERTICES(ctx
, 0);
1168 ctx
->NewDriverState
|= ctx
->DriverFlags
.NewShaderStorageBuffer
;
1170 shProg
->data
->ShaderStorageBlocks
[shaderStorageBlockIndex
].Binding
=
1171 shaderStorageBlockBinding
;
1176 _mesa_ShaderStorageBlockBinding_no_error(GLuint program
,
1177 GLuint shaderStorageBlockIndex
,
1178 GLuint shaderStorageBlockBinding
)
1180 GET_CURRENT_CONTEXT(ctx
);
1182 struct gl_shader_program
*shProg
= _mesa_lookup_shader_program(ctx
, program
);
1183 shader_storage_block_binding(ctx
, shProg
, shaderStorageBlockIndex
,
1184 shaderStorageBlockBinding
);
1188 _mesa_ShaderStorageBlockBinding(GLuint program
,
1189 GLuint shaderStorageBlockIndex
,
1190 GLuint shaderStorageBlockBinding
)
1192 GET_CURRENT_CONTEXT(ctx
);
1193 struct gl_shader_program
*shProg
;
1195 if (!ctx
->Extensions
.ARB_shader_storage_buffer_object
) {
1196 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glShaderStorageBlockBinding");
1200 shProg
= _mesa_lookup_shader_program_err(ctx
, program
,
1201 "glShaderStorageBlockBinding");
1205 if (shaderStorageBlockIndex
>= shProg
->data
->NumShaderStorageBlocks
) {
1206 _mesa_error(ctx
, GL_INVALID_VALUE
,
1207 "glShaderStorageBlockBinding(block index %u >= %u)",
1208 shaderStorageBlockIndex
,
1209 shProg
->data
->NumShaderStorageBlocks
);
1213 if (shaderStorageBlockBinding
>= ctx
->Const
.MaxShaderStorageBufferBindings
) {
1214 _mesa_error(ctx
, GL_INVALID_VALUE
,
1215 "glShaderStorageBlockBinding(block binding %u >= %u)",
1216 shaderStorageBlockBinding
,
1217 ctx
->Const
.MaxShaderStorageBufferBindings
);
1221 shader_storage_block_binding(ctx
, shProg
, shaderStorageBlockIndex
,
1222 shaderStorageBlockBinding
);
1226 * Generic program resource property query.
1229 mesa_bufferiv(struct gl_shader_program
*shProg
, GLenum type
,
1230 GLuint index
, GLenum pname
, GLint
*params
, const char *caller
)
1232 GET_CURRENT_CONTEXT(ctx
);
1233 struct gl_program_resource
*res
=
1234 _mesa_program_resource_find_index(shProg
, type
, index
);
1237 _mesa_error(ctx
, GL_INVALID_VALUE
, "%s(bufferindex %d)", caller
, index
);
1242 case GL_UNIFORM_BLOCK_BINDING
:
1243 case GL_ATOMIC_COUNTER_BUFFER_BINDING
:
1244 _mesa_program_resource_prop(shProg
, res
, index
, GL_BUFFER_BINDING
,
1247 case GL_UNIFORM_BLOCK_DATA_SIZE
:
1248 case GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE
:
1249 _mesa_program_resource_prop(shProg
, res
, index
, GL_BUFFER_DATA_SIZE
,
1252 case GL_UNIFORM_BLOCK_NAME_LENGTH
:
1253 _mesa_program_resource_prop(shProg
, res
, index
, GL_NAME_LENGTH
,
1256 case GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS
:
1257 case GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS
:
1258 _mesa_program_resource_prop(shProg
, res
, index
, GL_NUM_ACTIVE_VARIABLES
,
1261 case GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES
:
1262 case GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES
:
1263 _mesa_program_resource_prop(shProg
, res
, index
, GL_ACTIVE_VARIABLES
,
1266 case GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER
:
1267 case GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER
:
1268 _mesa_program_resource_prop(shProg
, res
, index
,
1269 GL_REFERENCED_BY_VERTEX_SHADER
, params
,
1273 case GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER
:
1274 case GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER
:
1275 _mesa_program_resource_prop(shProg
, res
, index
,
1276 GL_REFERENCED_BY_TESS_CONTROL_SHADER
, params
,
1280 case GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER
:
1281 case GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER
:
1282 _mesa_program_resource_prop(shProg
, res
, index
,
1283 GL_REFERENCED_BY_TESS_EVALUATION_SHADER
, params
,
1287 case GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER
:
1288 case GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER
:
1289 _mesa_program_resource_prop(shProg
, res
, index
,
1290 GL_REFERENCED_BY_GEOMETRY_SHADER
, params
,
1293 case GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER
:
1294 case GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER
:
1295 _mesa_program_resource_prop(shProg
, res
, index
,
1296 GL_REFERENCED_BY_FRAGMENT_SHADER
, params
,
1299 case GL_UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER
:
1300 case GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER
:
1301 _mesa_program_resource_prop(shProg
, res
, index
,
1302 GL_REFERENCED_BY_COMPUTE_SHADER
, params
,
1306 _mesa_error(ctx
, GL_INVALID_ENUM
,
1307 "%s(pname 0x%x (%s))", caller
, pname
,
1308 _mesa_enum_to_string(pname
));
1315 _mesa_GetActiveUniformBlockiv(GLuint program
,
1316 GLuint uniformBlockIndex
,
1320 GET_CURRENT_CONTEXT(ctx
);
1321 struct gl_shader_program
*shProg
;
1323 if (!ctx
->Extensions
.ARB_uniform_buffer_object
) {
1324 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glGetActiveUniformBlockiv");
1328 shProg
= _mesa_lookup_shader_program_err(ctx
, program
,
1329 "glGetActiveUniformBlockiv");
1333 mesa_bufferiv(shProg
, GL_UNIFORM_BLOCK
, uniformBlockIndex
, pname
, params
,
1334 "glGetActiveUniformBlockiv");
1338 _mesa_GetActiveUniformBlockName(GLuint program
,
1339 GLuint uniformBlockIndex
,
1342 GLchar
*uniformBlockName
)
1344 GET_CURRENT_CONTEXT(ctx
);
1345 struct gl_shader_program
*shProg
;
1347 if (!ctx
->Extensions
.ARB_uniform_buffer_object
) {
1348 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glGetActiveUniformBlockiv");
1353 _mesa_error(ctx
, GL_INVALID_VALUE
,
1354 "glGetActiveUniformBlockName(bufSize %d < 0)",
1359 shProg
= _mesa_lookup_shader_program_err(ctx
, program
,
1360 "glGetActiveUniformBlockiv");
1364 if (uniformBlockName
)
1365 _mesa_get_program_resource_name(shProg
, GL_UNIFORM_BLOCK
,
1366 uniformBlockIndex
, bufSize
, length
,
1368 "glGetActiveUniformBlockName");
1372 _mesa_GetActiveUniformName(GLuint program
, GLuint uniformIndex
,
1373 GLsizei bufSize
, GLsizei
*length
,
1374 GLchar
*uniformName
)
1376 GET_CURRENT_CONTEXT(ctx
);
1377 struct gl_shader_program
*shProg
;
1379 if (!ctx
->Extensions
.ARB_uniform_buffer_object
) {
1380 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glGetActiveUniformName");
1385 _mesa_error(ctx
, GL_INVALID_VALUE
,
1386 "glGetActiveUniformName(bufSize %d < 0)",
1391 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glGetActiveUniformName");
1396 _mesa_get_program_resource_name(shProg
, GL_UNIFORM
, uniformIndex
, bufSize
,
1397 length
, uniformName
, "glGetActiveUniformName");
1401 _mesa_GetActiveAtomicCounterBufferiv(GLuint program
, GLuint bufferIndex
,
1402 GLenum pname
, GLint
*params
)
1404 GET_CURRENT_CONTEXT(ctx
);
1405 struct gl_shader_program
*shProg
;
1407 if (!ctx
->Extensions
.ARB_shader_atomic_counters
) {
1408 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1409 "glGetActiveAtomicCounterBufferiv");
1413 shProg
= _mesa_lookup_shader_program_err(ctx
, program
,
1414 "glGetActiveAtomicCounterBufferiv");
1418 mesa_bufferiv(shProg
, GL_ATOMIC_COUNTER_BUFFER
, bufferIndex
, pname
, params
,
1419 "glGetActiveAtomicCounterBufferiv");
1423 _mesa_Uniform1d(GLint location
, GLdouble v0
)
1425 GET_CURRENT_CONTEXT(ctx
);
1426 _mesa_uniform(location
, 1, &v0
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_DOUBLE
, 1);
1430 _mesa_Uniform2d(GLint location
, GLdouble v0
, GLdouble v1
)
1432 GET_CURRENT_CONTEXT(ctx
);
1436 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_DOUBLE
, 2);
1440 _mesa_Uniform3d(GLint location
, GLdouble v0
, GLdouble v1
, GLdouble v2
)
1442 GET_CURRENT_CONTEXT(ctx
);
1447 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_DOUBLE
, 3);
1451 _mesa_Uniform4d(GLint location
, GLdouble v0
, GLdouble v1
, GLdouble v2
,
1454 GET_CURRENT_CONTEXT(ctx
);
1460 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_DOUBLE
, 4);
1464 _mesa_Uniform1dv(GLint location
, GLsizei count
, const GLdouble
* value
)
1466 GET_CURRENT_CONTEXT(ctx
);
1467 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_DOUBLE
, 1);
1471 _mesa_Uniform2dv(GLint location
, GLsizei count
, const GLdouble
* value
)
1473 GET_CURRENT_CONTEXT(ctx
);
1474 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_DOUBLE
, 2);
1478 _mesa_Uniform3dv(GLint location
, GLsizei count
, const GLdouble
* value
)
1480 GET_CURRENT_CONTEXT(ctx
);
1481 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_DOUBLE
, 3);
1485 _mesa_Uniform4dv(GLint location
, GLsizei count
, const GLdouble
* value
)
1487 GET_CURRENT_CONTEXT(ctx
);
1488 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_DOUBLE
, 4);
1492 _mesa_UniformMatrix2dv(GLint location
, GLsizei count
, GLboolean transpose
,
1493 const GLdouble
* value
)
1495 GET_CURRENT_CONTEXT(ctx
);
1496 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1497 ctx
, ctx
->_Shader
->ActiveProgram
, 2, 2, GLSL_TYPE_DOUBLE
);
1501 _mesa_UniformMatrix3dv(GLint location
, GLsizei count
, GLboolean transpose
,
1502 const GLdouble
* value
)
1504 GET_CURRENT_CONTEXT(ctx
);
1505 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1506 ctx
, ctx
->_Shader
->ActiveProgram
, 3, 3, GLSL_TYPE_DOUBLE
);
1510 _mesa_UniformMatrix4dv(GLint location
, GLsizei count
, GLboolean transpose
,
1511 const GLdouble
* value
)
1513 GET_CURRENT_CONTEXT(ctx
);
1514 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1515 ctx
, ctx
->_Shader
->ActiveProgram
, 4, 4, GLSL_TYPE_DOUBLE
);
1519 _mesa_UniformMatrix2x3dv(GLint location
, GLsizei count
, GLboolean transpose
,
1520 const GLdouble
*value
)
1522 GET_CURRENT_CONTEXT(ctx
);
1523 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1524 ctx
, ctx
->_Shader
->ActiveProgram
, 2, 3, GLSL_TYPE_DOUBLE
);
1528 _mesa_UniformMatrix3x2dv(GLint location
, GLsizei count
, GLboolean transpose
,
1529 const GLdouble
*value
)
1531 GET_CURRENT_CONTEXT(ctx
);
1532 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1533 ctx
, ctx
->_Shader
->ActiveProgram
, 3, 2, GLSL_TYPE_DOUBLE
);
1537 _mesa_UniformMatrix2x4dv(GLint location
, GLsizei count
, GLboolean transpose
,
1538 const GLdouble
*value
)
1540 GET_CURRENT_CONTEXT(ctx
);
1541 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1542 ctx
, ctx
->_Shader
->ActiveProgram
, 2, 4, GLSL_TYPE_DOUBLE
);
1546 _mesa_UniformMatrix4x2dv(GLint location
, GLsizei count
, GLboolean transpose
,
1547 const GLdouble
*value
)
1549 GET_CURRENT_CONTEXT(ctx
);
1550 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1551 ctx
, ctx
->_Shader
->ActiveProgram
, 4, 2, GLSL_TYPE_DOUBLE
);
1555 _mesa_UniformMatrix3x4dv(GLint location
, GLsizei count
, GLboolean transpose
,
1556 const GLdouble
*value
)
1558 GET_CURRENT_CONTEXT(ctx
);
1559 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1560 ctx
, ctx
->_Shader
->ActiveProgram
, 3, 4, GLSL_TYPE_DOUBLE
);
1564 _mesa_UniformMatrix4x3dv(GLint location
, GLsizei count
, GLboolean transpose
,
1565 const GLdouble
*value
)
1567 GET_CURRENT_CONTEXT(ctx
);
1568 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1569 ctx
, ctx
->_Shader
->ActiveProgram
, 4, 3, GLSL_TYPE_DOUBLE
);
1573 _mesa_ProgramUniform1d(GLuint program
, GLint location
, GLdouble v0
)
1575 GET_CURRENT_CONTEXT(ctx
);
1576 struct gl_shader_program
*shProg
=
1577 _mesa_lookup_shader_program_err(ctx
, program
,
1578 "glProgramUniform1d");
1579 _mesa_uniform(location
, 1, &v0
, ctx
, shProg
, GLSL_TYPE_DOUBLE
, 1);
1583 _mesa_ProgramUniform2d(GLuint program
, GLint location
, GLdouble v0
, GLdouble v1
)
1585 GET_CURRENT_CONTEXT(ctx
);
1587 struct gl_shader_program
*shProg
;
1590 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform2d");
1591 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_DOUBLE
, 2);
1595 _mesa_ProgramUniform3d(GLuint program
, GLint location
, GLdouble v0
, GLdouble v1
,
1598 GET_CURRENT_CONTEXT(ctx
);
1600 struct gl_shader_program
*shProg
;
1604 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform3d");
1605 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_DOUBLE
, 3);
1609 _mesa_ProgramUniform4d(GLuint program
, GLint location
, GLdouble v0
, GLdouble v1
,
1610 GLdouble v2
, GLdouble v3
)
1612 GET_CURRENT_CONTEXT(ctx
);
1614 struct gl_shader_program
*shProg
;
1619 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform4d");
1620 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_DOUBLE
, 4);
1624 _mesa_ProgramUniform1dv(GLuint program
, GLint location
, GLsizei count
,
1625 const GLdouble
* value
)
1627 GET_CURRENT_CONTEXT(ctx
);
1628 struct gl_shader_program
*shProg
=
1629 _mesa_lookup_shader_program_err(ctx
, program
,
1630 "glProgramUniform1dv");
1631 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_DOUBLE
, 1);
1635 _mesa_ProgramUniform2dv(GLuint program
, GLint location
, GLsizei count
,
1636 const GLdouble
* value
)
1638 GET_CURRENT_CONTEXT(ctx
);
1639 struct gl_shader_program
*shProg
=
1640 _mesa_lookup_shader_program_err(ctx
, program
,
1641 "glProgramUniform2dv");
1642 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_DOUBLE
, 2);
1646 _mesa_ProgramUniform3dv(GLuint program
, GLint location
, GLsizei count
,
1647 const GLdouble
* value
)
1649 GET_CURRENT_CONTEXT(ctx
);
1650 struct gl_shader_program
*shProg
=
1651 _mesa_lookup_shader_program_err(ctx
, program
,
1652 "glProgramUniform3dv");
1653 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_DOUBLE
, 3);
1657 _mesa_ProgramUniform4dv(GLuint program
, GLint location
, GLsizei count
,
1658 const GLdouble
* value
)
1660 GET_CURRENT_CONTEXT(ctx
);
1661 struct gl_shader_program
*shProg
=
1662 _mesa_lookup_shader_program_err(ctx
, program
,
1663 "glProgramUniform4dv");
1664 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_DOUBLE
, 4);
1668 _mesa_ProgramUniformMatrix2dv(GLuint program
, GLint location
, GLsizei count
,
1669 GLboolean transpose
, const GLdouble
* value
)
1671 GET_CURRENT_CONTEXT(ctx
);
1672 struct gl_shader_program
*shProg
=
1673 _mesa_lookup_shader_program_err(ctx
, program
,
1674 "glProgramUniformMatrix2dv");
1675 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1676 ctx
, shProg
, 2, 2, GLSL_TYPE_DOUBLE
);
1680 _mesa_ProgramUniformMatrix3dv(GLuint program
, GLint location
, GLsizei count
,
1681 GLboolean transpose
, const GLdouble
* value
)
1683 GET_CURRENT_CONTEXT(ctx
);
1684 struct gl_shader_program
*shProg
=
1685 _mesa_lookup_shader_program_err(ctx
, program
,
1686 "glProgramUniformMatrix3dv");
1687 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1688 ctx
, shProg
, 3, 3, GLSL_TYPE_DOUBLE
);
1692 _mesa_ProgramUniformMatrix4dv(GLuint program
, GLint location
, GLsizei count
,
1693 GLboolean transpose
, const GLdouble
* value
)
1695 GET_CURRENT_CONTEXT(ctx
);
1696 struct gl_shader_program
*shProg
=
1697 _mesa_lookup_shader_program_err(ctx
, program
,
1698 "glProgramUniformMatrix4dv");
1699 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1700 ctx
, shProg
, 4, 4, GLSL_TYPE_DOUBLE
);
1704 _mesa_ProgramUniformMatrix2x3dv(GLuint program
, GLint location
, GLsizei count
,
1705 GLboolean transpose
, const GLdouble
* value
)
1707 GET_CURRENT_CONTEXT(ctx
);
1708 struct gl_shader_program
*shProg
=
1709 _mesa_lookup_shader_program_err(ctx
, program
,
1710 "glProgramUniformMatrix2x3dv");
1711 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1712 ctx
, shProg
, 2, 3, GLSL_TYPE_DOUBLE
);
1716 _mesa_ProgramUniformMatrix3x2dv(GLuint program
, GLint location
, GLsizei count
,
1717 GLboolean transpose
, const GLdouble
* value
)
1719 GET_CURRENT_CONTEXT(ctx
);
1720 struct gl_shader_program
*shProg
=
1721 _mesa_lookup_shader_program_err(ctx
, program
,
1722 "glProgramUniformMatrix3x2dv");
1723 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1724 ctx
, shProg
, 3, 2, GLSL_TYPE_DOUBLE
);
1728 _mesa_ProgramUniformMatrix2x4dv(GLuint program
, GLint location
, GLsizei count
,
1729 GLboolean transpose
, const GLdouble
* value
)
1731 GET_CURRENT_CONTEXT(ctx
);
1732 struct gl_shader_program
*shProg
=
1733 _mesa_lookup_shader_program_err(ctx
, program
,
1734 "glProgramUniformMatrix2x4dv");
1735 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1736 ctx
, shProg
, 2, 4, GLSL_TYPE_DOUBLE
);
1740 _mesa_ProgramUniformMatrix4x2dv(GLuint program
, GLint location
, GLsizei count
,
1741 GLboolean transpose
, const GLdouble
* value
)
1743 GET_CURRENT_CONTEXT(ctx
);
1744 struct gl_shader_program
*shProg
=
1745 _mesa_lookup_shader_program_err(ctx
, program
,
1746 "glProgramUniformMatrix4x2dv");
1747 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1748 ctx
, shProg
, 4, 2, GLSL_TYPE_DOUBLE
);
1752 _mesa_ProgramUniformMatrix3x4dv(GLuint program
, GLint location
, GLsizei count
,
1753 GLboolean transpose
, const GLdouble
* value
)
1755 GET_CURRENT_CONTEXT(ctx
);
1756 struct gl_shader_program
*shProg
=
1757 _mesa_lookup_shader_program_err(ctx
, program
,
1758 "glProgramUniformMatrix3x4dv");
1759 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1760 ctx
, shProg
, 3, 4, GLSL_TYPE_DOUBLE
);
1764 _mesa_ProgramUniformMatrix4x3dv(GLuint program
, GLint location
, GLsizei count
,
1765 GLboolean transpose
, const GLdouble
* value
)
1767 GET_CURRENT_CONTEXT(ctx
);
1768 struct gl_shader_program
*shProg
=
1769 _mesa_lookup_shader_program_err(ctx
, program
,
1770 "glProgramUniformMatrix4x3dv");
1771 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1772 ctx
, shProg
, 4, 3, GLSL_TYPE_DOUBLE
);
1776 _mesa_Uniform1i64ARB(GLint location
, GLint64 v0
)
1778 GET_CURRENT_CONTEXT(ctx
);
1779 _mesa_uniform(location
, 1, &v0
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT64
, 1);
1783 _mesa_Uniform2i64ARB(GLint location
, GLint64 v0
, GLint64 v1
)
1785 GET_CURRENT_CONTEXT(ctx
);
1789 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT64
, 2);
1793 _mesa_Uniform3i64ARB(GLint location
, GLint64 v0
, GLint64 v1
, GLint64 v2
)
1795 GET_CURRENT_CONTEXT(ctx
);
1800 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT64
, 3);
1804 _mesa_Uniform4i64ARB(GLint location
, GLint64 v0
, GLint64 v1
, GLint64 v2
, GLint64 v3
)
1806 GET_CURRENT_CONTEXT(ctx
);
1812 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT64
, 4);
1816 _mesa_Uniform1i64vARB(GLint location
, GLsizei count
, const GLint64
*value
)
1818 GET_CURRENT_CONTEXT(ctx
);
1819 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT64
, 1);
1823 _mesa_Uniform2i64vARB(GLint location
, GLsizei count
, const GLint64
*value
)
1825 GET_CURRENT_CONTEXT(ctx
);
1826 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT64
, 2);
1830 _mesa_Uniform3i64vARB(GLint location
, GLsizei count
, const GLint64
*value
)
1832 GET_CURRENT_CONTEXT(ctx
);
1833 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT64
, 3);
1837 _mesa_Uniform4i64vARB(GLint location
, GLsizei count
, const GLint64
*value
)
1839 GET_CURRENT_CONTEXT(ctx
);
1840 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT64
, 4);
1844 _mesa_Uniform1ui64ARB(GLint location
, GLuint64 v0
)
1846 GET_CURRENT_CONTEXT(ctx
);
1847 _mesa_uniform(location
, 1, &v0
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT64
, 1);
1851 _mesa_Uniform2ui64ARB(GLint location
, GLuint64 v0
, GLuint64 v1
)
1853 GET_CURRENT_CONTEXT(ctx
);
1857 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT64
, 2);
1861 _mesa_Uniform3ui64ARB(GLint location
, GLuint64 v0
, GLuint64 v1
, GLuint64 v2
)
1863 GET_CURRENT_CONTEXT(ctx
);
1868 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT64
, 3);
1872 _mesa_Uniform4ui64ARB(GLint location
, GLuint64 v0
, GLuint64 v1
, GLuint64 v2
, GLuint64 v3
)
1874 GET_CURRENT_CONTEXT(ctx
);
1880 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT64
, 4);
1884 _mesa_Uniform1ui64vARB(GLint location
, GLsizei count
, const GLuint64
*value
)
1886 GET_CURRENT_CONTEXT(ctx
);
1887 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT64
, 1);
1891 _mesa_Uniform2ui64vARB(GLint location
, GLsizei count
, const GLuint64
*value
)
1893 GET_CURRENT_CONTEXT(ctx
);
1894 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT64
, 2);
1898 _mesa_Uniform3ui64vARB(GLint location
, GLsizei count
, const GLuint64
*value
)
1900 GET_CURRENT_CONTEXT(ctx
);
1901 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT64
, 3);
1905 _mesa_Uniform4ui64vARB(GLint location
, GLsizei count
, const GLuint64
*value
)
1907 GET_CURRENT_CONTEXT(ctx
);
1908 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT64
, 4);
1911 /* DSA entrypoints */
1913 _mesa_ProgramUniform1i64ARB(GLuint program
, GLint location
, GLint64 v0
)
1915 GET_CURRENT_CONTEXT(ctx
);
1916 struct gl_shader_program
*shProg
=
1917 _mesa_lookup_shader_program_err(ctx
, program
,
1918 "glProgramUniform1i64ARB");
1919 _mesa_uniform(location
, 1, &v0
, ctx
, shProg
, GLSL_TYPE_INT64
, 1);
1923 _mesa_ProgramUniform2i64ARB(GLuint program
, GLint location
, GLint64 v0
, GLint64 v1
)
1925 GET_CURRENT_CONTEXT(ctx
);
1926 struct gl_shader_program
*shProg
=
1927 _mesa_lookup_shader_program_err(ctx
, program
,
1928 "glProgramUniform2i64ARB");
1932 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_INT64
, 2);
1936 _mesa_ProgramUniform3i64ARB(GLuint program
, GLint location
, GLint64 v0
, GLint64 v1
, GLint64 v2
)
1938 GET_CURRENT_CONTEXT(ctx
);
1939 struct gl_shader_program
*shProg
=
1940 _mesa_lookup_shader_program_err(ctx
, program
,
1941 "glProgramUniform3i64ARB");
1946 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_INT64
, 3);
1950 _mesa_ProgramUniform4i64ARB(GLuint program
, GLint location
, GLint64 v0
, GLint64 v1
, GLint64 v2
, GLint64 v3
)
1952 GET_CURRENT_CONTEXT(ctx
);
1953 struct gl_shader_program
*shProg
=
1954 _mesa_lookup_shader_program_err(ctx
, program
,
1955 "glProgramUniform4i64ARB");
1961 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_INT64
, 4);
1965 _mesa_ProgramUniform1i64vARB(GLuint program
, GLint location
, GLsizei count
, const GLint64
*value
)
1967 GET_CURRENT_CONTEXT(ctx
);
1968 struct gl_shader_program
*shProg
=
1969 _mesa_lookup_shader_program_err(ctx
, program
,
1970 "glProgramUniform1i64vARB");
1971 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_INT64
, 1);
1975 _mesa_ProgramUniform2i64vARB(GLuint program
, GLint location
, GLsizei count
, const GLint64
*value
)
1977 GET_CURRENT_CONTEXT(ctx
);
1978 struct gl_shader_program
*shProg
=
1979 _mesa_lookup_shader_program_err(ctx
, program
,
1980 "glProgramUniform2i64vARB");
1981 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_INT64
, 2);
1985 _mesa_ProgramUniform3i64vARB(GLuint program
, GLint location
, GLsizei count
, const GLint64
*value
)
1987 GET_CURRENT_CONTEXT(ctx
);
1988 struct gl_shader_program
*shProg
=
1989 _mesa_lookup_shader_program_err(ctx
, program
,
1990 "glProgramUniform3i64vARB");
1991 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_INT64
, 3);
1995 _mesa_ProgramUniform4i64vARB(GLuint program
, GLint location
, GLsizei count
, const GLint64
*value
)
1997 GET_CURRENT_CONTEXT(ctx
);
1998 struct gl_shader_program
*shProg
=
1999 _mesa_lookup_shader_program_err(ctx
, program
,
2000 "glProgramUniform4i64vARB");
2001 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_INT64
, 4);
2005 _mesa_ProgramUniform1ui64ARB(GLuint program
, GLint location
, GLuint64 v0
)
2007 GET_CURRENT_CONTEXT(ctx
);
2008 struct gl_shader_program
*shProg
=
2009 _mesa_lookup_shader_program_err(ctx
, program
,
2010 "glProgramUniform1ui64ARB");
2011 _mesa_uniform(location
, 1, &v0
, ctx
, shProg
, GLSL_TYPE_UINT64
, 1);
2015 _mesa_ProgramUniform2ui64ARB(GLuint program
, GLint location
, GLuint64 v0
, GLuint64 v1
)
2017 GET_CURRENT_CONTEXT(ctx
);
2018 struct gl_shader_program
*shProg
=
2019 _mesa_lookup_shader_program_err(ctx
, program
,
2020 "glProgramUniform2ui64ARB");
2024 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_UINT64
, 2);
2028 _mesa_ProgramUniform3ui64ARB(GLuint program
, GLint location
, GLuint64 v0
, GLuint64 v1
, GLuint64 v2
)
2030 GET_CURRENT_CONTEXT(ctx
);
2031 struct gl_shader_program
*shProg
=
2032 _mesa_lookup_shader_program_err(ctx
, program
,
2033 "glProgramUniform3ui64ARB");
2038 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_UINT64
, 3);
2042 _mesa_ProgramUniform4ui64ARB(GLuint program
, GLint location
, GLuint64 v0
, GLuint64 v1
, GLuint64 v2
, GLuint64 v3
)
2044 GET_CURRENT_CONTEXT(ctx
);
2045 struct gl_shader_program
*shProg
=
2046 _mesa_lookup_shader_program_err(ctx
, program
,
2047 "glProgramUniform4ui64ARB");
2053 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_UINT64
, 4);
2057 _mesa_ProgramUniform1ui64vARB(GLuint program
, GLint location
, GLsizei count
, const GLuint64
*value
)
2059 GET_CURRENT_CONTEXT(ctx
);
2060 struct gl_shader_program
*shProg
=
2061 _mesa_lookup_shader_program_err(ctx
, program
,
2062 "glProgramUniform1ui64vARB");
2063 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_UINT64
, 1);
2067 _mesa_ProgramUniform2ui64vARB(GLuint program
, GLint location
, GLsizei count
, const GLuint64
*value
)
2069 GET_CURRENT_CONTEXT(ctx
);
2070 struct gl_shader_program
*shProg
=
2071 _mesa_lookup_shader_program_err(ctx
, program
,
2072 "glProgramUniform2ui64vARB");
2073 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_UINT64
, 2);
2077 _mesa_ProgramUniform3ui64vARB(GLuint program
, GLint location
, GLsizei count
, const GLuint64
*value
)
2079 GET_CURRENT_CONTEXT(ctx
);
2080 struct gl_shader_program
*shProg
=
2081 _mesa_lookup_shader_program_err(ctx
, program
,
2082 "glProgramUniform3ui64vARB");
2083 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_UINT64
, 3);
2087 _mesa_ProgramUniform4ui64vARB(GLuint program
, GLint location
, GLsizei count
, const GLuint64
*value
)
2089 GET_CURRENT_CONTEXT(ctx
);
2090 struct gl_shader_program
*shProg
=
2091 _mesa_lookup_shader_program_err(ctx
, program
,
2092 "glProgramUniform4ui64vARB");
2093 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_UINT64
, 4);