+ if (!ctx->Extensions.ARB_uniform_buffer_object) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glGetUniformBlockIndex");
+ return GL_INVALID_INDEX;
+ }
+
+ shProg = _mesa_lookup_shader_program_err(ctx, program,
+ "glGetUniformBlockIndex");
+ if (!shProg)
+ return GL_INVALID_INDEX;
+
+ struct gl_program_resource *res =
+ _mesa_program_resource_find_name(shProg, GL_UNIFORM_BLOCK,
+ uniformBlockName, NULL);
+ if (!res)
+ return GL_INVALID_INDEX;
+
+ return _mesa_program_resource_index(shProg, res);
+}
+
+void GLAPIENTRY
+_mesa_GetUniformIndices(GLuint program,
+ GLsizei uniformCount,
+ const GLchar * const *uniformNames,
+ GLuint *uniformIndices)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GLsizei i;
+ struct gl_shader_program *shProg;
+
+ if (!ctx->Extensions.ARB_uniform_buffer_object) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glGetUniformIndices");
+ return;
+ }
+
+ shProg = _mesa_lookup_shader_program_err(ctx, program,
+ "glGetUniformIndices");
+ if (!shProg)
+ return;
+
+ if (uniformCount < 0) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glGetUniformIndices(uniformCount < 0)");
+ return;
+ }
+
+ for (i = 0; i < uniformCount; i++) {
+ struct gl_program_resource *res =
+ _mesa_program_resource_find_name(shProg, GL_UNIFORM, uniformNames[i],
+ NULL);
+ uniformIndices[i] = _mesa_program_resource_index(shProg, res);
+ }
+}
+
+void GLAPIENTRY
+_mesa_UniformBlockBinding(GLuint program,
+ GLuint uniformBlockIndex,
+ GLuint uniformBlockBinding)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_shader_program *shProg;
+
+ if (!ctx->Extensions.ARB_uniform_buffer_object) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glUniformBlockBinding");
+ return;
+ }
+
+ shProg = _mesa_lookup_shader_program_err(ctx, program,
+ "glUniformBlockBinding");
+ if (!shProg)
+ return;
+
+ if (uniformBlockIndex >= shProg->data->NumUniformBlocks) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glUniformBlockBinding(block index %u >= %u)",
+ uniformBlockIndex, shProg->data->NumUniformBlocks);
+ return;
+ }
+
+ if (uniformBlockBinding >= ctx->Const.MaxUniformBufferBindings) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glUniformBlockBinding(block binding %u >= %u)",
+ uniformBlockBinding, ctx->Const.MaxUniformBufferBindings);
+ return;
+ }
+
+ if (shProg->data->UniformBlocks[uniformBlockIndex].Binding !=
+ uniformBlockBinding) {
+
+ FLUSH_VERTICES(ctx, 0);
+ ctx->NewDriverState |= ctx->DriverFlags.NewUniformBuffer;
+
+ shProg->data->UniformBlocks[uniformBlockIndex].Binding =
+ uniformBlockBinding;
+ }
+}
+
+void GLAPIENTRY
+_mesa_ShaderStorageBlockBinding(GLuint program,
+ GLuint shaderStorageBlockIndex,
+ GLuint shaderStorageBlockBinding)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_shader_program *shProg;
+
+ if (!ctx->Extensions.ARB_shader_storage_buffer_object) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glShaderStorageBlockBinding");
+ return;
+ }
+
+ shProg = _mesa_lookup_shader_program_err(ctx, program,
+ "glShaderStorageBlockBinding");
+ if (!shProg)
+ return;
+
+ if (shaderStorageBlockIndex >= shProg->data->NumShaderStorageBlocks) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glShaderStorageBlockBinding(block index %u >= %u)",
+ shaderStorageBlockIndex,
+ shProg->data->NumShaderStorageBlocks);
+ return;
+ }
+
+ if (shaderStorageBlockBinding >= ctx->Const.MaxShaderStorageBufferBindings) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glShaderStorageBlockBinding(block binding %u >= %u)",
+ shaderStorageBlockBinding,
+ ctx->Const.MaxShaderStorageBufferBindings);
+ return;
+ }
+
+ if (shProg->data->ShaderStorageBlocks[shaderStorageBlockIndex].Binding !=
+ shaderStorageBlockBinding) {
+
+ FLUSH_VERTICES(ctx, 0);
+ ctx->NewDriverState |= ctx->DriverFlags.NewShaderStorageBuffer;
+
+ shProg->data->ShaderStorageBlocks[shaderStorageBlockIndex].Binding =
+ shaderStorageBlockBinding;
+ }
+}
+
+/**
+ * Generic program resource property query.
+ */
+static void
+mesa_bufferiv(struct gl_shader_program *shProg, GLenum type,
+ GLuint index, GLenum pname, GLint *params, const char *caller)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_program_resource *res =
+ _mesa_program_resource_find_index(shProg, type, index);
+
+ if (!res) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "%s(bufferindex %d)", caller, index);
+ return;
+ }
+
+ switch (pname) {
+ case GL_UNIFORM_BLOCK_BINDING:
+ case GL_ATOMIC_COUNTER_BUFFER_BINDING:
+ _mesa_program_resource_prop(shProg, res, index, GL_BUFFER_BINDING,
+ params, caller);
+ return;
+ case GL_UNIFORM_BLOCK_DATA_SIZE:
+ case GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE:
+ _mesa_program_resource_prop(shProg, res, index, GL_BUFFER_DATA_SIZE,
+ params, caller);
+ return;
+ case GL_UNIFORM_BLOCK_NAME_LENGTH:
+ _mesa_program_resource_prop(shProg, res, index, GL_NAME_LENGTH,
+ params, caller);
+ return;
+ case GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS:
+ case GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS:
+ _mesa_program_resource_prop(shProg, res, index, GL_NUM_ACTIVE_VARIABLES,
+ params, caller);
+ return;
+ case GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:
+ case GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES:
+ _mesa_program_resource_prop(shProg, res, index, GL_ACTIVE_VARIABLES,
+ params, caller);
+ return;
+ case GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:
+ case GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER:
+ _mesa_program_resource_prop(shProg, res, index,
+ GL_REFERENCED_BY_VERTEX_SHADER, params,
+ caller);
+ return;
+
+ case GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER:
+ case GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER:
+ _mesa_program_resource_prop(shProg, res, index,
+ GL_REFERENCED_BY_TESS_CONTROL_SHADER, params,
+ caller);
+ return;
+
+ case GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER:
+ case GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER:
+ _mesa_program_resource_prop(shProg, res, index,
+ GL_REFERENCED_BY_TESS_EVALUATION_SHADER, params,
+ caller);
+ return;
+
+ case GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER:
+ case GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER:
+ _mesa_program_resource_prop(shProg, res, index,
+ GL_REFERENCED_BY_GEOMETRY_SHADER, params,
+ caller);
+ return;
+ case GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:
+ case GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER:
+ _mesa_program_resource_prop(shProg, res, index,
+ GL_REFERENCED_BY_FRAGMENT_SHADER, params,
+ caller);
+ return;
+ case GL_UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER:
+ case GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER:
+ _mesa_program_resource_prop(shProg, res, index,
+ GL_REFERENCED_BY_COMPUTE_SHADER, params,
+ caller);
+ return;
+ default:
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "%s(pname 0x%x (%s))", caller, pname,
+ _mesa_enum_to_string(pname));
+ return;
+ }
+}
+
+
+void GLAPIENTRY
+_mesa_GetActiveUniformBlockiv(GLuint program,
+ GLuint uniformBlockIndex,
+ GLenum pname,
+ GLint *params)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_shader_program *shProg;
+
+ if (!ctx->Extensions.ARB_uniform_buffer_object) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glGetActiveUniformBlockiv");
+ return;
+ }
+
+ shProg = _mesa_lookup_shader_program_err(ctx, program,
+ "glGetActiveUniformBlockiv");
+ if (!shProg)
+ return;
+
+ mesa_bufferiv(shProg, GL_UNIFORM_BLOCK, uniformBlockIndex, pname, params,
+ "glGetActiveUniformBlockiv");
+}
+
+void GLAPIENTRY
+_mesa_GetActiveUniformBlockName(GLuint program,
+ GLuint uniformBlockIndex,
+ GLsizei bufSize,
+ GLsizei *length,
+ GLchar *uniformBlockName)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_shader_program *shProg;
+
+ if (!ctx->Extensions.ARB_uniform_buffer_object) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glGetActiveUniformBlockiv");
+ return;
+ }
+
+ if (bufSize < 0) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glGetActiveUniformBlockName(bufSize %d < 0)",
+ bufSize);
+ return;
+ }
+
+ shProg = _mesa_lookup_shader_program_err(ctx, program,
+ "glGetActiveUniformBlockiv");
+ if (!shProg)
+ return;
+
+ if (uniformBlockName)
+ _mesa_get_program_resource_name(shProg, GL_UNIFORM_BLOCK,
+ uniformBlockIndex, bufSize, length,
+ uniformBlockName,
+ "glGetActiveUniformBlockName");
+}
+
+void GLAPIENTRY
+_mesa_GetActiveUniformName(GLuint program, GLuint uniformIndex,
+ GLsizei bufSize, GLsizei *length,
+ GLchar *uniformName)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_shader_program *shProg;
+
+ if (!ctx->Extensions.ARB_uniform_buffer_object) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glGetActiveUniformName");
+ return;
+ }
+
+ if (bufSize < 0) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glGetActiveUniformName(bufSize %d < 0)",
+ bufSize);
+ return;
+ }
+
+ shProg = _mesa_lookup_shader_program_err(ctx, program, "glGetActiveUniformName");
+
+ if (!shProg)
+ return;
+
+ _mesa_get_program_resource_name(shProg, GL_UNIFORM, uniformIndex, bufSize,
+ length, uniformName, "glGetActiveUniformName");
+}
+
+void GLAPIENTRY
+_mesa_GetActiveAtomicCounterBufferiv(GLuint program, GLuint bufferIndex,
+ GLenum pname, GLint *params)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_shader_program *shProg;
+
+ if (!ctx->Extensions.ARB_shader_atomic_counters) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glGetActiveAtomicCounterBufferiv");
+ return;
+ }
+
+ shProg = _mesa_lookup_shader_program_err(ctx, program,
+ "glGetActiveAtomicCounterBufferiv");
+ if (!shProg)
+ return;
+
+ mesa_bufferiv(shProg, GL_ATOMIC_COUNTER_BUFFER, bufferIndex, pname, params,
+ "glGetActiveAtomicCounterBufferiv");
+}
+
+void GLAPIENTRY
+_mesa_Uniform1d(GLint location, GLdouble v0)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_uniform(location, 1, &v0, ctx, ctx->_Shader->ActiveProgram, GLSL_TYPE_DOUBLE, 1);
+}
+
+void GLAPIENTRY
+_mesa_Uniform2d(GLint location, GLdouble v0, GLdouble v1)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GLdouble v[2];
+ v[0] = v0;
+ v[1] = v1;
+ _mesa_uniform(location, 1, v, ctx, ctx->_Shader->ActiveProgram, GLSL_TYPE_DOUBLE, 2);
+}
+
+void GLAPIENTRY
+_mesa_Uniform3d(GLint location, GLdouble v0, GLdouble v1, GLdouble v2)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GLdouble v[3];
+ v[0] = v0;
+ v[1] = v1;
+ v[2] = v2;
+ _mesa_uniform(location, 1, v, ctx, ctx->_Shader->ActiveProgram, GLSL_TYPE_DOUBLE, 3);
+}
+
+void GLAPIENTRY
+_mesa_Uniform4d(GLint location, GLdouble v0, GLdouble v1, GLdouble v2,
+ GLdouble v3)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GLdouble v[4];
+ v[0] = v0;
+ v[1] = v1;
+ v[2] = v2;
+ v[3] = v3;
+ _mesa_uniform(location, 1, v, ctx, ctx->_Shader->ActiveProgram, GLSL_TYPE_DOUBLE, 4);
+}
+
+void GLAPIENTRY
+_mesa_Uniform1dv(GLint location, GLsizei count, const GLdouble * value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_uniform(location, count, value, ctx, ctx->_Shader->ActiveProgram, GLSL_TYPE_DOUBLE, 1);
+}
+
+void GLAPIENTRY
+_mesa_Uniform2dv(GLint location, GLsizei count, const GLdouble * value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_uniform(location, count, value, ctx, ctx->_Shader->ActiveProgram, GLSL_TYPE_DOUBLE, 2);
+}
+
+void GLAPIENTRY
+_mesa_Uniform3dv(GLint location, GLsizei count, const GLdouble * value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_uniform(location, count, value, ctx, ctx->_Shader->ActiveProgram, GLSL_TYPE_DOUBLE, 3);
+}
+
+void GLAPIENTRY
+_mesa_Uniform4dv(GLint location, GLsizei count, const GLdouble * value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_uniform(location, count, value, ctx, ctx->_Shader->ActiveProgram, GLSL_TYPE_DOUBLE, 4);
+}
+
+void GLAPIENTRY
+_mesa_UniformMatrix2dv(GLint location, GLsizei count, GLboolean transpose,
+ const GLdouble * value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_uniform_matrix(location, count, transpose, value,
+ ctx, ctx->_Shader->ActiveProgram, 2, 2, GLSL_TYPE_DOUBLE);
+}
+
+void GLAPIENTRY
+_mesa_UniformMatrix3dv(GLint location, GLsizei count, GLboolean transpose,
+ const GLdouble * value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_uniform_matrix(location, count, transpose, value,
+ ctx, ctx->_Shader->ActiveProgram, 3, 3, GLSL_TYPE_DOUBLE);
+}
+
+void GLAPIENTRY
+_mesa_UniformMatrix4dv(GLint location, GLsizei count, GLboolean transpose,
+ const GLdouble * value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_uniform_matrix(location, count, transpose, value,
+ ctx, ctx->_Shader->ActiveProgram, 4, 4, GLSL_TYPE_DOUBLE);
+}
+
+void GLAPIENTRY
+_mesa_UniformMatrix2x3dv(GLint location, GLsizei count, GLboolean transpose,
+ const GLdouble *value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_uniform_matrix(location, count, transpose, value,
+ ctx, ctx->_Shader->ActiveProgram, 2, 3, GLSL_TYPE_DOUBLE);
+}
+
+void GLAPIENTRY
+_mesa_UniformMatrix3x2dv(GLint location, GLsizei count, GLboolean transpose,
+ const GLdouble *value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_uniform_matrix(location, count, transpose, value,
+ ctx, ctx->_Shader->ActiveProgram, 3, 2, GLSL_TYPE_DOUBLE);
+}
+
+void GLAPIENTRY
+_mesa_UniformMatrix2x4dv(GLint location, GLsizei count, GLboolean transpose,
+ const GLdouble *value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_uniform_matrix(location, count, transpose, value,
+ ctx, ctx->_Shader->ActiveProgram, 2, 4, GLSL_TYPE_DOUBLE);
+}
+
+void GLAPIENTRY
+_mesa_UniformMatrix4x2dv(GLint location, GLsizei count, GLboolean transpose,
+ const GLdouble *value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_uniform_matrix(location, count, transpose, value,
+ ctx, ctx->_Shader->ActiveProgram, 4, 2, GLSL_TYPE_DOUBLE);
+}
+
+void GLAPIENTRY
+_mesa_UniformMatrix3x4dv(GLint location, GLsizei count, GLboolean transpose,
+ const GLdouble *value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_uniform_matrix(location, count, transpose, value,
+ ctx, ctx->_Shader->ActiveProgram, 3, 4, GLSL_TYPE_DOUBLE);
+}
+
+void GLAPIENTRY
+_mesa_UniformMatrix4x3dv(GLint location, GLsizei count, GLboolean transpose,
+ const GLdouble *value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_uniform_matrix(location, count, transpose, value,
+ ctx, ctx->_Shader->ActiveProgram, 4, 3, GLSL_TYPE_DOUBLE);
+}
+
+void GLAPIENTRY
+_mesa_ProgramUniform1d(GLuint program, GLint location, GLdouble v0)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_shader_program *shProg =
+ _mesa_lookup_shader_program_err(ctx, program,
+ "glProgramUniform1d");
+ _mesa_uniform(location, 1, &v0, ctx, shProg, GLSL_TYPE_DOUBLE, 1);
+}
+
+void GLAPIENTRY
+_mesa_ProgramUniform2d(GLuint program, GLint location, GLdouble v0, GLdouble v1)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GLdouble v[2];
+ struct gl_shader_program *shProg;
+ v[0] = v0;
+ v[1] = v1;
+ shProg = _mesa_lookup_shader_program_err(ctx, program, "glProgramUniform2d");
+ _mesa_uniform(location, 1, v, ctx, shProg, GLSL_TYPE_DOUBLE, 2);
+}
+
+void GLAPIENTRY
+_mesa_ProgramUniform3d(GLuint program, GLint location, GLdouble v0, GLdouble v1,
+ GLdouble v2)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GLdouble v[3];
+ struct gl_shader_program *shProg;
+ v[0] = v0;
+ v[1] = v1;
+ v[2] = v2;
+ shProg = _mesa_lookup_shader_program_err(ctx, program, "glProgramUniform3d");
+ _mesa_uniform(location, 1, v, ctx, shProg, GLSL_TYPE_DOUBLE, 3);
+}
+
+void GLAPIENTRY
+_mesa_ProgramUniform4d(GLuint program, GLint location, GLdouble v0, GLdouble v1,
+ GLdouble v2, GLdouble v3)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GLdouble v[4];
+ struct gl_shader_program *shProg;
+ v[0] = v0;
+ v[1] = v1;
+ v[2] = v2;
+ v[3] = v3;
+ shProg = _mesa_lookup_shader_program_err(ctx, program, "glProgramUniform4d");
+ _mesa_uniform(location, 1, v, ctx, shProg, GLSL_TYPE_DOUBLE, 4);
+}
+
+void GLAPIENTRY
+_mesa_ProgramUniform1dv(GLuint program, GLint location, GLsizei count,
+ const GLdouble * value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_shader_program *shProg =
+ _mesa_lookup_shader_program_err(ctx, program,
+ "glProgramUniform1dv");
+ _mesa_uniform(location, count, value, ctx, shProg, GLSL_TYPE_DOUBLE, 1);
+}
+
+void GLAPIENTRY
+_mesa_ProgramUniform2dv(GLuint program, GLint location, GLsizei count,
+ const GLdouble * value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_shader_program *shProg =
+ _mesa_lookup_shader_program_err(ctx, program,
+ "glProgramUniform2dv");
+ _mesa_uniform(location, count, value, ctx, shProg, GLSL_TYPE_DOUBLE, 2);
+}
+
+void GLAPIENTRY
+_mesa_ProgramUniform3dv(GLuint program, GLint location, GLsizei count,
+ const GLdouble * value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_shader_program *shProg =
+ _mesa_lookup_shader_program_err(ctx, program,
+ "glProgramUniform3dv");
+ _mesa_uniform(location, count, value, ctx, shProg, GLSL_TYPE_DOUBLE, 3);
+}
+
+void GLAPIENTRY
+_mesa_ProgramUniform4dv(GLuint program, GLint location, GLsizei count,
+ const GLdouble * value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_shader_program *shProg =
+ _mesa_lookup_shader_program_err(ctx, program,
+ "glProgramUniform4dv");
+ _mesa_uniform(location, count, value, ctx, shProg, GLSL_TYPE_DOUBLE, 4);
+}
+
+void GLAPIENTRY
+_mesa_ProgramUniformMatrix2dv(GLuint program, GLint location, GLsizei count,
+ GLboolean transpose, const GLdouble * value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_shader_program *shProg =
+ _mesa_lookup_shader_program_err(ctx, program,
+ "glProgramUniformMatrix2dv");
+ _mesa_uniform_matrix(location, count, transpose, value,
+ ctx, shProg, 2, 2, GLSL_TYPE_DOUBLE);
+}
+
+void GLAPIENTRY
+_mesa_ProgramUniformMatrix3dv(GLuint program, GLint location, GLsizei count,
+ GLboolean transpose, const GLdouble * value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_shader_program *shProg =
+ _mesa_lookup_shader_program_err(ctx, program,
+ "glProgramUniformMatrix3dv");
+ _mesa_uniform_matrix(location, count, transpose, value,
+ ctx, shProg, 3, 3, GLSL_TYPE_DOUBLE);
+}
+
+void GLAPIENTRY
+_mesa_ProgramUniformMatrix4dv(GLuint program, GLint location, GLsizei count,
+ GLboolean transpose, const GLdouble * value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_shader_program *shProg =
+ _mesa_lookup_shader_program_err(ctx, program,
+ "glProgramUniformMatrix4dv");
+ _mesa_uniform_matrix(location, count, transpose, value,
+ ctx, shProg, 4, 4, GLSL_TYPE_DOUBLE);
+}
+
+void GLAPIENTRY
+_mesa_ProgramUniformMatrix2x3dv(GLuint program, GLint location, GLsizei count,
+ GLboolean transpose, const GLdouble * value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_shader_program *shProg =
+ _mesa_lookup_shader_program_err(ctx, program,
+ "glProgramUniformMatrix2x3dv");
+ _mesa_uniform_matrix(location, count, transpose, value,
+ ctx, shProg, 2, 3, GLSL_TYPE_DOUBLE);
+}
+
+void GLAPIENTRY
+_mesa_ProgramUniformMatrix3x2dv(GLuint program, GLint location, GLsizei count,
+ GLboolean transpose, const GLdouble * value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_shader_program *shProg =
+ _mesa_lookup_shader_program_err(ctx, program,
+ "glProgramUniformMatrix3x2dv");
+ _mesa_uniform_matrix(location, count, transpose, value,
+ ctx, shProg, 3, 2, GLSL_TYPE_DOUBLE);
+}
+
+void GLAPIENTRY
+_mesa_ProgramUniformMatrix2x4dv(GLuint program, GLint location, GLsizei count,
+ GLboolean transpose, const GLdouble * value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_shader_program *shProg =
+ _mesa_lookup_shader_program_err(ctx, program,
+ "glProgramUniformMatrix2x4dv");
+ _mesa_uniform_matrix(location, count, transpose, value,
+ ctx, shProg, 2, 4, GLSL_TYPE_DOUBLE);
+}
+
+void GLAPIENTRY
+_mesa_ProgramUniformMatrix4x2dv(GLuint program, GLint location, GLsizei count,
+ GLboolean transpose, const GLdouble * value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_shader_program *shProg =
+ _mesa_lookup_shader_program_err(ctx, program,
+ "glProgramUniformMatrix4x2dv");
+ _mesa_uniform_matrix(location, count, transpose, value,
+ ctx, shProg, 4, 2, GLSL_TYPE_DOUBLE);
+}
+
+void GLAPIENTRY
+_mesa_ProgramUniformMatrix3x4dv(GLuint program, GLint location, GLsizei count,
+ GLboolean transpose, const GLdouble * value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_shader_program *shProg =
+ _mesa_lookup_shader_program_err(ctx, program,
+ "glProgramUniformMatrix3x4dv");
+ _mesa_uniform_matrix(location, count, transpose, value,
+ ctx, shProg, 3, 4, GLSL_TYPE_DOUBLE);
+}
+
+void GLAPIENTRY
+_mesa_ProgramUniformMatrix4x3dv(GLuint program, GLint location, GLsizei count,
+ GLboolean transpose, const GLdouble * value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_shader_program *shProg =
+ _mesa_lookup_shader_program_err(ctx, program,
+ "glProgramUniformMatrix4x3dv");
+ _mesa_uniform_matrix(location, count, transpose, value,
+ ctx, shProg, 4, 3, GLSL_TYPE_DOUBLE);
+}
+
+void GLAPIENTRY
+_mesa_Uniform1i64ARB(GLint location, GLint64 v0)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_uniform(location, 1, &v0, ctx, ctx->_Shader->ActiveProgram, GLSL_TYPE_INT64, 1);
+}
+
+void GLAPIENTRY
+_mesa_Uniform2i64ARB(GLint location, GLint64 v0, GLint64 v1)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ int64_t v[2];
+ v[0] = v0;
+ v[1] = v1;
+ _mesa_uniform(location, 1, v, ctx, ctx->_Shader->ActiveProgram, GLSL_TYPE_INT64, 2);
+}
+
+void GLAPIENTRY
+_mesa_Uniform3i64ARB(GLint location, GLint64 v0, GLint64 v1, GLint64 v2)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ int64_t v[3];
+ v[0] = v0;
+ v[1] = v1;
+ v[2] = v2;
+ _mesa_uniform(location, 1, v, ctx, ctx->_Shader->ActiveProgram, GLSL_TYPE_INT64, 3);
+}
+
+void GLAPIENTRY
+_mesa_Uniform4i64ARB(GLint location, GLint64 v0, GLint64 v1, GLint64 v2, GLint64 v3)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ int64_t v[4];
+ v[0] = v0;
+ v[1] = v1;
+ v[2] = v2;
+ v[3] = v3;
+ _mesa_uniform(location, 1, v, ctx, ctx->_Shader->ActiveProgram, GLSL_TYPE_INT64, 4);
+}
+
+void GLAPIENTRY
+_mesa_Uniform1i64vARB(GLint location, GLsizei count, const GLint64 *value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_uniform(location, count, value, ctx, ctx->_Shader->ActiveProgram, GLSL_TYPE_INT64, 1);
+}
+
+void GLAPIENTRY
+_mesa_Uniform2i64vARB(GLint location, GLsizei count, const GLint64 *value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_uniform(location, count, value, ctx, ctx->_Shader->ActiveProgram, GLSL_TYPE_INT64, 2);
+}
+
+void GLAPIENTRY
+_mesa_Uniform3i64vARB(GLint location, GLsizei count, const GLint64 *value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_uniform(location, count, value, ctx, ctx->_Shader->ActiveProgram, GLSL_TYPE_INT64, 3);
+}
+
+void GLAPIENTRY
+_mesa_Uniform4i64vARB(GLint location, GLsizei count, const GLint64 *value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_uniform(location, count, value, ctx, ctx->_Shader->ActiveProgram, GLSL_TYPE_INT64, 4);
+}
+
+void GLAPIENTRY
+_mesa_Uniform1ui64ARB(GLint location, GLuint64 v0)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_uniform(location, 1, &v0, ctx, ctx->_Shader->ActiveProgram, GLSL_TYPE_UINT64, 1);
+}
+
+void GLAPIENTRY
+_mesa_Uniform2ui64ARB(GLint location, GLuint64 v0, GLuint64 v1)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ uint64_t v[2];
+ v[0] = v0;
+ v[1] = v1;
+ _mesa_uniform(location, 1, v, ctx, ctx->_Shader->ActiveProgram, GLSL_TYPE_UINT64, 2);
+}
+
+void GLAPIENTRY
+_mesa_Uniform3ui64ARB(GLint location, GLuint64 v0, GLuint64 v1, GLuint64 v2)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ uint64_t v[3];
+ v[0] = v0;
+ v[1] = v1;
+ v[2] = v2;
+ _mesa_uniform(location, 1, v, ctx, ctx->_Shader->ActiveProgram, GLSL_TYPE_UINT64, 3);
+}
+
+void GLAPIENTRY
+_mesa_Uniform4ui64ARB(GLint location, GLuint64 v0, GLuint64 v1, GLuint64 v2, GLuint64 v3)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ uint64_t v[4];
+ v[0] = v0;
+ v[1] = v1;
+ v[2] = v2;
+ v[3] = v3;
+ _mesa_uniform(location, 1, v, ctx, ctx->_Shader->ActiveProgram, GLSL_TYPE_UINT64, 4);
+}
+
+void GLAPIENTRY
+_mesa_Uniform1ui64vARB(GLint location, GLsizei count, const GLuint64 *value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_uniform(location, count, value, ctx, ctx->_Shader->ActiveProgram, GLSL_TYPE_UINT64, 1);
+}
+
+void GLAPIENTRY
+_mesa_Uniform2ui64vARB(GLint location, GLsizei count, const GLuint64 *value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_uniform(location, count, value, ctx, ctx->_Shader->ActiveProgram, GLSL_TYPE_UINT64, 2);
+}
+
+void GLAPIENTRY
+_mesa_Uniform3ui64vARB(GLint location, GLsizei count, const GLuint64 *value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_uniform(location, count, value, ctx, ctx->_Shader->ActiveProgram, GLSL_TYPE_UINT64, 3);
+}
+
+void GLAPIENTRY
+_mesa_Uniform4ui64vARB(GLint location, GLsizei count, const GLuint64 *value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_uniform(location, count, value, ctx, ctx->_Shader->ActiveProgram, GLSL_TYPE_UINT64, 4);
+}
+
+/* DSA entrypoints */
+void GLAPIENTRY
+_mesa_ProgramUniform1i64ARB(GLuint program, GLint location, GLint64 v0)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_shader_program *shProg =
+ _mesa_lookup_shader_program_err(ctx, program,
+ "glProgramUniform1i64ARB");
+ _mesa_uniform(location, 1, &v0, ctx, shProg, GLSL_TYPE_INT64, 1);
+}
+
+void GLAPIENTRY
+_mesa_ProgramUniform2i64ARB(GLuint program, GLint location, GLint64 v0, GLint64 v1)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_shader_program *shProg =
+ _mesa_lookup_shader_program_err(ctx, program,
+ "glProgramUniform2i64ARB");
+ int64_t v[2];
+ v[0] = v0;
+ v[1] = v1;
+ _mesa_uniform(location, 1, v, ctx, shProg, GLSL_TYPE_INT64, 2);
+}
+
+void GLAPIENTRY
+_mesa_ProgramUniform3i64ARB(GLuint program, GLint location, GLint64 v0, GLint64 v1, GLint64 v2)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_shader_program *shProg =
+ _mesa_lookup_shader_program_err(ctx, program,
+ "glProgramUniform3i64ARB");
+ int64_t v[3];
+ v[0] = v0;
+ v[1] = v1;
+ v[2] = v2;
+ _mesa_uniform(location, 1, v, ctx, shProg, GLSL_TYPE_INT64, 3);
+}
+
+void GLAPIENTRY
+_mesa_ProgramUniform4i64ARB(GLuint program, GLint location, GLint64 v0, GLint64 v1, GLint64 v2, GLint64 v3)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_shader_program *shProg =
+ _mesa_lookup_shader_program_err(ctx, program,
+ "glProgramUniform4i64ARB");
+ int64_t v[4];
+ v[0] = v0;
+ v[1] = v1;
+ v[2] = v2;
+ v[3] = v3;
+ _mesa_uniform(location, 1, v, ctx, shProg, GLSL_TYPE_INT64, 4);
+}
+
+void GLAPIENTRY
+_mesa_ProgramUniform1i64vARB(GLuint program, GLint location, GLsizei count, const GLint64 *value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_shader_program *shProg =
+ _mesa_lookup_shader_program_err(ctx, program,
+ "glProgramUniform1i64vARB");
+ _mesa_uniform(location, count, value, ctx, shProg, GLSL_TYPE_INT64, 1);
+}
+
+void GLAPIENTRY
+_mesa_ProgramUniform2i64vARB(GLuint program, GLint location, GLsizei count, const GLint64 *value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_shader_program *shProg =
+ _mesa_lookup_shader_program_err(ctx, program,
+ "glProgramUniform2i64vARB");
+ _mesa_uniform(location, count, value, ctx, shProg, GLSL_TYPE_INT64, 2);
+}
+
+void GLAPIENTRY
+_mesa_ProgramUniform3i64vARB(GLuint program, GLint location, GLsizei count, const GLint64 *value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_shader_program *shProg =
+ _mesa_lookup_shader_program_err(ctx, program,
+ "glProgramUniform3i64vARB");
+ _mesa_uniform(location, count, value, ctx, shProg, GLSL_TYPE_INT64, 3);
+}
+
+void GLAPIENTRY
+_mesa_ProgramUniform4i64vARB(GLuint program, GLint location, GLsizei count, const GLint64 *value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_shader_program *shProg =
+ _mesa_lookup_shader_program_err(ctx, program,
+ "glProgramUniform4i64vARB");
+ _mesa_uniform(location, count, value, ctx, shProg, GLSL_TYPE_INT64, 4);
+}
+
+void GLAPIENTRY
+_mesa_ProgramUniform1ui64ARB(GLuint program, GLint location, GLuint64 v0)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_shader_program *shProg =
+ _mesa_lookup_shader_program_err(ctx, program,
+ "glProgramUniform1ui64ARB");
+ _mesa_uniform(location, 1, &v0, ctx, shProg, GLSL_TYPE_UINT64, 1);
+}
+
+void GLAPIENTRY
+_mesa_ProgramUniform2ui64ARB(GLuint program, GLint location, GLuint64 v0, GLuint64 v1)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_shader_program *shProg =
+ _mesa_lookup_shader_program_err(ctx, program,
+ "glProgramUniform2ui64ARB");
+ uint64_t v[2];
+ v[0] = v0;
+ v[1] = v1;
+ _mesa_uniform(location, 1, v, ctx, shProg, GLSL_TYPE_UINT64, 2);
+}
+
+void GLAPIENTRY
+_mesa_ProgramUniform3ui64ARB(GLuint program, GLint location, GLuint64 v0, GLuint64 v1, GLuint64 v2)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_shader_program *shProg =
+ _mesa_lookup_shader_program_err(ctx, program,
+ "glProgramUniform3ui64ARB");
+ uint64_t v[3];
+ v[0] = v0;
+ v[1] = v1;
+ v[2] = v2;
+ _mesa_uniform(location, 1, v, ctx, shProg, GLSL_TYPE_UINT64, 3);
+}
+
+void GLAPIENTRY
+_mesa_ProgramUniform4ui64ARB(GLuint program, GLint location, GLuint64 v0, GLuint64 v1, GLuint64 v2, GLuint64 v3)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_shader_program *shProg =
+ _mesa_lookup_shader_program_err(ctx, program,
+ "glProgramUniform4ui64ARB");
+ uint64_t v[4];
+ v[0] = v0;
+ v[1] = v1;
+ v[2] = v2;
+ v[3] = v3;
+ _mesa_uniform(location, 1, v, ctx, shProg, GLSL_TYPE_UINT64, 4);
+}
+
+void GLAPIENTRY
+_mesa_ProgramUniform1ui64vARB(GLuint program, GLint location, GLsizei count, const GLuint64 *value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_shader_program *shProg =
+ _mesa_lookup_shader_program_err(ctx, program,
+ "glProgramUniform1ui64vARB");
+ _mesa_uniform(location, count, value, ctx, shProg, GLSL_TYPE_UINT64, 1);
+}
+
+void GLAPIENTRY
+_mesa_ProgramUniform2ui64vARB(GLuint program, GLint location, GLsizei count, const GLuint64 *value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_shader_program *shProg =
+ _mesa_lookup_shader_program_err(ctx, program,
+ "glProgramUniform2ui64vARB");
+ _mesa_uniform(location, count, value, ctx, shProg, GLSL_TYPE_UINT64, 2);
+}
+
+void GLAPIENTRY
+_mesa_ProgramUniform3ui64vARB(GLuint program, GLint location, GLsizei count, const GLuint64 *value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_shader_program *shProg =
+ _mesa_lookup_shader_program_err(ctx, program,
+ "glProgramUniform3ui64vARB");
+ _mesa_uniform(location, count, value, ctx, shProg, GLSL_TYPE_UINT64, 3);
+}
+
+void GLAPIENTRY
+_mesa_ProgramUniform4ui64vARB(GLuint program, GLint location, GLsizei count, const GLuint64 *value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_shader_program *shProg =
+ _mesa_lookup_shader_program_err(ctx, program,
+ "glProgramUniform4ui64vARB");
+ _mesa_uniform(location, count, value, ctx, shProg, GLSL_TYPE_UINT64, 4);