2 * Mesa 3-D graphics library
4 * Copyright (C) 2004-2008 Brian Paul All Rights Reserved.
5 * Copyright (C) 2009-2010 VMware, Inc. All Rights Reserved.
6 * Copyright © 2010 Intel Corporation
8 * Permission is hereby granted, free of charge, to any person obtaining a
9 * copy of this software and associated documentation files (the "Software"),
10 * to deal in the Software without restriction, including without limitation
11 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
12 * and/or sell copies of the Software, and to permit persons to whom the
13 * Software is furnished to do so, subject to the following conditions:
15 * The above copyright notice and this permission notice shall be included
16 * in all copies or substantial portions of the Software.
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
21 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
22 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
23 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
24 * OTHER DEALINGS IN THE SOFTWARE.
29 * Functions related to GLSL uniform variables.
35 * 1. Check that the right error code is generated for all _mesa_error() calls.
36 * 2. Insert FLUSH_VERTICES calls in various places
39 #include "main/glheader.h"
40 #include "main/context.h"
41 #include "main/dispatch.h"
42 #include "main/shaderapi.h"
43 #include "main/shaderobj.h"
44 #include "main/uniforms.h"
45 #include "main/enums.h"
46 #include "compiler/glsl/ir_uniform.h"
47 #include "compiler/glsl_types.h"
48 #include "program/program.h"
49 #include "util/bitscan.h"
52 * Update the vertex/fragment program's TexturesUsed array.
54 * This needs to be called after glUniform(set sampler var) is called.
55 * A call to glUniform(samplerVar, value) causes a sampler to point to a
56 * particular texture unit. We know the sampler's texture target
57 * (1D/2D/3D/etc) from compile time but the sampler's texture unit is
58 * set by glUniform() calls.
60 * So, scan the program->SamplerUnits[] and program->SamplerTargets[]
61 * information to update the prog->TexturesUsed[] values.
62 * Each value of TexturesUsed[unit] is one of zero, TEXTURE_1D_INDEX,
63 * TEXTURE_2D_INDEX, TEXTURE_3D_INDEX, etc.
64 * We'll use that info for state validation before rendering.
67 update_single_shader_texture_used(struct gl_shader_program
*shProg
,
68 struct gl_program
*prog
,
69 GLuint unit
, GLuint target
)
71 gl_shader_stage prog_stage
=
72 _mesa_program_enum_to_shader_stage(prog
->Target
);
74 assert(unit
< ARRAY_SIZE(prog
->TexturesUsed
));
75 assert(target
< NUM_TEXTURE_TARGETS
);
77 /* From section 7.10 (Samplers) of the OpenGL 4.5 spec:
79 * "It is not allowed to have variables of different sampler types pointing
80 * to the same texture image unit within a program object."
82 unsigned stages_mask
= shProg
->data
->linked_stages
;
84 const int stage
= u_bit_scan(&stages_mask
);
86 /* Skip validation if we are yet to update textures used in this
89 if (prog_stage
< stage
)
92 struct gl_program
*glprog
= shProg
->_LinkedShaders
[stage
]->Program
;
93 if (glprog
->TexturesUsed
[unit
] & ~(1 << target
))
94 shProg
->SamplersValidated
= GL_FALSE
;
97 prog
->TexturesUsed
[unit
] |= (1 << target
);
101 _mesa_update_shader_textures_used(struct gl_shader_program
*shProg
,
102 struct gl_program
*prog
)
104 GLbitfield mask
= prog
->SamplersUsed
;
105 gl_shader_stage prog_stage
=
106 _mesa_program_enum_to_shader_stage(prog
->Target
);
107 MAYBE_UNUSED
struct gl_linked_shader
*shader
=
108 shProg
->_LinkedShaders
[prog_stage
];
113 memset(prog
->TexturesUsed
, 0, sizeof(prog
->TexturesUsed
));
116 s
= u_bit_scan(&mask
);
118 update_single_shader_texture_used(shProg
, prog
,
119 prog
->SamplerUnits
[s
],
120 prog
->sh
.SamplerTargets
[s
]);
123 if (unlikely(prog
->sh
.HasBoundBindlessSampler
)) {
124 /* Loop over bindless samplers bound to texture units.
126 for (s
= 0; s
< prog
->sh
.NumBindlessSamplers
; s
++) {
127 struct gl_bindless_sampler
*sampler
= &prog
->sh
.BindlessSamplers
[s
];
132 update_single_shader_texture_used(shProg
, prog
, sampler
->unit
,
139 * Connect a piece of driver storage with a part of a uniform
141 * \param uni The uniform with which the storage will be associated
142 * \param element_stride Byte-stride between array elements.
143 * \sa gl_uniform_driver_storage::element_stride.
144 * \param vector_stride Byte-stride between vectors (in a matrix).
145 * \sa gl_uniform_driver_storage::vector_stride.
146 * \param format Conversion from native format to driver format
147 * required by the driver.
148 * \param data Location to dump the data.
151 _mesa_uniform_attach_driver_storage(struct gl_uniform_storage
*uni
,
152 unsigned element_stride
,
153 unsigned vector_stride
,
154 enum gl_uniform_driver_format format
,
157 uni
->driver_storage
=
158 realloc(uni
->driver_storage
,
159 sizeof(struct gl_uniform_driver_storage
)
160 * (uni
->num_driver_storage
+ 1));
162 uni
->driver_storage
[uni
->num_driver_storage
].element_stride
= element_stride
;
163 uni
->driver_storage
[uni
->num_driver_storage
].vector_stride
= vector_stride
;
164 uni
->driver_storage
[uni
->num_driver_storage
].format
= format
;
165 uni
->driver_storage
[uni
->num_driver_storage
].data
= data
;
167 uni
->num_driver_storage
++;
171 * Sever all connections with all pieces of driver storage for all uniforms
174 * This function does \b not release any of the \c data pointers
175 * previously passed in to \c _mesa_uniform_attach_driver_stoarge.
178 _mesa_uniform_detach_all_driver_storage(struct gl_uniform_storage
*uni
)
180 free(uni
->driver_storage
);
181 uni
->driver_storage
= NULL
;
182 uni
->num_driver_storage
= 0;
186 _mesa_Uniform1f(GLint location
, GLfloat v0
)
188 GET_CURRENT_CONTEXT(ctx
);
189 _mesa_uniform(location
, 1, &v0
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_FLOAT
, 1);
193 _mesa_Uniform2f(GLint location
, GLfloat v0
, GLfloat v1
)
195 GET_CURRENT_CONTEXT(ctx
);
199 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_FLOAT
, 2);
203 _mesa_Uniform3f(GLint location
, GLfloat v0
, GLfloat v1
, GLfloat v2
)
205 GET_CURRENT_CONTEXT(ctx
);
210 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_FLOAT
, 3);
214 _mesa_Uniform4f(GLint location
, GLfloat v0
, GLfloat v1
, GLfloat v2
,
217 GET_CURRENT_CONTEXT(ctx
);
223 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_FLOAT
, 4);
227 _mesa_Uniform1i(GLint location
, GLint v0
)
229 GET_CURRENT_CONTEXT(ctx
);
230 _mesa_uniform(location
, 1, &v0
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT
, 1);
234 _mesa_Uniform2i(GLint location
, GLint v0
, GLint v1
)
236 GET_CURRENT_CONTEXT(ctx
);
240 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT
, 2);
244 _mesa_Uniform3i(GLint location
, GLint v0
, GLint v1
, GLint v2
)
246 GET_CURRENT_CONTEXT(ctx
);
251 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT
, 3);
255 _mesa_Uniform4i(GLint location
, GLint v0
, GLint v1
, GLint v2
, GLint v3
)
257 GET_CURRENT_CONTEXT(ctx
);
263 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT
, 4);
267 _mesa_Uniform1fv(GLint location
, GLsizei count
, const GLfloat
* value
)
269 GET_CURRENT_CONTEXT(ctx
);
270 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_FLOAT
, 1);
274 _mesa_Uniform2fv(GLint location
, GLsizei count
, const GLfloat
* value
)
276 GET_CURRENT_CONTEXT(ctx
);
277 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_FLOAT
, 2);
281 _mesa_Uniform3fv(GLint location
, GLsizei count
, const GLfloat
* value
)
283 GET_CURRENT_CONTEXT(ctx
);
284 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_FLOAT
, 3);
288 _mesa_Uniform4fv(GLint location
, GLsizei count
, const GLfloat
* value
)
290 GET_CURRENT_CONTEXT(ctx
);
291 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_FLOAT
, 4);
295 _mesa_Uniform1iv(GLint location
, GLsizei count
, const GLint
* value
)
297 GET_CURRENT_CONTEXT(ctx
);
298 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT
, 1);
302 _mesa_Uniform2iv(GLint location
, GLsizei count
, const GLint
* value
)
304 GET_CURRENT_CONTEXT(ctx
);
305 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT
, 2);
309 _mesa_Uniform3iv(GLint location
, GLsizei count
, const GLint
* value
)
311 GET_CURRENT_CONTEXT(ctx
);
312 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT
, 3);
316 _mesa_Uniform4iv(GLint location
, GLsizei count
, const GLint
* value
)
318 GET_CURRENT_CONTEXT(ctx
);
319 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT
, 4);
323 _mesa_UniformHandleui64ARB(GLint location
, GLuint64 value
)
325 GET_CURRENT_CONTEXT(ctx
);
326 _mesa_uniform_handle(location
, 1, &value
, ctx
, ctx
->_Shader
->ActiveProgram
);
330 _mesa_UniformHandleui64vARB(GLint location
, GLsizei count
,
331 const GLuint64
*value
)
333 GET_CURRENT_CONTEXT(ctx
);
334 _mesa_uniform_handle(location
, count
, value
, ctx
,
335 ctx
->_Shader
->ActiveProgram
);
339 /** Same as above with direct state access **/
341 _mesa_ProgramUniform1f(GLuint program
, GLint location
, GLfloat v0
)
343 GET_CURRENT_CONTEXT(ctx
);
344 struct gl_shader_program
*shProg
=
345 _mesa_lookup_shader_program_err(ctx
, program
,
346 "glProgramUniform1f");
347 _mesa_uniform(location
, 1, &v0
, ctx
, shProg
, GLSL_TYPE_FLOAT
, 1);
351 _mesa_ProgramUniform2f(GLuint program
, GLint location
, GLfloat v0
, GLfloat v1
)
353 GET_CURRENT_CONTEXT(ctx
);
355 struct gl_shader_program
*shProg
;
358 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform2f");
359 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_FLOAT
, 2);
363 _mesa_ProgramUniform3f(GLuint program
, GLint location
, GLfloat v0
, GLfloat v1
,
366 GET_CURRENT_CONTEXT(ctx
);
368 struct gl_shader_program
*shProg
;
372 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform3f");
373 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_FLOAT
, 3);
377 _mesa_ProgramUniform4f(GLuint program
, GLint location
, GLfloat v0
, GLfloat v1
,
378 GLfloat v2
, GLfloat v3
)
380 GET_CURRENT_CONTEXT(ctx
);
382 struct gl_shader_program
*shProg
;
387 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform4f");
388 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_FLOAT
, 4);
392 _mesa_ProgramUniform1i(GLuint program
, GLint location
, GLint v0
)
394 GET_CURRENT_CONTEXT(ctx
);
395 struct gl_shader_program
*shProg
=
396 _mesa_lookup_shader_program_err(ctx
, program
,
397 "glProgramUniform1i");
398 _mesa_uniform(location
, 1, &v0
, ctx
, shProg
, GLSL_TYPE_INT
, 1);
402 _mesa_ProgramUniform2i(GLuint program
, GLint location
, GLint v0
, GLint v1
)
404 GET_CURRENT_CONTEXT(ctx
);
406 struct gl_shader_program
*shProg
;
409 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform2i");
410 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_INT
, 2);
414 _mesa_ProgramUniform3i(GLuint program
, GLint location
, GLint v0
, GLint v1
,
417 GET_CURRENT_CONTEXT(ctx
);
419 struct gl_shader_program
*shProg
;
423 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform3i");
424 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_INT
, 3);
428 _mesa_ProgramUniform4i(GLuint program
, GLint location
, GLint v0
, GLint v1
,
431 GET_CURRENT_CONTEXT(ctx
);
433 struct gl_shader_program
*shProg
;
438 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform4i");
439 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_INT
, 4);
443 _mesa_ProgramUniform1fv(GLuint program
, GLint location
, GLsizei count
,
444 const GLfloat
* value
)
446 GET_CURRENT_CONTEXT(ctx
);
447 struct gl_shader_program
*shProg
=
448 _mesa_lookup_shader_program_err(ctx
, program
,
449 "glProgramUniform1fv");
450 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_FLOAT
, 1);
454 _mesa_ProgramUniform2fv(GLuint program
, GLint location
, GLsizei count
,
455 const GLfloat
* value
)
457 GET_CURRENT_CONTEXT(ctx
);
458 struct gl_shader_program
*shProg
=
459 _mesa_lookup_shader_program_err(ctx
, program
,
460 "glProgramUniform2fv");
461 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_FLOAT
, 2);
465 _mesa_ProgramUniform3fv(GLuint program
, GLint location
, GLsizei count
,
466 const GLfloat
* value
)
468 GET_CURRENT_CONTEXT(ctx
);
469 struct gl_shader_program
*shProg
=
470 _mesa_lookup_shader_program_err(ctx
, program
,
471 "glProgramUniform3fv");
472 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_FLOAT
, 3);
476 _mesa_ProgramUniform4fv(GLuint program
, GLint location
, GLsizei count
,
477 const GLfloat
* value
)
479 GET_CURRENT_CONTEXT(ctx
);
480 struct gl_shader_program
*shProg
=
481 _mesa_lookup_shader_program_err(ctx
, program
,
482 "glProgramUniform4fv");
483 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_FLOAT
, 4);
487 _mesa_ProgramUniform1iv(GLuint program
, GLint location
, GLsizei count
,
490 GET_CURRENT_CONTEXT(ctx
);
491 struct gl_shader_program
*shProg
=
492 _mesa_lookup_shader_program_err(ctx
, program
,
493 "glProgramUniform1iv");
494 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_INT
, 1);
498 _mesa_ProgramUniform2iv(GLuint program
, GLint location
, GLsizei count
,
501 GET_CURRENT_CONTEXT(ctx
);
502 struct gl_shader_program
*shProg
=
503 _mesa_lookup_shader_program_err(ctx
, program
,
504 "glProgramUniform2iv");
505 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_INT
, 2);
509 _mesa_ProgramUniform3iv(GLuint program
, GLint location
, GLsizei count
,
512 GET_CURRENT_CONTEXT(ctx
);
513 struct gl_shader_program
*shProg
=
514 _mesa_lookup_shader_program_err(ctx
, program
,
515 "glProgramUniform3iv");
516 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_INT
, 3);
520 _mesa_ProgramUniform4iv(GLuint program
, GLint location
, GLsizei count
,
523 GET_CURRENT_CONTEXT(ctx
);
524 struct gl_shader_program
*shProg
=
525 _mesa_lookup_shader_program_err(ctx
, program
,
526 "glProgramUniform4iv");
527 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_INT
, 4);
531 _mesa_ProgramUniformHandleui64ARB(GLuint program
, GLint location
,
534 GET_CURRENT_CONTEXT(ctx
);
535 struct gl_shader_program
*shProg
=
536 _mesa_lookup_shader_program_err(ctx
, program
,
537 "glProgramUniformHandleui64ARB");
538 _mesa_uniform_handle(location
, 1, &value
, ctx
, shProg
);
542 _mesa_ProgramUniformHandleui64vARB(GLuint program
, GLint location
,
543 GLsizei count
, const GLuint64
*values
)
545 GET_CURRENT_CONTEXT(ctx
);
546 struct gl_shader_program
*shProg
=
547 _mesa_lookup_shader_program_err(ctx
, program
,
548 "glProgramUniformHandleui64vARB");
549 _mesa_uniform_handle(location
, count
, values
, ctx
, shProg
);
553 /** OpenGL 3.0 GLuint-valued functions **/
555 _mesa_Uniform1ui(GLint location
, GLuint v0
)
557 GET_CURRENT_CONTEXT(ctx
);
558 _mesa_uniform(location
, 1, &v0
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT
, 1);
562 _mesa_Uniform2ui(GLint location
, GLuint v0
, GLuint v1
)
564 GET_CURRENT_CONTEXT(ctx
);
568 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT
, 2);
572 _mesa_Uniform3ui(GLint location
, GLuint v0
, GLuint v1
, GLuint v2
)
574 GET_CURRENT_CONTEXT(ctx
);
579 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT
, 3);
583 _mesa_Uniform4ui(GLint location
, GLuint v0
, GLuint v1
, GLuint v2
, GLuint v3
)
585 GET_CURRENT_CONTEXT(ctx
);
591 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT
, 4);
595 _mesa_Uniform1uiv(GLint location
, GLsizei count
, const GLuint
*value
)
597 GET_CURRENT_CONTEXT(ctx
);
598 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT
, 1);
602 _mesa_Uniform2uiv(GLint location
, GLsizei count
, const GLuint
*value
)
604 GET_CURRENT_CONTEXT(ctx
);
605 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT
, 2);
609 _mesa_Uniform3uiv(GLint location
, GLsizei count
, const GLuint
*value
)
611 GET_CURRENT_CONTEXT(ctx
);
612 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT
, 3);
616 _mesa_Uniform4uiv(GLint location
, GLsizei count
, const GLuint
*value
)
618 GET_CURRENT_CONTEXT(ctx
);
619 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT
, 4);
625 _mesa_UniformMatrix2fv(GLint location
, GLsizei count
, GLboolean transpose
,
626 const GLfloat
* value
)
628 GET_CURRENT_CONTEXT(ctx
);
629 _mesa_uniform_matrix(location
, count
, transpose
, value
,
630 ctx
, ctx
->_Shader
->ActiveProgram
, 2, 2, GLSL_TYPE_FLOAT
);
634 _mesa_UniformMatrix3fv(GLint location
, GLsizei count
, GLboolean transpose
,
635 const GLfloat
* value
)
637 GET_CURRENT_CONTEXT(ctx
);
638 _mesa_uniform_matrix(location
, count
, transpose
, value
,
639 ctx
, ctx
->_Shader
->ActiveProgram
, 3, 3, GLSL_TYPE_FLOAT
);
643 _mesa_UniformMatrix4fv(GLint location
, GLsizei count
, GLboolean transpose
,
644 const GLfloat
* value
)
646 GET_CURRENT_CONTEXT(ctx
);
647 _mesa_uniform_matrix(location
, count
, transpose
, value
,
648 ctx
, ctx
->_Shader
->ActiveProgram
, 4, 4, GLSL_TYPE_FLOAT
);
651 /** Same as above with direct state access **/
654 _mesa_ProgramUniform1ui(GLuint program
, GLint location
, GLuint v0
)
656 GET_CURRENT_CONTEXT(ctx
);
657 struct gl_shader_program
*shProg
=
658 _mesa_lookup_shader_program_err(ctx
, program
,
659 "glProgramUniform1ui");
660 _mesa_uniform(location
, 1, &v0
, ctx
, shProg
, GLSL_TYPE_UINT
, 1);
664 _mesa_ProgramUniform2ui(GLuint program
, GLint location
, GLuint v0
, GLuint v1
)
666 GET_CURRENT_CONTEXT(ctx
);
668 struct gl_shader_program
*shProg
;
671 shProg
= _mesa_lookup_shader_program_err(ctx
, program
,
672 "glProgramUniform2ui");
673 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_UINT
, 2);
677 _mesa_ProgramUniform3ui(GLuint program
, GLint location
, GLuint v0
, GLuint v1
,
680 GET_CURRENT_CONTEXT(ctx
);
682 struct gl_shader_program
*shProg
;
686 shProg
= _mesa_lookup_shader_program_err(ctx
, program
,
687 "glProgramUniform3ui");
688 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_UINT
, 3);
692 _mesa_ProgramUniform4ui(GLuint program
, GLint location
, GLuint v0
, GLuint v1
,
693 GLuint v2
, GLuint v3
)
695 GET_CURRENT_CONTEXT(ctx
);
697 struct gl_shader_program
*shProg
;
702 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform4ui");
703 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_UINT
, 4);
707 _mesa_ProgramUniform1uiv(GLuint program
, GLint location
, GLsizei count
,
710 GET_CURRENT_CONTEXT(ctx
);
711 struct gl_shader_program
*shProg
=
712 _mesa_lookup_shader_program_err(ctx
, program
,
713 "glProgramUniform1uiv");
714 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_UINT
, 1);
718 _mesa_ProgramUniform2uiv(GLuint program
, GLint location
, GLsizei count
,
721 GET_CURRENT_CONTEXT(ctx
);
722 struct gl_shader_program
*shProg
=
723 _mesa_lookup_shader_program_err(ctx
, program
,
724 "glProgramUniform2uiv");
725 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_UINT
, 2);
729 _mesa_ProgramUniform3uiv(GLuint program
, GLint location
, GLsizei count
,
732 GET_CURRENT_CONTEXT(ctx
);
733 struct gl_shader_program
*shProg
=
734 _mesa_lookup_shader_program_err(ctx
, program
,
735 "glProgramUniform3uiv");
736 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_UINT
, 3);
740 _mesa_ProgramUniform4uiv(GLuint program
, GLint location
, GLsizei count
,
743 GET_CURRENT_CONTEXT(ctx
);
744 struct gl_shader_program
*shProg
=
745 _mesa_lookup_shader_program_err(ctx
, program
,
746 "glProgramUniform4uiv");
747 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_UINT
, 4);
753 _mesa_ProgramUniformMatrix2fv(GLuint program
, GLint location
, GLsizei count
,
754 GLboolean transpose
, const GLfloat
* value
)
756 GET_CURRENT_CONTEXT(ctx
);
757 struct gl_shader_program
*shProg
=
758 _mesa_lookup_shader_program_err(ctx
, program
,
759 "glProgramUniformMatrix2fv");
760 _mesa_uniform_matrix(location
, count
, transpose
, value
, ctx
, shProg
, 2, 2, GLSL_TYPE_FLOAT
);
764 _mesa_ProgramUniformMatrix3fv(GLuint program
, GLint location
, GLsizei count
,
765 GLboolean transpose
, const GLfloat
* value
)
767 GET_CURRENT_CONTEXT(ctx
);
768 struct gl_shader_program
*shProg
=
769 _mesa_lookup_shader_program_err(ctx
, program
,
770 "glProgramUniformMatrix3fv");
771 _mesa_uniform_matrix(location
, count
, transpose
, value
, ctx
, shProg
, 3, 3, GLSL_TYPE_FLOAT
);
775 _mesa_ProgramUniformMatrix4fv(GLuint program
, GLint location
, GLsizei count
,
776 GLboolean transpose
, const GLfloat
* value
)
778 GET_CURRENT_CONTEXT(ctx
);
779 struct gl_shader_program
*shProg
=
780 _mesa_lookup_shader_program_err(ctx
, program
,
781 "glProgramUniformMatrix4fv");
782 _mesa_uniform_matrix(location
, count
, transpose
, value
, ctx
, shProg
, 4, 4, GLSL_TYPE_FLOAT
);
787 * Non-square UniformMatrix are OpenGL 2.1
790 _mesa_UniformMatrix2x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
791 const GLfloat
*value
)
793 GET_CURRENT_CONTEXT(ctx
);
794 _mesa_uniform_matrix(location
, count
, transpose
, value
,
795 ctx
, ctx
->_Shader
->ActiveProgram
, 2, 3, GLSL_TYPE_FLOAT
);
799 _mesa_UniformMatrix3x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
800 const GLfloat
*value
)
802 GET_CURRENT_CONTEXT(ctx
);
803 _mesa_uniform_matrix(location
, count
, transpose
, value
,
804 ctx
, ctx
->_Shader
->ActiveProgram
, 3, 2, GLSL_TYPE_FLOAT
);
808 _mesa_UniformMatrix2x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
809 const GLfloat
*value
)
811 GET_CURRENT_CONTEXT(ctx
);
812 _mesa_uniform_matrix(location
, count
, transpose
, value
,
813 ctx
, ctx
->_Shader
->ActiveProgram
, 2, 4, GLSL_TYPE_FLOAT
);
817 _mesa_UniformMatrix4x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
818 const GLfloat
*value
)
820 GET_CURRENT_CONTEXT(ctx
);
821 _mesa_uniform_matrix(location
, count
, transpose
, value
,
822 ctx
, ctx
->_Shader
->ActiveProgram
, 4, 2, GLSL_TYPE_FLOAT
);
826 _mesa_UniformMatrix3x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
827 const GLfloat
*value
)
829 GET_CURRENT_CONTEXT(ctx
);
830 _mesa_uniform_matrix(location
, count
, transpose
, value
,
831 ctx
, ctx
->_Shader
->ActiveProgram
, 3, 4, GLSL_TYPE_FLOAT
);
835 _mesa_UniformMatrix4x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
836 const GLfloat
*value
)
838 GET_CURRENT_CONTEXT(ctx
);
839 _mesa_uniform_matrix(location
, count
, transpose
, value
,
840 ctx
, ctx
->_Shader
->ActiveProgram
, 4, 3, GLSL_TYPE_FLOAT
);
843 /** Same as above with direct state access **/
846 _mesa_ProgramUniformMatrix2x3fv(GLuint program
, GLint location
, GLsizei count
,
847 GLboolean transpose
, const GLfloat
* value
)
849 GET_CURRENT_CONTEXT(ctx
);
850 struct gl_shader_program
*shProg
=
851 _mesa_lookup_shader_program_err(ctx
, program
,
852 "glProgramUniformMatrix2x3fv");
853 _mesa_uniform_matrix(location
, count
, transpose
, value
, ctx
, shProg
, 2, 3, GLSL_TYPE_FLOAT
);
857 _mesa_ProgramUniformMatrix3x2fv(GLuint program
, GLint location
, GLsizei count
,
858 GLboolean transpose
, const GLfloat
* value
)
860 GET_CURRENT_CONTEXT(ctx
);
861 struct gl_shader_program
*shProg
=
862 _mesa_lookup_shader_program_err(ctx
, program
,
863 "glProgramUniformMatrix3x2fv");
864 _mesa_uniform_matrix(location
, count
, transpose
, value
, ctx
, shProg
, 3, 2, GLSL_TYPE_FLOAT
);
868 _mesa_ProgramUniformMatrix2x4fv(GLuint program
, GLint location
, GLsizei count
,
869 GLboolean transpose
, const GLfloat
* value
)
871 GET_CURRENT_CONTEXT(ctx
);
872 struct gl_shader_program
*shProg
=
873 _mesa_lookup_shader_program_err(ctx
, program
,
874 "glProgramUniformMatrix2x4fv");
875 _mesa_uniform_matrix(location
, count
, transpose
, value
, ctx
, shProg
, 2, 4, GLSL_TYPE_FLOAT
);
879 _mesa_ProgramUniformMatrix4x2fv(GLuint program
, GLint location
, GLsizei count
,
880 GLboolean transpose
, const GLfloat
* value
)
882 GET_CURRENT_CONTEXT(ctx
);
883 struct gl_shader_program
*shProg
=
884 _mesa_lookup_shader_program_err(ctx
, program
,
885 "glProgramUniformMatrix4x2fv");
886 _mesa_uniform_matrix(location
, count
, transpose
, value
, ctx
, shProg
, 4, 2, GLSL_TYPE_FLOAT
);
890 _mesa_ProgramUniformMatrix3x4fv(GLuint program
, GLint location
, GLsizei count
,
891 GLboolean transpose
, const GLfloat
* value
)
893 GET_CURRENT_CONTEXT(ctx
);
894 struct gl_shader_program
*shProg
=
895 _mesa_lookup_shader_program_err(ctx
, program
,
896 "glProgramUniformMatrix3x4fv");
897 _mesa_uniform_matrix(location
, count
, transpose
, value
, ctx
, shProg
, 3, 4, GLSL_TYPE_FLOAT
);
901 _mesa_ProgramUniformMatrix4x3fv(GLuint program
, GLint location
, GLsizei count
,
902 GLboolean transpose
, const GLfloat
* value
)
904 GET_CURRENT_CONTEXT(ctx
);
905 struct gl_shader_program
*shProg
=
906 _mesa_lookup_shader_program_err(ctx
, program
,
907 "glProgramUniformMatrix4x3fv");
908 _mesa_uniform_matrix(location
, count
, transpose
, value
, ctx
, shProg
, 4, 3, GLSL_TYPE_FLOAT
);
913 _mesa_GetnUniformfvARB(GLuint program
, GLint location
,
914 GLsizei bufSize
, GLfloat
*params
)
916 GET_CURRENT_CONTEXT(ctx
);
917 _mesa_get_uniform(ctx
, program
, location
, bufSize
, GLSL_TYPE_FLOAT
, params
);
921 _mesa_GetUniformfv(GLuint program
, GLint location
, GLfloat
*params
)
923 _mesa_GetnUniformfvARB(program
, location
, INT_MAX
, params
);
928 _mesa_GetnUniformivARB(GLuint program
, GLint location
,
929 GLsizei bufSize
, GLint
*params
)
931 GET_CURRENT_CONTEXT(ctx
);
932 _mesa_get_uniform(ctx
, program
, location
, bufSize
, GLSL_TYPE_INT
, params
);
936 _mesa_GetUniformiv(GLuint program
, GLint location
, GLint
*params
)
938 _mesa_GetnUniformivARB(program
, location
, INT_MAX
, params
);
944 _mesa_GetnUniformuivARB(GLuint program
, GLint location
,
945 GLsizei bufSize
, GLuint
*params
)
947 GET_CURRENT_CONTEXT(ctx
);
948 _mesa_get_uniform(ctx
, program
, location
, bufSize
, GLSL_TYPE_UINT
, params
);
952 _mesa_GetUniformuiv(GLuint program
, GLint location
, GLuint
*params
)
954 _mesa_GetnUniformuivARB(program
, location
, INT_MAX
, params
);
960 _mesa_GetnUniformdvARB(GLuint program
, GLint location
,
961 GLsizei bufSize
, GLdouble
*params
)
963 GET_CURRENT_CONTEXT(ctx
);
965 _mesa_get_uniform(ctx
, program
, location
, bufSize
, GLSL_TYPE_DOUBLE
, params
);
969 _mesa_GetUniformdv(GLuint program
, GLint location
, GLdouble
*params
)
971 _mesa_GetnUniformdvARB(program
, location
, INT_MAX
, params
);
975 _mesa_GetnUniformi64vARB(GLuint program
, GLint location
,
976 GLsizei bufSize
, GLint64
*params
)
978 GET_CURRENT_CONTEXT(ctx
);
979 _mesa_get_uniform(ctx
, program
, location
, bufSize
, GLSL_TYPE_INT64
, params
);
982 _mesa_GetUniformi64vARB(GLuint program
, GLint location
, GLint64
*params
)
984 _mesa_GetnUniformi64vARB(program
, location
, INT_MAX
, params
);
988 _mesa_GetnUniformui64vARB(GLuint program
, GLint location
,
989 GLsizei bufSize
, GLuint64
*params
)
991 GET_CURRENT_CONTEXT(ctx
);
992 _mesa_get_uniform(ctx
, program
, location
, bufSize
, GLSL_TYPE_UINT64
, params
);
996 _mesa_GetUniformui64vARB(GLuint program
, GLint location
, GLuint64
*params
)
998 _mesa_GetnUniformui64vARB(program
, location
, INT_MAX
, params
);
1003 _mesa_GetUniformLocation(GLuint programObj
, const GLcharARB
*name
)
1005 struct gl_shader_program
*shProg
;
1007 GET_CURRENT_CONTEXT(ctx
);
1009 shProg
= _mesa_lookup_shader_program_err(ctx
, programObj
,
1010 "glGetUniformLocation");
1014 /* Page 80 (page 94 of the PDF) of the OpenGL 2.1 spec says:
1016 * "If program has not been successfully linked, the error
1017 * INVALID_OPERATION is generated."
1019 if (shProg
->data
->LinkStatus
== LINKING_FAILURE
) {
1020 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1021 "glGetUniformLocation(program not linked)");
1025 return _mesa_program_resource_location(shProg
, GL_UNIFORM
, name
);
1029 _mesa_GetUniformLocation_no_error(GLuint programObj
, const GLcharARB
*name
)
1031 GET_CURRENT_CONTEXT(ctx
);
1033 struct gl_shader_program
*shProg
=
1034 _mesa_lookup_shader_program(ctx
, programObj
);
1036 return _mesa_program_resource_location(shProg
, GL_UNIFORM
, name
);
1040 _mesa_GetUniformBlockIndex(GLuint program
,
1041 const GLchar
*uniformBlockName
)
1043 GET_CURRENT_CONTEXT(ctx
);
1044 struct gl_shader_program
*shProg
;
1046 if (!ctx
->Extensions
.ARB_uniform_buffer_object
) {
1047 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glGetUniformBlockIndex");
1048 return GL_INVALID_INDEX
;
1051 shProg
= _mesa_lookup_shader_program_err(ctx
, program
,
1052 "glGetUniformBlockIndex");
1054 return GL_INVALID_INDEX
;
1056 struct gl_program_resource
*res
=
1057 _mesa_program_resource_find_name(shProg
, GL_UNIFORM_BLOCK
,
1058 uniformBlockName
, NULL
);
1060 return GL_INVALID_INDEX
;
1062 return _mesa_program_resource_index(shProg
, res
);
1066 _mesa_GetUniformIndices(GLuint program
,
1067 GLsizei uniformCount
,
1068 const GLchar
* const *uniformNames
,
1069 GLuint
*uniformIndices
)
1071 GET_CURRENT_CONTEXT(ctx
);
1073 struct gl_shader_program
*shProg
;
1075 if (!ctx
->Extensions
.ARB_uniform_buffer_object
) {
1076 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glGetUniformIndices");
1080 shProg
= _mesa_lookup_shader_program_err(ctx
, program
,
1081 "glGetUniformIndices");
1085 if (uniformCount
< 0) {
1086 _mesa_error(ctx
, GL_INVALID_VALUE
,
1087 "glGetUniformIndices(uniformCount < 0)");
1091 for (i
= 0; i
< uniformCount
; i
++) {
1092 struct gl_program_resource
*res
=
1093 _mesa_program_resource_find_name(shProg
, GL_UNIFORM
, uniformNames
[i
],
1095 uniformIndices
[i
] = _mesa_program_resource_index(shProg
, res
);
1100 uniform_block_binding(struct gl_context
*ctx
, struct gl_shader_program
*shProg
,
1101 GLuint uniformBlockIndex
, GLuint uniformBlockBinding
)
1103 if (shProg
->data
->UniformBlocks
[uniformBlockIndex
].Binding
!=
1104 uniformBlockBinding
) {
1106 FLUSH_VERTICES(ctx
, 0);
1107 ctx
->NewDriverState
|= ctx
->DriverFlags
.NewUniformBuffer
;
1109 shProg
->data
->UniformBlocks
[uniformBlockIndex
].Binding
=
1110 uniformBlockBinding
;
1115 _mesa_UniformBlockBinding_no_error(GLuint program
, GLuint uniformBlockIndex
,
1116 GLuint uniformBlockBinding
)
1118 GET_CURRENT_CONTEXT(ctx
);
1120 struct gl_shader_program
*shProg
= _mesa_lookup_shader_program(ctx
, program
);
1121 uniform_block_binding(ctx
, shProg
, uniformBlockIndex
, uniformBlockBinding
);
1125 _mesa_UniformBlockBinding(GLuint program
,
1126 GLuint uniformBlockIndex
,
1127 GLuint uniformBlockBinding
)
1129 GET_CURRENT_CONTEXT(ctx
);
1130 struct gl_shader_program
*shProg
;
1132 if (!ctx
->Extensions
.ARB_uniform_buffer_object
) {
1133 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glUniformBlockBinding");
1137 shProg
= _mesa_lookup_shader_program_err(ctx
, program
,
1138 "glUniformBlockBinding");
1142 if (uniformBlockIndex
>= shProg
->data
->NumUniformBlocks
) {
1143 _mesa_error(ctx
, GL_INVALID_VALUE
,
1144 "glUniformBlockBinding(block index %u >= %u)",
1145 uniformBlockIndex
, shProg
->data
->NumUniformBlocks
);
1149 if (uniformBlockBinding
>= ctx
->Const
.MaxUniformBufferBindings
) {
1150 _mesa_error(ctx
, GL_INVALID_VALUE
,
1151 "glUniformBlockBinding(block binding %u >= %u)",
1152 uniformBlockBinding
, ctx
->Const
.MaxUniformBufferBindings
);
1156 uniform_block_binding(ctx
, shProg
, uniformBlockIndex
, uniformBlockBinding
);
1160 shader_storage_block_binding(struct gl_context
*ctx
,
1161 struct gl_shader_program
*shProg
,
1162 GLuint shaderStorageBlockIndex
,
1163 GLuint shaderStorageBlockBinding
)
1165 if (shProg
->data
->ShaderStorageBlocks
[shaderStorageBlockIndex
].Binding
!=
1166 shaderStorageBlockBinding
) {
1168 FLUSH_VERTICES(ctx
, 0);
1169 ctx
->NewDriverState
|= ctx
->DriverFlags
.NewShaderStorageBuffer
;
1171 shProg
->data
->ShaderStorageBlocks
[shaderStorageBlockIndex
].Binding
=
1172 shaderStorageBlockBinding
;
1177 _mesa_ShaderStorageBlockBinding_no_error(GLuint program
,
1178 GLuint shaderStorageBlockIndex
,
1179 GLuint shaderStorageBlockBinding
)
1181 GET_CURRENT_CONTEXT(ctx
);
1183 struct gl_shader_program
*shProg
= _mesa_lookup_shader_program(ctx
, program
);
1184 shader_storage_block_binding(ctx
, shProg
, shaderStorageBlockIndex
,
1185 shaderStorageBlockBinding
);
1189 _mesa_ShaderStorageBlockBinding(GLuint program
,
1190 GLuint shaderStorageBlockIndex
,
1191 GLuint shaderStorageBlockBinding
)
1193 GET_CURRENT_CONTEXT(ctx
);
1194 struct gl_shader_program
*shProg
;
1196 if (!ctx
->Extensions
.ARB_shader_storage_buffer_object
) {
1197 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glShaderStorageBlockBinding");
1201 shProg
= _mesa_lookup_shader_program_err(ctx
, program
,
1202 "glShaderStorageBlockBinding");
1206 if (shaderStorageBlockIndex
>= shProg
->data
->NumShaderStorageBlocks
) {
1207 _mesa_error(ctx
, GL_INVALID_VALUE
,
1208 "glShaderStorageBlockBinding(block index %u >= %u)",
1209 shaderStorageBlockIndex
,
1210 shProg
->data
->NumShaderStorageBlocks
);
1214 if (shaderStorageBlockBinding
>= ctx
->Const
.MaxShaderStorageBufferBindings
) {
1215 _mesa_error(ctx
, GL_INVALID_VALUE
,
1216 "glShaderStorageBlockBinding(block binding %u >= %u)",
1217 shaderStorageBlockBinding
,
1218 ctx
->Const
.MaxShaderStorageBufferBindings
);
1222 shader_storage_block_binding(ctx
, shProg
, shaderStorageBlockIndex
,
1223 shaderStorageBlockBinding
);
1227 * Generic program resource property query.
1230 mesa_bufferiv(struct gl_shader_program
*shProg
, GLenum type
,
1231 GLuint index
, GLenum pname
, GLint
*params
, const char *caller
)
1233 GET_CURRENT_CONTEXT(ctx
);
1234 struct gl_program_resource
*res
=
1235 _mesa_program_resource_find_index(shProg
, type
, index
);
1238 _mesa_error(ctx
, GL_INVALID_VALUE
, "%s(bufferindex %d)", caller
, index
);
1243 case GL_UNIFORM_BLOCK_BINDING
:
1244 case GL_ATOMIC_COUNTER_BUFFER_BINDING
:
1245 _mesa_program_resource_prop(shProg
, res
, index
, GL_BUFFER_BINDING
,
1248 case GL_UNIFORM_BLOCK_DATA_SIZE
:
1249 case GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE
:
1250 _mesa_program_resource_prop(shProg
, res
, index
, GL_BUFFER_DATA_SIZE
,
1253 case GL_UNIFORM_BLOCK_NAME_LENGTH
:
1254 _mesa_program_resource_prop(shProg
, res
, index
, GL_NAME_LENGTH
,
1257 case GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS
:
1258 case GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS
:
1259 _mesa_program_resource_prop(shProg
, res
, index
, GL_NUM_ACTIVE_VARIABLES
,
1262 case GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES
:
1263 case GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES
:
1264 _mesa_program_resource_prop(shProg
, res
, index
, GL_ACTIVE_VARIABLES
,
1267 case GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER
:
1268 case GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER
:
1269 _mesa_program_resource_prop(shProg
, res
, index
,
1270 GL_REFERENCED_BY_VERTEX_SHADER
, params
,
1274 case GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER
:
1275 case GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER
:
1276 _mesa_program_resource_prop(shProg
, res
, index
,
1277 GL_REFERENCED_BY_TESS_CONTROL_SHADER
, params
,
1281 case GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER
:
1282 case GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER
:
1283 _mesa_program_resource_prop(shProg
, res
, index
,
1284 GL_REFERENCED_BY_TESS_EVALUATION_SHADER
, params
,
1288 case GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER
:
1289 case GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER
:
1290 _mesa_program_resource_prop(shProg
, res
, index
,
1291 GL_REFERENCED_BY_GEOMETRY_SHADER
, params
,
1294 case GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER
:
1295 case GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER
:
1296 _mesa_program_resource_prop(shProg
, res
, index
,
1297 GL_REFERENCED_BY_FRAGMENT_SHADER
, params
,
1300 case GL_UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER
:
1301 case GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER
:
1302 _mesa_program_resource_prop(shProg
, res
, index
,
1303 GL_REFERENCED_BY_COMPUTE_SHADER
, params
,
1307 _mesa_error(ctx
, GL_INVALID_ENUM
,
1308 "%s(pname 0x%x (%s))", caller
, pname
,
1309 _mesa_enum_to_string(pname
));
1316 _mesa_GetActiveUniformBlockiv(GLuint program
,
1317 GLuint uniformBlockIndex
,
1321 GET_CURRENT_CONTEXT(ctx
);
1322 struct gl_shader_program
*shProg
;
1324 if (!ctx
->Extensions
.ARB_uniform_buffer_object
) {
1325 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glGetActiveUniformBlockiv");
1329 shProg
= _mesa_lookup_shader_program_err(ctx
, program
,
1330 "glGetActiveUniformBlockiv");
1334 mesa_bufferiv(shProg
, GL_UNIFORM_BLOCK
, uniformBlockIndex
, pname
, params
,
1335 "glGetActiveUniformBlockiv");
1339 _mesa_GetActiveUniformBlockName(GLuint program
,
1340 GLuint uniformBlockIndex
,
1343 GLchar
*uniformBlockName
)
1345 GET_CURRENT_CONTEXT(ctx
);
1346 struct gl_shader_program
*shProg
;
1348 if (!ctx
->Extensions
.ARB_uniform_buffer_object
) {
1349 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glGetActiveUniformBlockiv");
1354 _mesa_error(ctx
, GL_INVALID_VALUE
,
1355 "glGetActiveUniformBlockName(bufSize %d < 0)",
1360 shProg
= _mesa_lookup_shader_program_err(ctx
, program
,
1361 "glGetActiveUniformBlockiv");
1365 if (uniformBlockName
)
1366 _mesa_get_program_resource_name(shProg
, GL_UNIFORM_BLOCK
,
1367 uniformBlockIndex
, bufSize
, length
,
1369 "glGetActiveUniformBlockName");
1373 _mesa_GetActiveUniformName(GLuint program
, GLuint uniformIndex
,
1374 GLsizei bufSize
, GLsizei
*length
,
1375 GLchar
*uniformName
)
1377 GET_CURRENT_CONTEXT(ctx
);
1378 struct gl_shader_program
*shProg
;
1380 if (!ctx
->Extensions
.ARB_uniform_buffer_object
) {
1381 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glGetActiveUniformName");
1386 _mesa_error(ctx
, GL_INVALID_VALUE
,
1387 "glGetActiveUniformName(bufSize %d < 0)",
1392 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glGetActiveUniformName");
1397 _mesa_get_program_resource_name(shProg
, GL_UNIFORM
, uniformIndex
, bufSize
,
1398 length
, uniformName
, "glGetActiveUniformName");
1402 _mesa_GetActiveAtomicCounterBufferiv(GLuint program
, GLuint bufferIndex
,
1403 GLenum pname
, GLint
*params
)
1405 GET_CURRENT_CONTEXT(ctx
);
1406 struct gl_shader_program
*shProg
;
1408 if (!ctx
->Extensions
.ARB_shader_atomic_counters
) {
1409 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1410 "glGetActiveAtomicCounterBufferiv");
1414 shProg
= _mesa_lookup_shader_program_err(ctx
, program
,
1415 "glGetActiveAtomicCounterBufferiv");
1419 mesa_bufferiv(shProg
, GL_ATOMIC_COUNTER_BUFFER
, bufferIndex
, pname
, params
,
1420 "glGetActiveAtomicCounterBufferiv");
1424 _mesa_Uniform1d(GLint location
, GLdouble v0
)
1426 GET_CURRENT_CONTEXT(ctx
);
1427 _mesa_uniform(location
, 1, &v0
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_DOUBLE
, 1);
1431 _mesa_Uniform2d(GLint location
, GLdouble v0
, GLdouble v1
)
1433 GET_CURRENT_CONTEXT(ctx
);
1437 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_DOUBLE
, 2);
1441 _mesa_Uniform3d(GLint location
, GLdouble v0
, GLdouble v1
, GLdouble v2
)
1443 GET_CURRENT_CONTEXT(ctx
);
1448 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_DOUBLE
, 3);
1452 _mesa_Uniform4d(GLint location
, GLdouble v0
, GLdouble v1
, GLdouble v2
,
1455 GET_CURRENT_CONTEXT(ctx
);
1461 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_DOUBLE
, 4);
1465 _mesa_Uniform1dv(GLint location
, GLsizei count
, const GLdouble
* value
)
1467 GET_CURRENT_CONTEXT(ctx
);
1468 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_DOUBLE
, 1);
1472 _mesa_Uniform2dv(GLint location
, GLsizei count
, const GLdouble
* value
)
1474 GET_CURRENT_CONTEXT(ctx
);
1475 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_DOUBLE
, 2);
1479 _mesa_Uniform3dv(GLint location
, GLsizei count
, const GLdouble
* value
)
1481 GET_CURRENT_CONTEXT(ctx
);
1482 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_DOUBLE
, 3);
1486 _mesa_Uniform4dv(GLint location
, GLsizei count
, const GLdouble
* value
)
1488 GET_CURRENT_CONTEXT(ctx
);
1489 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_DOUBLE
, 4);
1493 _mesa_UniformMatrix2dv(GLint location
, GLsizei count
, GLboolean transpose
,
1494 const GLdouble
* value
)
1496 GET_CURRENT_CONTEXT(ctx
);
1497 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1498 ctx
, ctx
->_Shader
->ActiveProgram
, 2, 2, GLSL_TYPE_DOUBLE
);
1502 _mesa_UniformMatrix3dv(GLint location
, GLsizei count
, GLboolean transpose
,
1503 const GLdouble
* value
)
1505 GET_CURRENT_CONTEXT(ctx
);
1506 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1507 ctx
, ctx
->_Shader
->ActiveProgram
, 3, 3, GLSL_TYPE_DOUBLE
);
1511 _mesa_UniformMatrix4dv(GLint location
, GLsizei count
, GLboolean transpose
,
1512 const GLdouble
* value
)
1514 GET_CURRENT_CONTEXT(ctx
);
1515 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1516 ctx
, ctx
->_Shader
->ActiveProgram
, 4, 4, GLSL_TYPE_DOUBLE
);
1520 _mesa_UniformMatrix2x3dv(GLint location
, GLsizei count
, GLboolean transpose
,
1521 const GLdouble
*value
)
1523 GET_CURRENT_CONTEXT(ctx
);
1524 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1525 ctx
, ctx
->_Shader
->ActiveProgram
, 2, 3, GLSL_TYPE_DOUBLE
);
1529 _mesa_UniformMatrix3x2dv(GLint location
, GLsizei count
, GLboolean transpose
,
1530 const GLdouble
*value
)
1532 GET_CURRENT_CONTEXT(ctx
);
1533 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1534 ctx
, ctx
->_Shader
->ActiveProgram
, 3, 2, GLSL_TYPE_DOUBLE
);
1538 _mesa_UniformMatrix2x4dv(GLint location
, GLsizei count
, GLboolean transpose
,
1539 const GLdouble
*value
)
1541 GET_CURRENT_CONTEXT(ctx
);
1542 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1543 ctx
, ctx
->_Shader
->ActiveProgram
, 2, 4, GLSL_TYPE_DOUBLE
);
1547 _mesa_UniformMatrix4x2dv(GLint location
, GLsizei count
, GLboolean transpose
,
1548 const GLdouble
*value
)
1550 GET_CURRENT_CONTEXT(ctx
);
1551 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1552 ctx
, ctx
->_Shader
->ActiveProgram
, 4, 2, GLSL_TYPE_DOUBLE
);
1556 _mesa_UniformMatrix3x4dv(GLint location
, GLsizei count
, GLboolean transpose
,
1557 const GLdouble
*value
)
1559 GET_CURRENT_CONTEXT(ctx
);
1560 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1561 ctx
, ctx
->_Shader
->ActiveProgram
, 3, 4, GLSL_TYPE_DOUBLE
);
1565 _mesa_UniformMatrix4x3dv(GLint location
, GLsizei count
, GLboolean transpose
,
1566 const GLdouble
*value
)
1568 GET_CURRENT_CONTEXT(ctx
);
1569 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1570 ctx
, ctx
->_Shader
->ActiveProgram
, 4, 3, GLSL_TYPE_DOUBLE
);
1574 _mesa_ProgramUniform1d(GLuint program
, GLint location
, GLdouble v0
)
1576 GET_CURRENT_CONTEXT(ctx
);
1577 struct gl_shader_program
*shProg
=
1578 _mesa_lookup_shader_program_err(ctx
, program
,
1579 "glProgramUniform1d");
1580 _mesa_uniform(location
, 1, &v0
, ctx
, shProg
, GLSL_TYPE_DOUBLE
, 1);
1584 _mesa_ProgramUniform2d(GLuint program
, GLint location
, GLdouble v0
, GLdouble v1
)
1586 GET_CURRENT_CONTEXT(ctx
);
1588 struct gl_shader_program
*shProg
;
1591 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform2d");
1592 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_DOUBLE
, 2);
1596 _mesa_ProgramUniform3d(GLuint program
, GLint location
, GLdouble v0
, GLdouble v1
,
1599 GET_CURRENT_CONTEXT(ctx
);
1601 struct gl_shader_program
*shProg
;
1605 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform3d");
1606 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_DOUBLE
, 3);
1610 _mesa_ProgramUniform4d(GLuint program
, GLint location
, GLdouble v0
, GLdouble v1
,
1611 GLdouble v2
, GLdouble v3
)
1613 GET_CURRENT_CONTEXT(ctx
);
1615 struct gl_shader_program
*shProg
;
1620 shProg
= _mesa_lookup_shader_program_err(ctx
, program
, "glProgramUniform4d");
1621 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_DOUBLE
, 4);
1625 _mesa_ProgramUniform1dv(GLuint program
, GLint location
, GLsizei count
,
1626 const GLdouble
* value
)
1628 GET_CURRENT_CONTEXT(ctx
);
1629 struct gl_shader_program
*shProg
=
1630 _mesa_lookup_shader_program_err(ctx
, program
,
1631 "glProgramUniform1dv");
1632 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_DOUBLE
, 1);
1636 _mesa_ProgramUniform2dv(GLuint program
, GLint location
, GLsizei count
,
1637 const GLdouble
* value
)
1639 GET_CURRENT_CONTEXT(ctx
);
1640 struct gl_shader_program
*shProg
=
1641 _mesa_lookup_shader_program_err(ctx
, program
,
1642 "glProgramUniform2dv");
1643 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_DOUBLE
, 2);
1647 _mesa_ProgramUniform3dv(GLuint program
, GLint location
, GLsizei count
,
1648 const GLdouble
* value
)
1650 GET_CURRENT_CONTEXT(ctx
);
1651 struct gl_shader_program
*shProg
=
1652 _mesa_lookup_shader_program_err(ctx
, program
,
1653 "glProgramUniform3dv");
1654 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_DOUBLE
, 3);
1658 _mesa_ProgramUniform4dv(GLuint program
, GLint location
, GLsizei count
,
1659 const GLdouble
* value
)
1661 GET_CURRENT_CONTEXT(ctx
);
1662 struct gl_shader_program
*shProg
=
1663 _mesa_lookup_shader_program_err(ctx
, program
,
1664 "glProgramUniform4dv");
1665 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_DOUBLE
, 4);
1669 _mesa_ProgramUniformMatrix2dv(GLuint program
, GLint location
, GLsizei count
,
1670 GLboolean transpose
, const GLdouble
* value
)
1672 GET_CURRENT_CONTEXT(ctx
);
1673 struct gl_shader_program
*shProg
=
1674 _mesa_lookup_shader_program_err(ctx
, program
,
1675 "glProgramUniformMatrix2dv");
1676 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1677 ctx
, shProg
, 2, 2, GLSL_TYPE_DOUBLE
);
1681 _mesa_ProgramUniformMatrix3dv(GLuint program
, GLint location
, GLsizei count
,
1682 GLboolean transpose
, const GLdouble
* value
)
1684 GET_CURRENT_CONTEXT(ctx
);
1685 struct gl_shader_program
*shProg
=
1686 _mesa_lookup_shader_program_err(ctx
, program
,
1687 "glProgramUniformMatrix3dv");
1688 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1689 ctx
, shProg
, 3, 3, GLSL_TYPE_DOUBLE
);
1693 _mesa_ProgramUniformMatrix4dv(GLuint program
, GLint location
, GLsizei count
,
1694 GLboolean transpose
, const GLdouble
* value
)
1696 GET_CURRENT_CONTEXT(ctx
);
1697 struct gl_shader_program
*shProg
=
1698 _mesa_lookup_shader_program_err(ctx
, program
,
1699 "glProgramUniformMatrix4dv");
1700 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1701 ctx
, shProg
, 4, 4, GLSL_TYPE_DOUBLE
);
1705 _mesa_ProgramUniformMatrix2x3dv(GLuint program
, GLint location
, GLsizei count
,
1706 GLboolean transpose
, const GLdouble
* value
)
1708 GET_CURRENT_CONTEXT(ctx
);
1709 struct gl_shader_program
*shProg
=
1710 _mesa_lookup_shader_program_err(ctx
, program
,
1711 "glProgramUniformMatrix2x3dv");
1712 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1713 ctx
, shProg
, 2, 3, GLSL_TYPE_DOUBLE
);
1717 _mesa_ProgramUniformMatrix3x2dv(GLuint program
, GLint location
, GLsizei count
,
1718 GLboolean transpose
, const GLdouble
* value
)
1720 GET_CURRENT_CONTEXT(ctx
);
1721 struct gl_shader_program
*shProg
=
1722 _mesa_lookup_shader_program_err(ctx
, program
,
1723 "glProgramUniformMatrix3x2dv");
1724 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1725 ctx
, shProg
, 3, 2, GLSL_TYPE_DOUBLE
);
1729 _mesa_ProgramUniformMatrix2x4dv(GLuint program
, GLint location
, GLsizei count
,
1730 GLboolean transpose
, const GLdouble
* value
)
1732 GET_CURRENT_CONTEXT(ctx
);
1733 struct gl_shader_program
*shProg
=
1734 _mesa_lookup_shader_program_err(ctx
, program
,
1735 "glProgramUniformMatrix2x4dv");
1736 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1737 ctx
, shProg
, 2, 4, GLSL_TYPE_DOUBLE
);
1741 _mesa_ProgramUniformMatrix4x2dv(GLuint program
, GLint location
, GLsizei count
,
1742 GLboolean transpose
, const GLdouble
* value
)
1744 GET_CURRENT_CONTEXT(ctx
);
1745 struct gl_shader_program
*shProg
=
1746 _mesa_lookup_shader_program_err(ctx
, program
,
1747 "glProgramUniformMatrix4x2dv");
1748 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1749 ctx
, shProg
, 4, 2, GLSL_TYPE_DOUBLE
);
1753 _mesa_ProgramUniformMatrix3x4dv(GLuint program
, GLint location
, GLsizei count
,
1754 GLboolean transpose
, const GLdouble
* value
)
1756 GET_CURRENT_CONTEXT(ctx
);
1757 struct gl_shader_program
*shProg
=
1758 _mesa_lookup_shader_program_err(ctx
, program
,
1759 "glProgramUniformMatrix3x4dv");
1760 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1761 ctx
, shProg
, 3, 4, GLSL_TYPE_DOUBLE
);
1765 _mesa_ProgramUniformMatrix4x3dv(GLuint program
, GLint location
, GLsizei count
,
1766 GLboolean transpose
, const GLdouble
* value
)
1768 GET_CURRENT_CONTEXT(ctx
);
1769 struct gl_shader_program
*shProg
=
1770 _mesa_lookup_shader_program_err(ctx
, program
,
1771 "glProgramUniformMatrix4x3dv");
1772 _mesa_uniform_matrix(location
, count
, transpose
, value
,
1773 ctx
, shProg
, 4, 3, GLSL_TYPE_DOUBLE
);
1777 _mesa_Uniform1i64ARB(GLint location
, GLint64 v0
)
1779 GET_CURRENT_CONTEXT(ctx
);
1780 _mesa_uniform(location
, 1, &v0
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT64
, 1);
1784 _mesa_Uniform2i64ARB(GLint location
, GLint64 v0
, GLint64 v1
)
1786 GET_CURRENT_CONTEXT(ctx
);
1790 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT64
, 2);
1794 _mesa_Uniform3i64ARB(GLint location
, GLint64 v0
, GLint64 v1
, GLint64 v2
)
1796 GET_CURRENT_CONTEXT(ctx
);
1801 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT64
, 3);
1805 _mesa_Uniform4i64ARB(GLint location
, GLint64 v0
, GLint64 v1
, GLint64 v2
, GLint64 v3
)
1807 GET_CURRENT_CONTEXT(ctx
);
1813 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT64
, 4);
1817 _mesa_Uniform1i64vARB(GLint location
, GLsizei count
, const GLint64
*value
)
1819 GET_CURRENT_CONTEXT(ctx
);
1820 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT64
, 1);
1824 _mesa_Uniform2i64vARB(GLint location
, GLsizei count
, const GLint64
*value
)
1826 GET_CURRENT_CONTEXT(ctx
);
1827 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT64
, 2);
1831 _mesa_Uniform3i64vARB(GLint location
, GLsizei count
, const GLint64
*value
)
1833 GET_CURRENT_CONTEXT(ctx
);
1834 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT64
, 3);
1838 _mesa_Uniform4i64vARB(GLint location
, GLsizei count
, const GLint64
*value
)
1840 GET_CURRENT_CONTEXT(ctx
);
1841 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_INT64
, 4);
1845 _mesa_Uniform1ui64ARB(GLint location
, GLuint64 v0
)
1847 GET_CURRENT_CONTEXT(ctx
);
1848 _mesa_uniform(location
, 1, &v0
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT64
, 1);
1852 _mesa_Uniform2ui64ARB(GLint location
, GLuint64 v0
, GLuint64 v1
)
1854 GET_CURRENT_CONTEXT(ctx
);
1858 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT64
, 2);
1862 _mesa_Uniform3ui64ARB(GLint location
, GLuint64 v0
, GLuint64 v1
, GLuint64 v2
)
1864 GET_CURRENT_CONTEXT(ctx
);
1869 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT64
, 3);
1873 _mesa_Uniform4ui64ARB(GLint location
, GLuint64 v0
, GLuint64 v1
, GLuint64 v2
, GLuint64 v3
)
1875 GET_CURRENT_CONTEXT(ctx
);
1881 _mesa_uniform(location
, 1, v
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT64
, 4);
1885 _mesa_Uniform1ui64vARB(GLint location
, GLsizei count
, const GLuint64
*value
)
1887 GET_CURRENT_CONTEXT(ctx
);
1888 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT64
, 1);
1892 _mesa_Uniform2ui64vARB(GLint location
, GLsizei count
, const GLuint64
*value
)
1894 GET_CURRENT_CONTEXT(ctx
);
1895 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT64
, 2);
1899 _mesa_Uniform3ui64vARB(GLint location
, GLsizei count
, const GLuint64
*value
)
1901 GET_CURRENT_CONTEXT(ctx
);
1902 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT64
, 3);
1906 _mesa_Uniform4ui64vARB(GLint location
, GLsizei count
, const GLuint64
*value
)
1908 GET_CURRENT_CONTEXT(ctx
);
1909 _mesa_uniform(location
, count
, value
, ctx
, ctx
->_Shader
->ActiveProgram
, GLSL_TYPE_UINT64
, 4);
1912 /* DSA entrypoints */
1914 _mesa_ProgramUniform1i64ARB(GLuint program
, GLint location
, GLint64 v0
)
1916 GET_CURRENT_CONTEXT(ctx
);
1917 struct gl_shader_program
*shProg
=
1918 _mesa_lookup_shader_program_err(ctx
, program
,
1919 "glProgramUniform1i64ARB");
1920 _mesa_uniform(location
, 1, &v0
, ctx
, shProg
, GLSL_TYPE_INT64
, 1);
1924 _mesa_ProgramUniform2i64ARB(GLuint program
, GLint location
, GLint64 v0
, GLint64 v1
)
1926 GET_CURRENT_CONTEXT(ctx
);
1927 struct gl_shader_program
*shProg
=
1928 _mesa_lookup_shader_program_err(ctx
, program
,
1929 "glProgramUniform2i64ARB");
1933 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_INT64
, 2);
1937 _mesa_ProgramUniform3i64ARB(GLuint program
, GLint location
, GLint64 v0
, GLint64 v1
, GLint64 v2
)
1939 GET_CURRENT_CONTEXT(ctx
);
1940 struct gl_shader_program
*shProg
=
1941 _mesa_lookup_shader_program_err(ctx
, program
,
1942 "glProgramUniform3i64ARB");
1947 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_INT64
, 3);
1951 _mesa_ProgramUniform4i64ARB(GLuint program
, GLint location
, GLint64 v0
, GLint64 v1
, GLint64 v2
, GLint64 v3
)
1953 GET_CURRENT_CONTEXT(ctx
);
1954 struct gl_shader_program
*shProg
=
1955 _mesa_lookup_shader_program_err(ctx
, program
,
1956 "glProgramUniform4i64ARB");
1962 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_INT64
, 4);
1966 _mesa_ProgramUniform1i64vARB(GLuint program
, GLint location
, GLsizei count
, const GLint64
*value
)
1968 GET_CURRENT_CONTEXT(ctx
);
1969 struct gl_shader_program
*shProg
=
1970 _mesa_lookup_shader_program_err(ctx
, program
,
1971 "glProgramUniform1i64vARB");
1972 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_INT64
, 1);
1976 _mesa_ProgramUniform2i64vARB(GLuint program
, GLint location
, GLsizei count
, const GLint64
*value
)
1978 GET_CURRENT_CONTEXT(ctx
);
1979 struct gl_shader_program
*shProg
=
1980 _mesa_lookup_shader_program_err(ctx
, program
,
1981 "glProgramUniform2i64vARB");
1982 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_INT64
, 2);
1986 _mesa_ProgramUniform3i64vARB(GLuint program
, GLint location
, GLsizei count
, const GLint64
*value
)
1988 GET_CURRENT_CONTEXT(ctx
);
1989 struct gl_shader_program
*shProg
=
1990 _mesa_lookup_shader_program_err(ctx
, program
,
1991 "glProgramUniform3i64vARB");
1992 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_INT64
, 3);
1996 _mesa_ProgramUniform4i64vARB(GLuint program
, GLint location
, GLsizei count
, const GLint64
*value
)
1998 GET_CURRENT_CONTEXT(ctx
);
1999 struct gl_shader_program
*shProg
=
2000 _mesa_lookup_shader_program_err(ctx
, program
,
2001 "glProgramUniform4i64vARB");
2002 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_INT64
, 4);
2006 _mesa_ProgramUniform1ui64ARB(GLuint program
, GLint location
, GLuint64 v0
)
2008 GET_CURRENT_CONTEXT(ctx
);
2009 struct gl_shader_program
*shProg
=
2010 _mesa_lookup_shader_program_err(ctx
, program
,
2011 "glProgramUniform1ui64ARB");
2012 _mesa_uniform(location
, 1, &v0
, ctx
, shProg
, GLSL_TYPE_UINT64
, 1);
2016 _mesa_ProgramUniform2ui64ARB(GLuint program
, GLint location
, GLuint64 v0
, GLuint64 v1
)
2018 GET_CURRENT_CONTEXT(ctx
);
2019 struct gl_shader_program
*shProg
=
2020 _mesa_lookup_shader_program_err(ctx
, program
,
2021 "glProgramUniform2ui64ARB");
2025 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_UINT64
, 2);
2029 _mesa_ProgramUniform3ui64ARB(GLuint program
, GLint location
, GLuint64 v0
, GLuint64 v1
, GLuint64 v2
)
2031 GET_CURRENT_CONTEXT(ctx
);
2032 struct gl_shader_program
*shProg
=
2033 _mesa_lookup_shader_program_err(ctx
, program
,
2034 "glProgramUniform3ui64ARB");
2039 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_UINT64
, 3);
2043 _mesa_ProgramUniform4ui64ARB(GLuint program
, GLint location
, GLuint64 v0
, GLuint64 v1
, GLuint64 v2
, GLuint64 v3
)
2045 GET_CURRENT_CONTEXT(ctx
);
2046 struct gl_shader_program
*shProg
=
2047 _mesa_lookup_shader_program_err(ctx
, program
,
2048 "glProgramUniform4ui64ARB");
2054 _mesa_uniform(location
, 1, v
, ctx
, shProg
, GLSL_TYPE_UINT64
, 4);
2058 _mesa_ProgramUniform1ui64vARB(GLuint program
, GLint location
, GLsizei count
, const GLuint64
*value
)
2060 GET_CURRENT_CONTEXT(ctx
);
2061 struct gl_shader_program
*shProg
=
2062 _mesa_lookup_shader_program_err(ctx
, program
,
2063 "glProgramUniform1ui64vARB");
2064 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_UINT64
, 1);
2068 _mesa_ProgramUniform2ui64vARB(GLuint program
, GLint location
, GLsizei count
, const GLuint64
*value
)
2070 GET_CURRENT_CONTEXT(ctx
);
2071 struct gl_shader_program
*shProg
=
2072 _mesa_lookup_shader_program_err(ctx
, program
,
2073 "glProgramUniform2ui64vARB");
2074 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_UINT64
, 2);
2078 _mesa_ProgramUniform3ui64vARB(GLuint program
, GLint location
, GLsizei count
, const GLuint64
*value
)
2080 GET_CURRENT_CONTEXT(ctx
);
2081 struct gl_shader_program
*shProg
=
2082 _mesa_lookup_shader_program_err(ctx
, program
,
2083 "glProgramUniform3ui64vARB");
2084 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_UINT64
, 3);
2088 _mesa_ProgramUniform4ui64vARB(GLuint program
, GLint location
, GLsizei count
, const GLuint64
*value
)
2090 GET_CURRENT_CONTEXT(ctx
);
2091 struct gl_shader_program
*shProg
=
2092 _mesa_lookup_shader_program_err(ctx
, program
,
2093 "glProgramUniform4ui64vARB");
2094 _mesa_uniform(location
, count
, value
, ctx
, shProg
, GLSL_TYPE_UINT64
, 4);