[Mesa-dev] [PATCH 04/15] mesa/sso: Add extension entry points for GL_ARB_separate_shader_objects

Ian Romanick idr at freedesktop.org
Fri Feb 7 22:00:14 PST 2014


From: Gregory Hainaut <gregory.hainaut at gmail.com>

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 at intel.com>
---
 src/mapi/glapi/gen/ARB_separate_shader_objects.xml | 401 +++++++++++++++++++++
 src/mapi/glapi/gen/Makefile.am                     |   1 +
 src/mapi/glapi/gen/gl_API.xml                      |   6 +-
 src/mapi/glapi/gen/gl_genexec.py                   |   1 +
 src/mesa/Makefile.sources                          |   1 +
 src/mesa/main/pipelineobj.c                        | 133 +++++++
 src/mesa/main/pipelineobj.h                        |  70 ++++
 src/mesa/main/shaderapi.c                          |  11 +
 src/mesa/main/shaderapi.h                          |   5 +
 src/mesa/main/tests/dispatch_sanity.cpp            |  86 ++---
 src/mesa/main/uniforms.c                           | 400 ++++++++++++++++++++
 src/mesa/main/uniforms.h                           |  83 +++++
 12 files changed, 1154 insertions(+), 44 deletions(-)
 create mode 100644 src/mapi/glapi/gen/ARB_separate_shader_objects.xml
 create mode 100644 src/mesa/main/pipelineobj.c
 create mode 100644 src/mesa/main/pipelineobj.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
index 0000000..f996456
--- /dev/null
+++ b/src/mapi/glapi/gen/ARB_separate_shader_objects.xml
@@ -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>
diff --git a/src/mapi/glapi/gen/Makefile.am b/src/mapi/glapi/gen/Makefile.am
index 9e6fe52..7b3c118 100644
--- a/src/mapi/glapi/gen/Makefile.am
+++ b/src/mapi/glapi/gen/Makefile.am
@@ -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 \
diff --git a/src/mapi/glapi/gen/gl_API.xml b/src/mapi/glapi/gen/gl_API.xml
index 4ef754d..c710ea8 100644
--- a/src/mapi/glapi/gen/gl_API.xml
+++ b/src/mapi/glapi/gen/gl_API.xml
@@ -8275,7 +8275,11 @@
   </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"/>
 
diff --git a/src/mapi/glapi/gen/gl_genexec.py b/src/mapi/glapi/gen/gl_genexec.py
index 1765a51..4609193 100644
--- a/src/mapi/glapi/gen/gl_genexec.py
+++ b/src/mapi/glapi/gen/gl_genexec.py
@@ -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"
diff --git a/src/mesa/Makefile.sources b/src/mesa/Makefile.sources
index bd02d3e..3e1ed4a 100644
--- a/src/mesa/Makefile.sources
+++ b/src/mesa/Makefile.sources
@@ -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
index 0000000..7454619
--- /dev/null
+++ b/src/mesa/main/pipelineobj.c
@@ -0,0 +1,133 @@
+/*
+ * Mesa 3-D graphics library
+ *
+ * Copyright © 2013 Gregory Hainaut <gregory.hainaut at 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 at 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
index 0000000..56d32cc
--- /dev/null
+++ b/src/mesa/main/pipelineobj.h
@@ -0,0 +1,70 @@
+/*
+ * Mesa 3-D graphics library
+ *
+ * Copyright © 2013 Gregory Hainaut <gregory.hainaut at 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 */
diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
index 65b6b16..3052071 100644
--- a/src/mesa/main/shaderapi.c
+++ b/src/mesa/main/shaderapi.c
@@ -1875,3 +1875,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;
+}
diff --git a/src/mesa/main/shaderapi.h b/src/mesa/main/shaderapi.h
index 10f810c..109a802 100644
--- a/src/mesa/main/shaderapi.h
+++ b/src/mesa/main/shaderapi.h
@@ -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
diff --git a/src/mesa/main/tests/dispatch_sanity.cpp b/src/mesa/main/tests/dispatch_sanity.cpp
index d8969e2..117a570 100644
--- a/src/mesa/main/tests/dispatch_sanity.cpp
+++ b/src/mesa/main/tests/dispatch_sanity.cpp
@@ -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
diff --git a/src/mesa/main/uniforms.c b/src/mesa/main/uniforms.c
index 071d668..4c12366 100644
--- a/src/mesa/main/uniforms.c
+++ b/src/mesa/main/uniforms.c
@@ -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,
diff --git a/src/mesa/main/uniforms.h b/src/mesa/main/uniforms.h
index f7cac63..bd50fd9 100644
--- a/src/mesa/main/uniforms.h
+++ b/src/mesa/main/uniforms.h
@@ -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
-- 
1.8.1.4



More information about the mesa-dev mailing list