mesa/sso: Add extension entry points for GL_ARB_separate_shader_objects
authorGregory Hainaut <gregory.hainaut@gmail.com>
Fri, 3 May 2013 17:44:05 +0000 (19:44 +0200)
committerIan Romanick <ian.d.romanick@intel.com>
Fri, 21 Feb 2014 23:41:02 +0000 (15:41 -0800)
Nothings implemented yet but glProgramUniform* which are mostly a
copy/paste of the older function glUniform*

I create dedicated pipelineobj.[ch] file that will contains function
related to the "new" pipeline container object.

V2: formatting improvement

V3:
* indentation fix
* Update copyright
* Add a comment on ProgramParameteri already present in another extension
* Remove TODO, will be readded on correct patch

V4 (idr):
* Fix dispatch_sanity unit test
* Make extension string available in core profiles (instead of just
  compatibility).
* Trivial reformating

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
12 files changed:
src/mapi/glapi/gen/ARB_separate_shader_objects.xml [new file with mode: 0644]
src/mapi/glapi/gen/Makefile.am
src/mapi/glapi/gen/gl_API.xml
src/mapi/glapi/gen/gl_genexec.py
src/mesa/Makefile.sources
src/mesa/main/pipelineobj.c [new file with mode: 0644]
src/mesa/main/pipelineobj.h [new file with mode: 0644]
src/mesa/main/shaderapi.c
src/mesa/main/shaderapi.h
src/mesa/main/tests/dispatch_sanity.cpp
src/mesa/main/uniforms.c
src/mesa/main/uniforms.h

diff --git a/src/mapi/glapi/gen/ARB_separate_shader_objects.xml b/src/mapi/glapi/gen/ARB_separate_shader_objects.xml
new file mode 100644 (file)
index 0000000..f996456
--- /dev/null
@@ -0,0 +1,401 @@
+<?xml version="1.0"?>
+<!DOCTYPE OpenGLAPI SYSTEM "gl_API.dtd">
+
+<!-- Note: no GLX protocol info yet. -->
+
+<OpenGLAPI>
+   <category name="ARB_separate_shader_objects" number="97">
+      <enum   name="ACTIVE_PROGRAM"                               value="0x8259"/>
+      <enum   name="PROGRAM_PIPELINE_BINDING"                     value="0x825A"/>
+      <enum   name="VERTEX_SHADER_BIT"                            value="0x00000001"/>
+      <enum   name="FRAGMENT_SHADER_BIT"                          value="0x00000002"/>
+      <enum   name="GEOMETRY_SHADER_BIT"                          value="0x00000004"/>
+      <enum   name="TESS_CONTROL_SHADER_BIT"                      value="0x00000008"/>
+      <enum   name="TESS_EVALUATION_SHADER_BIT"                   value="0x00000010"/>
+      <enum   name="ALL_SHADER_BITS"                              value="0xFFFFFFFF"/>
+      <enum   name="PROGRAM_SEPARABLE"                            value="0x8258"/>
+
+      <function name="UseProgramStages" offset="assign">
+         <param name="pipeline" type="GLuint" />
+         <param name="stages" type="GLbitfield" />
+         <param name="program" type="GLuint" />
+      </function>
+      <function name="ActiveShaderProgram" offset="assign">
+         <param name="pipeline" type="GLuint" />
+         <param name="program" type="GLuint" />
+      </function>
+      <function name="CreateShaderProgramv" offset="assign">
+         <param name="type" type="GLenum" />
+         <param name="count" type="GLsizei" />
+         <param name="strings" type="const GLchar * const *" />
+         <return type="uint"/>
+      </function>
+      <function name="BindProgramPipeline" offset="assign">
+         <param name="pipeline" type="GLuint" />
+      </function>
+      <function name="DeleteProgramPipelines" offset="assign">
+         <param name="n" type="GLsizei" />
+         <param name="pipelines" type="const GLuint *" />
+      </function>
+      <function name="GenProgramPipelines" offset="assign">
+         <param name="n" type="GLsizei" />
+         <param name="pipelines" type="GLuint *" />
+      </function>
+      <function name="IsProgramPipeline" offset="assign">
+         <param name="pipeline" type="GLuint" />
+         <return type="GLboolean"/>
+      </function>
+      <!-- Function already included on ARB_get_program_binary.xml. Keep a commented
+      version here for completeness -->
+      <!--
+      <function name="ProgramParameteri" offset="assign" es2="3.0">
+         <param name="program" type="GLuint"/>
+         <param name="pname" type="GLenum"/>
+         <param name="value" type="GLint"/>
+      </function>
+      -->
+      <function name="GetProgramPipelineiv" offset="assign">
+         <param name="pipeline" type="GLuint" />
+         <param name="pname" type="GLenum" />
+         <param name="params" type="GLint *" />
+      </function>
+      <function name="ProgramUniform1i" offset="assign">
+         <param name="program" type="GLuint" />
+         <param name="location" type="GLint" />
+         <param name="x" type="GLint" />
+      </function>
+      <function name="ProgramUniform2i" offset="assign">
+         <param name="program" type="GLuint" />
+         <param name="location" type="GLint" />
+         <param name="x" type="GLint" />
+         <param name="y" type="GLint" />
+      </function>
+      <function name="ProgramUniform3i" offset="assign">
+         <param name="program" type="GLuint" />
+         <param name="location" type="GLint" />
+         <param name="x" type="GLint" />
+         <param name="y" type="GLint" />
+         <param name="z" type="GLint" />
+      </function>
+      <function name="ProgramUniform4i" offset="assign">
+         <param name="program" type="GLuint" />
+         <param name="location" type="GLint" />
+         <param name="x" type="GLint" />
+         <param name="y" type="GLint" />
+         <param name="z" type="GLint" />
+         <param name="w" type="GLint" />
+      </function>
+      <function name="ProgramUniform1ui" offset="assign">
+         <param name="program" type="GLuint" />
+         <param name="location" type="GLint" />
+         <param name="x" type="GLuint" />
+      </function>
+      <function name="ProgramUniform2ui" offset="assign">
+         <param name="program" type="GLuint" />
+         <param name="location" type="GLint" />
+         <param name="x" type="GLuint" />
+         <param name="y" type="GLuint" />
+      </function>
+      <function name="ProgramUniform3ui" offset="assign">
+         <param name="program" type="GLuint" />
+         <param name="location" type="GLint" />
+         <param name="x" type="GLuint" />
+         <param name="y" type="GLuint" />
+         <param name="z" type="GLuint" />
+      </function>
+      <function name="ProgramUniform4ui" offset="assign">
+         <param name="program" type="GLuint" />
+         <param name="location" type="GLint" />
+         <param name="x" type="GLuint" />
+         <param name="y" type="GLuint" />
+         <param name="z" type="GLuint" />
+         <param name="w" type="GLuint" />
+      </function>
+      <function name="ProgramUniform1f" offset="assign">
+         <param name="program" type="GLuint" />
+         <param name="location" type="GLint" />
+         <param name="x" type="GLfloat" />
+      </function>
+      <function name="ProgramUniform2f" offset="assign">
+         <param name="program" type="GLuint" />
+         <param name="location" type="GLint" />
+         <param name="x" type="GLfloat" />
+         <param name="y" type="GLfloat" />
+      </function>
+      <function name="ProgramUniform3f" offset="assign">
+         <param name="program" type="GLuint" />
+         <param name="location" type="GLint" />
+         <param name="x" type="GLfloat" />
+         <param name="y" type="GLfloat" />
+         <param name="z" type="GLfloat" />
+      </function>
+      <function name="ProgramUniform4f" offset="assign">
+         <param name="program" type="GLuint" />
+         <param name="location" type="GLint" />
+         <param name="x" type="GLfloat" />
+         <param name="y" type="GLfloat" />
+         <param name="z" type="GLfloat" />
+         <param name="w" type="GLfloat" />
+      </function>
+      <function name="ProgramUniform1iv" offset="assign">
+         <param name="program" type="GLuint" />
+         <param name="location" type="GLint" />
+         <param name="count" type="GLsizei" />
+         <param name="value" type="const GLint *" />
+      </function>
+      <function name="ProgramUniform2iv" offset="assign">
+         <param name="program" type="GLuint" />
+         <param name="location" type="GLint" />
+         <param name="count" type="GLsizei" />
+         <param name="value" type="const GLint *" />
+      </function>
+      <function name="ProgramUniform3iv" offset="assign">
+         <param name="program" type="GLuint" />
+         <param name="location" type="GLint" />
+         <param name="count" type="GLsizei" />
+         <param name="value" type="const GLint *" />
+      </function>
+      <function name="ProgramUniform4iv" offset="assign">
+         <param name="program" type="GLuint" />
+         <param name="location" type="GLint" />
+         <param name="count" type="GLsizei" />
+         <param name="value" type="const GLint *" />
+      </function>
+      <function name="ProgramUniform1uiv" offset="assign">
+         <param name="program" type="GLuint" />
+         <param name="location" type="GLint" />
+         <param name="count" type="GLsizei" />
+         <param name="value" type="const GLuint *" />
+      </function>
+      <function name="ProgramUniform2uiv" offset="assign">
+         <param name="program" type="GLuint" />
+         <param name="location" type="GLint" />
+         <param name="count" type="GLsizei" />
+         <param name="value" type="const GLuint *" />
+      </function>
+      <function name="ProgramUniform3uiv" offset="assign">
+         <param name="program" type="GLuint" />
+         <param name="location" type="GLint" />
+         <param name="count" type="GLsizei" />
+         <param name="value" type="const GLuint *" />
+      </function>
+      <function name="ProgramUniform4uiv" offset="assign">
+         <param name="program" type="GLuint" />
+         <param name="location" type="GLint" />
+         <param name="count" type="GLsizei" />
+         <param name="value" type="const GLuint *" />
+      </function>
+      <function name="ProgramUniform1fv" offset="assign">
+         <param name="program" type="GLuint" />
+         <param name="location" type="GLint" />
+         <param name="count" type="GLsizei" />
+         <param name="value" type="const GLfloat *" />
+      </function>
+      <function name="ProgramUniform2fv" offset="assign">
+         <param name="program" type="GLuint" />
+         <param name="location" type="GLint" />
+         <param name="count" type="GLsizei" />
+         <param name="value" type="const GLfloat *" />
+      </function>
+      <function name="ProgramUniform3fv" offset="assign">
+         <param name="program" type="GLuint" />
+         <param name="location" type="GLint" />
+         <param name="count" type="GLsizei" />
+         <param name="value" type="const GLfloat *" />
+      </function>
+      <function name="ProgramUniform4fv" offset="assign">
+         <param name="program" type="GLuint" />
+         <param name="location" type="GLint" />
+         <param name="count" type="GLsizei" />
+         <param name="value" type="const GLfloat *" />
+      </function>
+      <function name="ProgramUniformMatrix2fv" offset="assign">
+         <param name="program" type="GLuint" />
+         <param name="location" type="GLint" />
+         <param name="count" type="GLsizei" />
+         <param name="transpose" type="GLboolean" />
+         <param name="value" type="const GLfloat *" />
+      </function>
+      <function name="ProgramUniformMatrix3fv" offset="assign">
+         <param name="program" type="GLuint" />
+         <param name="location" type="GLint" />
+         <param name="count" type="GLsizei" />
+         <param name="transpose" type="GLboolean" />
+         <param name="value" type="const GLfloat *" />
+      </function>
+      <function name="ProgramUniformMatrix4fv" offset="assign">
+         <param name="program" type="GLuint" />
+         <param name="location" type="GLint" />
+         <param name="count" type="GLsizei" />
+         <param name="transpose" type="GLboolean" />
+         <param name="value" type="const GLfloat *" />
+      </function>
+      <function name="ProgramUniformMatrix2x3fv" offset="assign">
+         <param name="program" type="GLuint" />
+         <param name="location" type="GLint" />
+         <param name="count" type="GLsizei" />
+         <param name="transpose" type="GLboolean" />
+         <param name="value" type="const GLfloat *" />
+      </function>
+      <function name="ProgramUniformMatrix3x2fv" offset="assign">
+         <param name="program" type="GLuint" />
+         <param name="location" type="GLint" />
+         <param name="count" type="GLsizei" />
+         <param name="transpose" type="GLboolean" />
+         <param name="value" type="const GLfloat *" />
+      </function>
+      <function name="ProgramUniformMatrix2x4fv" offset="assign">
+         <param name="program" type="GLuint" />
+         <param name="location" type="GLint" />
+         <param name="count" type="GLsizei" />
+         <param name="transpose" type="GLboolean" />
+         <param name="value" type="const GLfloat *" />
+      </function>
+      <function name="ProgramUniformMatrix4x2fv" offset="assign">
+         <param name="program" type="GLuint" />
+         <param name="location" type="GLint" />
+         <param name="count" type="GLsizei" />
+         <param name="transpose" type="GLboolean" />
+         <param name="value" type="const GLfloat *" />
+      </function>
+      <function name="ProgramUniformMatrix3x4fv" offset="assign">
+         <param name="program" type="GLuint" />
+         <param name="location" type="GLint" />
+         <param name="count" type="GLsizei" />
+         <param name="transpose" type="GLboolean" />
+         <param name="value" type="const GLfloat *" />
+      </function>
+      <function name="ProgramUniformMatrix4x3fv" offset="assign">
+         <param name="program" type="GLuint" />
+         <param name="location" type="GLint" />
+         <param name="count" type="GLsizei" />
+         <param name="transpose" type="GLboolean" />
+         <param name="value" type="const GLfloat *" />
+      </function>
+      <function name="ValidateProgramPipeline" offset="assign">
+         <param name="pipeline" type="GLuint" />
+      </function>
+      <function name="GetProgramPipelineInfoLog" offset="assign">
+         <param name="pipeline" type="GLuint" />
+         <param name="bufSize" type="GLsizei" />
+         <param name="length" type="GLsizei *" />
+         <param name="infoLog" type="GLchar *" />
+      </function>
+
+      <!-- depends on GL_ARB_gpu_shader_fp64
+      <function name="ProgramUniform1d" offset="assign">
+         <param name="program" type="GLuint" />
+         <param name="location" type="GLint" />
+         <param name="x" type="GLdouble" />
+      </function>
+      <function name="ProgramUniform2d" offset="assign">
+         <param name="program" type="GLuint" />
+         <param name="location" type="GLint" />
+         <param name="x" type="GLdouble" />
+         <param name="y" type="GLdouble" />
+      </function>
+      <function name="ProgramUniform3d" offset="assign">
+         <param name="program" type="GLuint" />
+         <param name="location" type="GLint" />
+         <param name="x" type="GLdouble" />
+         <param name="y" type="GLdouble" />
+         <param name="z" type="GLdouble" />
+      </function>
+      <function name="ProgramUniform4d" offset="assign">
+         <param name="program" type="GLuint" />
+         <param name="location" type="GLint" />
+         <param name="x" type="GLdouble" />
+         <param name="y" type="GLdouble" />
+         <param name="z" type="GLdouble" />
+         <param name="w" type="GLdouble" />
+      </function>
+      <function name="ProgramUniformMatrix2x3dv" offset="assign">
+         <param name="program" type="GLuint" />
+         <param name="location" type="GLint" />
+         <param name="count" type="GLsizei" />
+         <param name="transpose" type="GLboolean" />
+         <param name="value" type="const GLdouble *" />
+      </function>
+      <function name="ProgramUniformMatrix3x2dv" offset="assign">
+         <param name="program" type="GLuint" />
+         <param name="location" type="GLint" />
+         <param name="count" type="GLsizei" />
+         <param name="transpose" type="GLboolean" />
+         <param name="value" type="const GLdouble *" />
+      </function>
+      <function name="ProgramUniformMatrix2x4dv" offset="assign">
+         <param name="program" type="GLuint" />
+         <param name="location" type="GLint" />
+         <param name="count" type="GLsizei" />
+         <param name="transpose" type="GLboolean" />
+         <param name="value" type="const GLdouble *" />
+      </function>
+      <function name="ProgramUniformMatrix4x2dv" offset="assign">
+         <param name="program" type="GLuint" />
+         <param name="location" type="GLint" />
+         <param name="count" type="GLsizei" />
+         <param name="transpose" type="GLboolean" />
+         <param name="value" type="const GLdouble *" />
+      </function>
+      <function name="ProgramUniformMatrix3x4dv" offset="assign">
+         <param name="program" type="GLuint" />
+         <param name="location" type="GLint" />
+         <param name="count" type="GLsizei" />
+         <param name="transpose" type="GLboolean" />
+         <param name="value" type="const GLdouble *" />
+      </function>
+      <function name="ProgramUniformMatrix4x3dv" offset="assign">
+         <param name="program" type="GLuint" />
+         <param name="location" type="GLint" />
+         <param name="count" type="GLsizei" />
+         <param name="transpose" type="GLboolean" />
+         <param name="value" type="const GLdouble *" />
+      </function>
+      <function name="ProgramUniformMatrix2dv" offset="assign">
+         <param name="program" type="GLuint" />
+         <param name="location" type="GLint" />
+         <param name="count" type="GLsizei" />
+         <param name="transpose" type="GLboolean" />
+         <param name="value" type="const GLdouble *" />
+      </function>
+      <function name="ProgramUniformMatrix3dv" offset="assign">
+         <param name="program" type="GLuint" />
+         <param name="location" type="GLint" />
+         <param name="count" type="GLsizei" />
+         <param name="transpose" type="GLboolean" />
+         <param name="value" type="const GLdouble *" />
+      </function>
+      <function name="ProgramUniformMatrix4dv" offset="assign">
+         <param name="program" type="GLuint" />
+         <param name="location" type="GLint" />
+         <param name="count" type="GLsizei" />
+         <param name="transpose" type="GLboolean" />
+         <param name="value" type="const GLdouble *" />
+      </function>
+      <function name="ProgramUniform1dv" offset="assign">
+         <param name="program" type="GLuint" />
+         <param name="location" type="GLint" />
+         <param name="count" type="GLsizei" />
+         <param name="value" type="const GLdouble *" />
+      </function>
+      <function name="ProgramUniform2dv" offset="assign">
+         <param name="program" type="GLuint" />
+         <param name="location" type="GLint" />
+         <param name="count" type="GLsizei" />
+         <param name="value" type="const GLdouble *" />
+      </function>
+      <function name="ProgramUniform3dv" offset="assign">
+         <param name="program" type="GLuint" />
+         <param name="location" type="GLint" />
+         <param name="count" type="GLsizei" />
+         <param name="value" type="const GLdouble *" />
+      </function>
+      <function name="ProgramUniform4dv" offset="assign">
+         <param name="program" type="GLuint" />
+         <param name="location" type="GLint" />
+         <param name="count" type="GLsizei" />
+         <param name="value" type="const GLdouble *" />
+      </function>
+      -->
+   </category>
+</OpenGLAPI>
index 9e6fe52612f65dedff6f8bc4c196438b9ac04957..7b3c118f043b60972ed439dbfb7075cfb6cf44b4 100644 (file)
@@ -113,6 +113,7 @@ API_XML = \
        ARB_sample_shading.xml \
        ARB_sampler_objects.xml \
        ARB_seamless_cube_map.xml \
+       ARB_separate_shader_objects.xml \
        ARB_shader_atomic_counters.xml \
        ARB_shader_image_load_store.xml \
        ARB_sync.xml \
index 4ef754d5c9d7a7f123e522023e0e7ce02fe25f03..c710ea8c81fdaed83415e31c1a656c80375c358a 100644 (file)
   </function>
 </category>
 
-<!-- ARB extensions #95...#108 -->
+<!-- ARB extensions #95...#96 -->
+
+<xi:include href="ARB_separate_shader_objects.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+
+<!-- ARB extensions #98...#108 -->
 
 <xi:include href="ARB_ES2_compatibility.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
 
index 1765a51ad26cd00efe01525fb9122c7537cc980b..4609193977d428ba149cc0a8aed6bccfeeb88088 100644 (file)
@@ -86,6 +86,7 @@ header = """/**
 #include "main/multisample.h"
 #include "main/objectlabel.h"
 #include "main/performance_monitor.h"
+#include "main/pipelineobj.h"
 #include "main/pixel.h"
 #include "main/pixelstore.h"
 #include "main/points.h"
index 1ce94deaa073bba97eb438be8dc252cb06d1dedc..f6f4062a491c46398b08bc9c510802ef3f3e9f0f 100644 (file)
@@ -69,6 +69,7 @@ MAIN_FILES = \
        $(SRCDIR)main/pack.c \
        $(SRCDIR)main/pbo.c \
        $(SRCDIR)main/performance_monitor.c \
+       $(SRCDIR)main/pipelineobj.c \
        $(SRCDIR)main/pixel.c \
        $(SRCDIR)main/pixelstore.c \
        $(SRCDIR)main/pixeltransfer.c \
diff --git a/src/mesa/main/pipelineobj.c b/src/mesa/main/pipelineobj.c
new file mode 100644 (file)
index 0000000..7454619
--- /dev/null
@@ -0,0 +1,133 @@
+/*
+ * Mesa 3-D graphics library
+ *
+ * Copyright Â© 2013 Gregory Hainaut <gregory.hainaut@gmail.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+/**
+ * \file pipelineobj.c
+ * \author Hainaut Gregory <gregory.hainaut@gmail.com>
+ *
+ * Implementation of pipeline object related API functions. Based on
+ * GL_ARB_separate_shader_objects extension.
+ *
+ */
+
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/dispatch.h"
+#include "main/enums.h"
+#include "main/hash.h"
+#include "main/mtypes.h"
+#include "main/pipelineobj.h"
+#include "main/shaderapi.h"
+#include "main/shaderobj.h"
+#include "main/transformfeedback.h"
+#include "main/uniforms.h"
+#include "program/program.h"
+#include "program/prog_parameter.h"
+#include "ralloc.h"
+#include <stdbool.h>
+#include "../glsl/glsl_parser_extras.h"
+#include "../glsl/ir_uniform.h"
+
+
+/**
+ * Bound program to severals stages of the pipeline
+ */
+void GLAPIENTRY
+_mesa_UseProgramStages(GLuint pipeline, GLbitfield stages, GLuint program)
+{
+}
+
+/**
+ * Use the named shader program for subsequent glUniform calls (if pipeline
+ * bound)
+ */
+void GLAPIENTRY
+_mesa_ActiveShaderProgram(GLuint pipeline, GLuint program)
+{
+}
+
+/**
+ * Make program of the pipeline current
+ */
+void GLAPIENTRY
+_mesa_BindProgramPipeline(GLuint pipeline)
+{
+}
+
+/**
+ * Delete a set of pipeline objects.
+ *
+ * \param n      Number of pipeline objects to delete.
+ * \param ids    pipeline of \c n pipeline object IDs.
+ */
+void GLAPIENTRY
+_mesa_DeleteProgramPipelines(GLsizei n, const GLuint *pipelines)
+{
+}
+
+/**
+ * Generate a set of unique pipeline object IDs and store them in \c pipelines.
+ * \param n       Number of IDs to generate.
+ * \param pipelines  pipeline of \c n locations to store the IDs.
+ */
+void GLAPIENTRY
+_mesa_GenProgramPipelines(GLsizei n, GLuint *pipelines)
+{
+}
+
+/**
+ * Determine if ID is the name of an pipeline object.
+ *
+ * \param id  ID of the potential pipeline object.
+ * \return  \c GL_TRUE if \c id is the name of a pipeline object,
+ *          \c GL_FALSE otherwise.
+ */
+GLboolean GLAPIENTRY
+_mesa_IsProgramPipeline(GLuint pipeline)
+{
+   return GL_FALSE;
+}
+
+/**
+ * glGetProgramPipelineiv() - get pipeline shader state.
+ */
+void GLAPIENTRY
+_mesa_GetProgramPipelineiv(GLuint pipeline, GLenum pname, GLint *params)
+{
+}
+
+/**
+ * Check compatibility of pipeline's program
+ */
+void GLAPIENTRY
+_mesa_ValidateProgramPipeline(GLuint pipeline)
+{
+}
+
+void GLAPIENTRY
+_mesa_GetProgramPipelineInfoLog(GLuint pipeline, GLsizei bufSize,
+                                GLsizei *length, GLchar *infoLog)
+{
+}
diff --git a/src/mesa/main/pipelineobj.h b/src/mesa/main/pipelineobj.h
new file mode 100644 (file)
index 0000000..56d32cc
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+ * Mesa 3-D graphics library
+ *
+ * Copyright Â© 2013 Gregory Hainaut <gregory.hainaut@gmail.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#ifndef PIPELINEOBJ_H
+#define PIPELINEOBJ_H
+
+#include "glheader.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct _glapi_table;
+struct gl_context;
+
+extern void GLAPIENTRY
+_mesa_UseProgramStages(GLuint pipeline, GLbitfield stages, GLuint program);
+
+extern void GLAPIENTRY
+_mesa_ActiveShaderProgram(GLuint pipeline, GLuint program);
+
+extern void GLAPIENTRY
+_mesa_BindProgramPipeline(GLuint pipeline);
+
+extern void GLAPIENTRY
+_mesa_DeleteProgramPipelines(GLsizei n, const GLuint *pipelines);
+
+extern void GLAPIENTRY
+_mesa_GenProgramPipelines(GLsizei n, GLuint *pipelines);
+
+extern GLboolean GLAPIENTRY
+_mesa_IsProgramPipeline(GLuint pipeline);
+
+extern void GLAPIENTRY
+_mesa_GetProgramPipelineiv(GLuint pipeline, GLenum pname, GLint *params);
+
+extern void GLAPIENTRY
+_mesa_ValidateProgramPipeline(GLuint pipeline);
+
+extern void GLAPIENTRY
+_mesa_GetProgramPipelineInfoLog(GLuint pipeline, GLsizei bufSize,
+                                GLsizei *length, GLchar *infoLog);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* PIPELINEOBJ_H */
index bf138149087ac8a83f943d393a3f28b494081682..3c946fe028c055f7adc1feba23edb18da33b1331 100644 (file)
@@ -1883,3 +1883,14 @@ _mesa_copy_linked_program_data(gl_shader_stage type,
       break;
    }
 }
+
+
+/**
+ * ARB_separate_shader_objects: Compile & Link Program
+ */
+GLuint GLAPIENTRY
+_mesa_CreateShaderProgramv(GLenum type, GLsizei count,
+                           const GLchar* const *strings)
+{
+   return 0;
+}
index 10f810caf5e8210e7c7c60b3c8b541801bd39cd2..109a802d104cb52cf500982e87399af7e0a67736 100644 (file)
@@ -219,6 +219,11 @@ extern bool
 _mesa_validate_shader_target(const struct gl_context *ctx, GLenum type);
 
 
+/* GL_ARB_separate_shader_objects */
+extern GLuint GLAPIENTRY
+_mesa_CreateShaderProgramv(GLenum type, GLsizei count,
+                           const GLchar* const *strings);
+
 #ifdef __cplusplus
 }
 #endif
index d8969e268b90bfac27e36f5e9609706dec8ab538..117a57096a974033cb6df3d9f06fc86dba7d10b5 100644 (file)
@@ -716,66 +716,66 @@ const struct function gl_core_functions_possible[] = {
    { "glGetProgramBinary", 43, -1 },
    { "glProgramBinary", 43, -1 },
    { "glProgramParameteri", 43, -1 },
-// { "glUseProgramStages", 43, -1 },                    // XXX: Add to xml
-// { "glActiveShaderProgram", 43, -1 },                 // XXX: Add to xml
-// { "glCreateShaderProgramv", 43, -1 },                // XXX: Add to xml
-// { "glBindProgramPipeline", 43, -1 },                 // XXX: Add to xml
-// { "glDeleteProgramPipelines", 43, -1 },              // XXX: Add to xml
-// { "glGenProgramPipelines", 43, -1 },                 // XXX: Add to xml
-// { "glIsProgramPipeline", 43, -1 },                   // XXX: Add to xml
-// { "glGetProgramPipelineiv", 43, -1 },                // XXX: Add to xml
-// { "glProgramUniform1i", 43, -1 },                    // XXX: Add to xml
-// { "glProgramUniform1iv", 43, -1 },                   // XXX: Add to xml
-// { "glProgramUniform1f", 43, -1 },                    // XXX: Add to xml
-// { "glProgramUniform1fv", 43, -1 },                   // XXX: Add to xml
+   { "glUseProgramStages", 43, -1 },
+   { "glActiveShaderProgram", 43, -1 },
+   { "glCreateShaderProgramv", 43, -1 },
+   { "glBindProgramPipeline", 43, -1 },
+   { "glDeleteProgramPipelines", 43, -1 },
+   { "glGenProgramPipelines", 43, -1 },
+   { "glIsProgramPipeline", 43, -1 },
+   { "glGetProgramPipelineiv", 43, -1 },
+   { "glProgramUniform1i", 43, -1 },
+   { "glProgramUniform1iv", 43, -1 },
+   { "glProgramUniform1f", 43, -1 },
+   { "glProgramUniform1fv", 43, -1 },
 // { "glProgramUniform1d", 43, -1 },                    // XXX: Add to xml
 // { "glProgramUniform1dv", 43, -1 },                   // XXX: Add to xml
-// { "glProgramUniform1ui", 43, -1 },                   // XXX: Add to xml
-// { "glProgramUniform1uiv", 43, -1 },                  // XXX: Add to xml
-// { "glProgramUniform2i", 43, -1 },                    // XXX: Add to xml
-// { "glProgramUniform2iv", 43, -1 },                   // XXX: Add to xml
-// { "glProgramUniform2f", 43, -1 },                    // XXX: Add to xml
-// { "glProgramUniform2fv", 43, -1 },                   // XXX: Add to xml
+   { "glProgramUniform1ui", 43, -1 },
+   { "glProgramUniform1uiv", 43, -1 },
+   { "glProgramUniform2i", 43, -1 },
+   { "glProgramUniform2iv", 43, -1 },
+   { "glProgramUniform2f", 43, -1 },
+   { "glProgramUniform2fv", 43, -1 },
 // { "glProgramUniform2d", 43, -1 },                    // XXX: Add to xml
 // { "glProgramUniform2dv", 43, -1 },                   // XXX: Add to xml
-// { "glProgramUniform2ui", 43, -1 },                   // XXX: Add to xml
-// { "glProgramUniform2uiv", 43, -1 },                  // XXX: Add to xml
-// { "glProgramUniform3i", 43, -1 },                    // XXX: Add to xml
-// { "glProgramUniform3iv", 43, -1 },                   // XXX: Add to xml
-// { "glProgramUniform3f", 43, -1 },                    // XXX: Add to xml
-// { "glProgramUniform3fv", 43, -1 },                   // XXX: Add to xml
+   { "glProgramUniform2ui", 43, -1 },
+   { "glProgramUniform2uiv", 43, -1 },
+   { "glProgramUniform3i", 43, -1 },
+   { "glProgramUniform3iv", 43, -1 },
+   { "glProgramUniform3f", 43, -1 },
+   { "glProgramUniform3fv", 43, -1 },
 // { "glProgramUniform3d", 43, -1 },                    // XXX: Add to xml
 // { "glProgramUniform3dv", 43, -1 },                   // XXX: Add to xml
-// { "glProgramUniform3ui", 43, -1 },                   // XXX: Add to xml
-// { "glProgramUniform3uiv", 43, -1 },                  // XXX: Add to xml
-// { "glProgramUniform4i", 43, -1 },                    // XXX: Add to xml
-// { "glProgramUniform4iv", 43, -1 },                   // XXX: Add to xml
-// { "glProgramUniform4f", 43, -1 },                    // XXX: Add to xml
-// { "glProgramUniform4fv", 43, -1 },                   // XXX: Add to xml
+   { "glProgramUniform3ui", 43, -1 },
+   { "glProgramUniform3uiv", 43, -1 },
+   { "glProgramUniform4i", 43, -1 },
+   { "glProgramUniform4iv", 43, -1 },
+   { "glProgramUniform4f", 43, -1 },
+   { "glProgramUniform4fv", 43, -1 },
 // { "glProgramUniform4d", 43, -1 },                    // XXX: Add to xml
 // { "glProgramUniform4dv", 43, -1 },                   // XXX: Add to xml
-// { "glProgramUniform4ui", 43, -1 },                   // XXX: Add to xml
-// { "glProgramUniform4uiv", 43, -1 },                  // XXX: Add to xml
-// { "glProgramUniformMatrix2fv", 43, -1 },             // XXX: Add to xml
-// { "glProgramUniformMatrix3fv", 43, -1 },             // XXX: Add to xml
-// { "glProgramUniformMatrix4fv", 43, -1 },             // XXX: Add to xml
+   { "glProgramUniform4ui", 43, -1 },
+   { "glProgramUniform4uiv", 43, -1 },
+   { "glProgramUniformMatrix2fv", 43, -1 },
+   { "glProgramUniformMatrix3fv", 43, -1 },
+   { "glProgramUniformMatrix4fv", 43, -1 },
 // { "glProgramUniformMatrix2dv", 43, -1 },             // XXX: Add to xml
 // { "glProgramUniformMatrix3dv", 43, -1 },             // XXX: Add to xml
 // { "glProgramUniformMatrix4dv", 43, -1 },             // XXX: Add to xml
-// { "glProgramUniformMatrix2x3fv", 43, -1 },           // XXX: Add to xml
-// { "glProgramUniformMatrix3x2fv", 43, -1 },           // XXX: Add to xml
-// { "glProgramUniformMatrix2x4fv", 43, -1 },           // XXX: Add to xml
-// { "glProgramUniformMatrix4x2fv", 43, -1 },           // XXX: Add to xml
-// { "glProgramUniformMatrix3x4fv", 43, -1 },           // XXX: Add to xml
-// { "glProgramUniformMatrix4x3fv", 43, -1 },           // XXX: Add to xml
+   { "glProgramUniformMatrix2x3fv", 43, -1 },
+   { "glProgramUniformMatrix3x2fv", 43, -1 },
+   { "glProgramUniformMatrix2x4fv", 43, -1 },
+   { "glProgramUniformMatrix4x2fv", 43, -1 },
+   { "glProgramUniformMatrix3x4fv", 43, -1 },
+   { "glProgramUniformMatrix4x3fv", 43, -1 },
 // { "glProgramUniformMatrix2x3dv", 43, -1 },           // XXX: Add to xml
 // { "glProgramUniformMatrix3x2dv", 43, -1 },           // XXX: Add to xml
 // { "glProgramUniformMatrix2x4dv", 43, -1 },           // XXX: Add to xml
 // { "glProgramUniformMatrix4x2dv", 43, -1 },           // XXX: Add to xml
 // { "glProgramUniformMatrix3x4dv", 43, -1 },           // XXX: Add to xml
 // { "glProgramUniformMatrix4x3dv", 43, -1 },           // XXX: Add to xml
-// { "glValidateProgramPipeline", 43, -1 },             // XXX: Add to xml
-// { "glGetProgramPipelineInfoLog", 43, -1 },           // XXX: Add to xml
+   { "glValidateProgramPipeline", 43, -1 },
+   { "glGetProgramPipelineInfoLog", 43, -1 },
 // { "glVertexAttribL1d", 43, -1 },                     // XXX: Add to xml
 // { "glVertexAttribL2d", 43, -1 },                     // XXX: Add to xml
 // { "glVertexAttribL3d", 43, -1 },                     // XXX: Add to xml
index 071d668f3bdb40420b11b1214d5ab0b3f78e22b3..4c123660f594ec8321226fa70f8294109ae850d4 100644 (file)
@@ -270,6 +270,203 @@ _mesa_Uniform4iv(GLint location, GLsizei count, const GLint * value)
    _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, count, value, GL_INT_VEC4);
 }
 
+/** Same as above with direct state access **/
+void GLAPIENTRY
+_mesa_ProgramUniform1f(GLuint program, GLint location, GLfloat v0)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   struct gl_shader_program *shProg =
+      _mesa_lookup_shader_program_err(ctx, program,
+            "glProgramUniform1f");
+   _mesa_uniform(ctx, shProg, location, 1, &v0, GL_FLOAT);
+}
+
+void GLAPIENTRY
+_mesa_ProgramUniform2f(GLuint program, GLint location, GLfloat v0, GLfloat v1)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   GLfloat v[2];
+   v[0] = v0;
+   v[1] = v1;
+   struct gl_shader_program *shProg =
+      _mesa_lookup_shader_program_err(ctx, program,
+            "glProgramUniform2f");
+   _mesa_uniform(ctx, shProg, location, 1, v, GL_FLOAT_VEC2);
+}
+
+void GLAPIENTRY
+_mesa_ProgramUniform3f(GLuint program, GLint location, GLfloat v0, GLfloat v1,
+                       GLfloat v2)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   GLfloat v[3];
+   v[0] = v0;
+   v[1] = v1;
+   v[2] = v2;
+   struct gl_shader_program *shProg =
+      _mesa_lookup_shader_program_err(ctx, program,
+            "glProgramUniform3f");
+   _mesa_uniform(ctx, shProg, location, 1, v, GL_FLOAT_VEC3);
+}
+
+void GLAPIENTRY
+_mesa_ProgramUniform4f(GLuint program, GLint location, GLfloat v0, GLfloat v1,
+                       GLfloat v2, GLfloat v3)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   GLfloat v[4];
+   v[0] = v0;
+   v[1] = v1;
+   v[2] = v2;
+   v[3] = v3;
+   struct gl_shader_program *shProg =
+      _mesa_lookup_shader_program_err(ctx, program,
+            "glProgramUniform4f");
+   _mesa_uniform(ctx, shProg, location, 1, v, GL_FLOAT_VEC4);
+}
+
+void GLAPIENTRY
+_mesa_ProgramUniform1i(GLuint program, GLint location, GLint v0)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   struct gl_shader_program *shProg =
+      _mesa_lookup_shader_program_err(ctx, program,
+            "glProgramUniform1i");
+   _mesa_uniform(ctx, shProg, location, 1, &v0, GL_INT);
+}
+
+void GLAPIENTRY
+_mesa_ProgramUniform2i(GLuint program, GLint location, GLint v0, GLint v1)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   GLint v[2];
+   v[0] = v0;
+   v[1] = v1;
+   struct gl_shader_program *shProg =
+      _mesa_lookup_shader_program_err(ctx, program,
+            "glProgramUniform2i");
+   _mesa_uniform(ctx, shProg, location, 1, v, GL_INT_VEC2);
+}
+
+void GLAPIENTRY
+_mesa_ProgramUniform3i(GLuint program, GLint location, GLint v0, GLint v1,
+                       GLint v2)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   GLint v[3];
+   v[0] = v0;
+   v[1] = v1;
+   v[2] = v2;
+   struct gl_shader_program *shProg =
+      _mesa_lookup_shader_program_err(ctx, program,
+            "glProgramUniform3i");
+   _mesa_uniform(ctx, shProg, location, 1, v, GL_INT_VEC3);
+}
+
+void GLAPIENTRY
+_mesa_ProgramUniform4i(GLuint program, GLint location, GLint v0, GLint v1,
+                       GLint v2, GLint v3)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   GLint v[4];
+   v[0] = v0;
+   v[1] = v1;
+   v[2] = v2;
+   v[3] = v3;
+   struct gl_shader_program *shProg =
+      _mesa_lookup_shader_program_err(ctx, program,
+            "glProgramUniform4i");
+   _mesa_uniform(ctx, shProg, location, 1, v, GL_INT_VEC4);
+}
+
+void GLAPIENTRY
+_mesa_ProgramUniform1fv(GLuint program, GLint location, GLsizei count,
+                        const GLfloat * value)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   struct gl_shader_program *shProg =
+      _mesa_lookup_shader_program_err(ctx, program,
+            "glProgramUniform1fv");
+   _mesa_uniform(ctx, shProg, location, count, value, GL_FLOAT);
+}
+
+void GLAPIENTRY
+_mesa_ProgramUniform2fv(GLuint program, GLint location, GLsizei count,
+                        const GLfloat * value)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   struct gl_shader_program *shProg =
+      _mesa_lookup_shader_program_err(ctx, program,
+            "glProgramUniform2fv");
+   _mesa_uniform(ctx, shProg, location, count, value, GL_FLOAT_VEC2);
+}
+
+void GLAPIENTRY
+_mesa_ProgramUniform3fv(GLuint program, GLint location, GLsizei count,
+                        const GLfloat * value)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   struct gl_shader_program *shProg =
+      _mesa_lookup_shader_program_err(ctx, program,
+            "glProgramUniform3fv");
+   _mesa_uniform(ctx, shProg, location, count, value, GL_FLOAT_VEC3);
+}
+
+void GLAPIENTRY
+_mesa_ProgramUniform4fv(GLuint program, GLint location, GLsizei count,
+                        const GLfloat * value)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   struct gl_shader_program *shProg =
+      _mesa_lookup_shader_program_err(ctx, program,
+            "glProgramUniform4fv");
+   _mesa_uniform(ctx, shProg, location, count, value, GL_FLOAT_VEC4);
+}
+
+void GLAPIENTRY
+_mesa_ProgramUniform1iv(GLuint program, GLint location, GLsizei count,
+                        const GLint * value)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   struct gl_shader_program *shProg =
+      _mesa_lookup_shader_program_err(ctx, program,
+            "glProgramUniform1iv");
+   _mesa_uniform(ctx, shProg, location, count, value, GL_INT);
+}
+
+void GLAPIENTRY
+_mesa_ProgramUniform2iv(GLuint program, GLint location, GLsizei count,
+                        const GLint * value)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   struct gl_shader_program *shProg =
+      _mesa_lookup_shader_program_err(ctx, program,
+            "glProgramUniform2iv");
+   _mesa_uniform(ctx, shProg, location, count, value, GL_INT_VEC2);
+}
+
+void GLAPIENTRY
+_mesa_ProgramUniform3iv(GLuint program, GLint location, GLsizei count,
+                        const GLint * value)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   struct gl_shader_program *shProg =
+      _mesa_lookup_shader_program_err(ctx, program,
+            "glProgramUniform3iv");
+   _mesa_uniform(ctx, shProg, location, count, value, GL_INT_VEC3);
+}
+
+void GLAPIENTRY
+_mesa_ProgramUniform4iv(GLuint program, GLint location, GLsizei count,
+                        const GLint * value)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   struct gl_shader_program *shProg =
+      _mesa_lookup_shader_program_err(ctx, program,
+            "glProgramUniform4iv");
+   _mesa_uniform(ctx, shProg, location, count, value, GL_INT_VEC4);
+}
+
 
 /** OpenGL 3.0 GLuint-valued functions **/
 void GLAPIENTRY
@@ -369,6 +566,141 @@ _mesa_UniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose,
                        4, 4, location, count, transpose, value);
 }
 
+/** Same as above with direct state access **/
+
+void GLAPIENTRY
+_mesa_ProgramUniform1ui(GLuint program, GLint location, GLuint v0)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   struct gl_shader_program *shProg =
+      _mesa_lookup_shader_program_err(ctx, program,
+            "glProgramUniform1ui");
+   _mesa_uniform(ctx, shProg, location, 1, &v0, GL_UNSIGNED_INT);
+}
+
+void GLAPIENTRY
+_mesa_ProgramUniform2ui(GLuint program, GLint location, GLuint v0, GLuint v1)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   GLuint v[2];
+   v[0] = v0;
+   v[1] = v1;
+   struct gl_shader_program *shProg =
+      _mesa_lookup_shader_program_err(ctx, program,
+            "glProgramUniform2ui");
+   _mesa_uniform(ctx, shProg, location, 1, v, GL_UNSIGNED_INT_VEC2);
+}
+
+void GLAPIENTRY
+_mesa_ProgramUniform3ui(GLuint program, GLint location, GLuint v0, GLuint v1,
+                        GLuint v2)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   GLuint v[3];
+   v[0] = v0;
+   v[1] = v1;
+   v[2] = v2;
+   struct gl_shader_program *shProg =
+      _mesa_lookup_shader_program_err(ctx, program,
+            "glProgramUniform3ui");
+   _mesa_uniform(ctx, shProg, location, 1, v, GL_UNSIGNED_INT_VEC3);
+}
+
+void GLAPIENTRY
+_mesa_ProgramUniform4ui(GLuint program, GLint location, GLuint v0, GLuint v1,
+                        GLuint v2, GLuint v3)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   GLuint v[4];
+   v[0] = v0;
+   v[1] = v1;
+   v[2] = v2;
+   v[3] = v3;
+   struct gl_shader_program *shProg =
+      _mesa_lookup_shader_program_err(ctx, program,
+            "glProgramUniform4ui");
+   _mesa_uniform(ctx, shProg, location, 1, v, GL_UNSIGNED_INT_VEC4);
+}
+
+void GLAPIENTRY
+_mesa_ProgramUniform1uiv(GLuint program, GLint location, GLsizei count,
+                         const GLuint *value)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   struct gl_shader_program *shProg =
+      _mesa_lookup_shader_program_err(ctx, program,
+            "glProgramUniform1uiv");
+   _mesa_uniform(ctx, shProg, location, count, value, GL_UNSIGNED_INT);
+}
+
+void GLAPIENTRY
+_mesa_ProgramUniform2uiv(GLuint program, GLint location, GLsizei count,
+                         const GLuint *value)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   struct gl_shader_program *shProg =
+      _mesa_lookup_shader_program_err(ctx, program,
+            "glProgramUniform2uiv");
+   _mesa_uniform(ctx, shProg, location, count, value, GL_UNSIGNED_INT_VEC2);
+}
+
+void GLAPIENTRY
+_mesa_ProgramUniform3uiv(GLuint program, GLint location, GLsizei count,
+                         const GLuint *value)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   struct gl_shader_program *shProg =
+      _mesa_lookup_shader_program_err(ctx, program,
+            "glProgramUniform3uiv");
+   _mesa_uniform(ctx, shProg, location, count, value, GL_UNSIGNED_INT_VEC3);
+}
+
+void GLAPIENTRY
+_mesa_ProgramUniform4uiv(GLuint program, GLint location, GLsizei count,
+                         const GLuint *value)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   struct gl_shader_program *shProg =
+      _mesa_lookup_shader_program_err(ctx, program,
+            "glProgramUniform4uiv");
+   _mesa_uniform(ctx, shProg, location, count, value, GL_UNSIGNED_INT_VEC4);
+}
+
+
+
+void GLAPIENTRY
+_mesa_ProgramUniformMatrix2fv(GLuint program, GLint location, GLsizei count,
+                              GLboolean transpose, const GLfloat * value)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   struct gl_shader_program *shProg =
+      _mesa_lookup_shader_program_err(ctx, program,
+            "glProgramUniformMatrix2fv");
+   _mesa_uniform_matrix(ctx, shProg, 2, 2, location, count, transpose, value);
+}
+
+void GLAPIENTRY
+_mesa_ProgramUniformMatrix3fv(GLuint program, GLint location, GLsizei count,
+                              GLboolean transpose, const GLfloat * value)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   struct gl_shader_program *shProg =
+      _mesa_lookup_shader_program_err(ctx, program,
+            "glProgramUniformMatrix3fv");
+   _mesa_uniform_matrix(ctx, shProg, 3, 3, location, count, transpose, value);
+}
+
+void GLAPIENTRY
+_mesa_ProgramUniformMatrix4fv(GLuint program, GLint location, GLsizei count,
+                              GLboolean transpose, const GLfloat * value)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   struct gl_shader_program *shProg =
+      _mesa_lookup_shader_program_err(ctx, program,
+            "glProgramUniformMatrix4fv");
+   _mesa_uniform_matrix(ctx, shProg, 4, 4, location, count, transpose, value);
+}
+
 
 /**
  * Non-square UniformMatrix are OpenGL 2.1
@@ -427,6 +759,74 @@ _mesa_UniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose,
                        4, 3, location, count, transpose, value);
 }
 
+/** Same as above with direct state access **/
+
+void GLAPIENTRY
+_mesa_ProgramUniformMatrix2x3fv(GLuint program, GLint location, GLsizei count,
+                                GLboolean transpose, const GLfloat * value)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   struct gl_shader_program *shProg =
+      _mesa_lookup_shader_program_err(ctx, program,
+            "glProgramUniformMatrix2x3fv");
+   _mesa_uniform_matrix(ctx, shProg, 2, 3, location, count, transpose, value);
+}
+
+void GLAPIENTRY
+_mesa_ProgramUniformMatrix3x2fv(GLuint program, GLint location, GLsizei count,
+                                GLboolean transpose, const GLfloat * value)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   struct gl_shader_program *shProg =
+      _mesa_lookup_shader_program_err(ctx, program,
+            "glProgramUniformMatrix3x2fv");
+   _mesa_uniform_matrix(ctx, shProg, 3, 2, location, count, transpose, value);
+}
+
+void GLAPIENTRY
+_mesa_ProgramUniformMatrix2x4fv(GLuint program, GLint location, GLsizei count,
+                                GLboolean transpose, const GLfloat * value)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   struct gl_shader_program *shProg =
+      _mesa_lookup_shader_program_err(ctx, program,
+            "glProgramUniformMatrix2x4fv");
+   _mesa_uniform_matrix(ctx, shProg, 2, 4, location, count, transpose, value);
+}
+
+void GLAPIENTRY
+_mesa_ProgramUniformMatrix4x2fv(GLuint program, GLint location, GLsizei count,
+                                GLboolean transpose, const GLfloat * value)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   struct gl_shader_program *shProg =
+      _mesa_lookup_shader_program_err(ctx, program,
+            "glProgramUniformMatrix4x2fv");
+   _mesa_uniform_matrix(ctx, shProg, 4, 2, location, count, transpose, value);
+}
+
+void GLAPIENTRY
+_mesa_ProgramUniformMatrix3x4fv(GLuint program, GLint location, GLsizei count,
+                                GLboolean transpose, const GLfloat * value)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   struct gl_shader_program *shProg =
+      _mesa_lookup_shader_program_err(ctx, program,
+            "glProgramUniformMatrix3x4fv");
+   _mesa_uniform_matrix(ctx, shProg, 3, 4, location, count, transpose, value);
+}
+
+void GLAPIENTRY
+_mesa_ProgramUniformMatrix4x3fv(GLuint program, GLint location, GLsizei count,
+                                GLboolean transpose, const GLfloat * value)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   struct gl_shader_program *shProg =
+      _mesa_lookup_shader_program_err(ctx, program,
+            "glProgramUniformMatrix4x3fv");
+   _mesa_uniform_matrix(ctx, shProg, 4, 3, location, count, transpose, value);
+}
+
 
 void GLAPIENTRY
 _mesa_GetnUniformfvARB(GLhandleARB program, GLint location,
index f7cac63286b697d5059ee8a052738f4c8aca4831..bd50fd9b84dfd4e4ee011547d084ce135d2377ca 100644 (file)
@@ -111,6 +111,89 @@ _mesa_UniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose,
 void GLAPIENTRY
 _mesa_UniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose,
                          const GLfloat *value);
+
+void GLAPIENTRY
+_mesa_ProgramUniform1f(GLuint program, GLint, GLfloat);
+void GLAPIENTRY
+_mesa_ProgramUniform2f(GLuint program, GLint, GLfloat, GLfloat);
+void GLAPIENTRY
+_mesa_ProgramUniform3f(GLuint program, GLint, GLfloat, GLfloat, GLfloat);
+void GLAPIENTRY
+_mesa_ProgramUniform4f(GLuint program, GLint, GLfloat, GLfloat, GLfloat, GLfloat);
+void GLAPIENTRY
+_mesa_ProgramUniform1i(GLuint program, GLint, GLint);
+void GLAPIENTRY
+_mesa_ProgramUniform2i(GLuint program, GLint, GLint, GLint);
+void GLAPIENTRY
+_mesa_ProgramUniform3i(GLuint program, GLint, GLint, GLint, GLint);
+void GLAPIENTRY
+_mesa_ProgramUniform4i(GLuint program, GLint, GLint, GLint, GLint, GLint);
+void GLAPIENTRY
+_mesa_ProgramUniform1fv(GLuint program, GLint, GLsizei, const GLfloat *);
+void GLAPIENTRY
+_mesa_ProgramUniform2fv(GLuint program, GLint, GLsizei, const GLfloat *);
+void GLAPIENTRY
+_mesa_ProgramUniform3fv(GLuint program, GLint, GLsizei, const GLfloat *);
+void GLAPIENTRY
+_mesa_ProgramUniform4fv(GLuint program, GLint, GLsizei, const GLfloat *);
+void GLAPIENTRY
+_mesa_ProgramUniform1iv(GLuint program, GLint, GLsizei, const GLint *);
+void GLAPIENTRY
+_mesa_ProgramUniform2iv(GLuint program, GLint, GLsizei, const GLint *);
+void GLAPIENTRY
+_mesa_ProgramUniform3iv(GLuint program, GLint, GLsizei, const GLint *);
+void GLAPIENTRY
+_mesa_ProgramUniform4iv(GLuint program, GLint, GLsizei, const GLint *);
+void GLAPIENTRY
+_mesa_ProgramUniform1ui(GLuint program, GLint location, GLuint v0);
+void GLAPIENTRY
+_mesa_ProgramUniform2ui(GLuint program, GLint location, GLuint v0, GLuint v1);
+void GLAPIENTRY
+_mesa_ProgramUniform3ui(GLuint program, GLint location, GLuint v0, GLuint v1,
+                        GLuint v2);
+void GLAPIENTRY
+_mesa_ProgramUniform4ui(GLuint program, GLint location, GLuint v0, GLuint v1,
+                        GLuint v2, GLuint v3);
+void GLAPIENTRY
+_mesa_ProgramUniform1uiv(GLuint program, GLint location, GLsizei count,
+                         const GLuint *value);
+void GLAPIENTRY
+_mesa_ProgramUniform2uiv(GLuint program, GLint location, GLsizei count,
+                         const GLuint *value);
+void GLAPIENTRY
+_mesa_ProgramUniform3uiv(GLuint program, GLint location, GLsizei count,
+                         const GLuint *value);
+void GLAPIENTRY
+_mesa_ProgramUniform4uiv(GLuint program, GLint location, GLsizei count,
+                         const GLuint *value);
+void GLAPIENTRY
+_mesa_ProgramUniformMatrix2fv(GLuint program, GLint, GLsizei, GLboolean,
+                              const GLfloat *);
+void GLAPIENTRY
+_mesa_ProgramUniformMatrix3fv(GLuint program, GLint, GLsizei, GLboolean,
+                              const GLfloat *);
+void GLAPIENTRY
+_mesa_ProgramUniformMatrix4fv(GLuint program, GLint, GLsizei, GLboolean,
+                              const GLfloat *);
+void GLAPIENTRY
+_mesa_ProgramUniformMatrix2x3fv(GLuint program, GLint location, GLsizei count,
+                                GLboolean transpose, const GLfloat *value);
+void GLAPIENTRY
+_mesa_ProgramUniformMatrix3x2fv(GLuint program, GLint location, GLsizei count,
+                                GLboolean transpose, const GLfloat *value);
+void GLAPIENTRY
+_mesa_ProgramUniformMatrix2x4fv(GLuint program, GLint location, GLsizei count,
+                                GLboolean transpose, const GLfloat *value);
+void GLAPIENTRY
+_mesa_ProgramUniformMatrix4x2fv(GLuint program, GLint location, GLsizei count,
+                                GLboolean transpose, const GLfloat *value);
+void GLAPIENTRY
+_mesa_ProgramUniformMatrix3x4fv(GLuint program, GLint location, GLsizei count,
+                                GLboolean transpose, const GLfloat *value);
+void GLAPIENTRY
+_mesa_ProgramUniformMatrix4x3fv(GLuint program, GLint location, GLsizei count,
+                                GLboolean transpose, const GLfloat *value);
+
 void GLAPIENTRY
 _mesa_GetnUniformfvARB(GLhandleARB, GLint, GLsizei, GLfloat *);
 void GLAPIENTRY