Mesa (master): mesa: Add display list support for GL_EXT_separate_shader_objects functions

Ian Romanick idr at kemper.freedesktop.org
Wed Oct 27 20:47:13 UTC 2010


Module: Mesa
Branch: master
Commit: 01abcf3b79c9ba18fef2de423b51e7e1f9bb1b3f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=01abcf3b79c9ba18fef2de423b51e7e1f9bb1b3f

Author: Ian Romanick <ian.d.romanick at intel.com>
Date:   Wed Oct 13 13:54:13 2010 -0700

mesa: Add display list support for GL_EXT_separate_shader_objects functions

---

 src/mesa/main/dlist.c |   44 ++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 44 insertions(+), 0 deletions(-)

diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
index 46b7721..e824226 100644
--- a/src/mesa/main/dlist.c
+++ b/src/mesa/main/dlist.c
@@ -417,6 +417,10 @@ typedef enum
    OPCODE_TEXPARAMETER_I,
    OPCODE_TEXPARAMETER_UI,
 
+   /* GL_EXT_separate_shader_objects */
+   OPCODE_ACTIVE_PROGRAM_EXT,
+   OPCODE_USE_SHADER_PROGRAM_EXT,
+
    /* The following three are meta instructions */
    OPCODE_ERROR,                /* raise compiled-in error */
    OPCODE_CONTINUE,
@@ -6793,6 +6797,36 @@ save_UniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose,
    }
 }
 
+static void GLAPIENTRY
+save_UseShaderProgramEXT(GLenum type, GLuint program)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   Node *n;
+   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+   n = alloc_instruction(ctx, OPCODE_USE_SHADER_PROGRAM_EXT, 2);
+   if (n) {
+      n[1].ui = type;
+      n[2].ui = program;
+   }
+   if (ctx->ExecuteFlag) {
+      CALL_UseShaderProgramEXT(ctx->Exec, (type, program));
+   }
+}
+
+static void GLAPIENTRY
+save_ActiveProgramEXT(GLuint program)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   Node *n;
+   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+   n = alloc_instruction(ctx, OPCODE_ACTIVE_PROGRAM_EXT, 1);
+   if (n) {
+      n[1].ui = program;
+   }
+   if (ctx->ExecuteFlag) {
+      CALL_ActiveProgramEXT(ctx->Exec, (program));
+   }
+}
 
 /** GL_EXT_texture_integer */
 static void GLAPIENTRY
@@ -7781,6 +7815,12 @@ execute_list(struct gl_context *ctx, GLuint list)
 	 case OPCODE_USE_PROGRAM:
 	    CALL_UseProgramObjectARB(ctx->Exec, (n[1].ui));
 	    break;
+	 case OPCODE_USE_SHADER_PROGRAM_EXT:
+	    CALL_UseShaderProgramEXT(ctx->Exec, (n[1].ui, n[2].ui));
+	    break;
+	 case OPCODE_ACTIVE_PROGRAM_EXT:
+	    CALL_ActiveProgramEXT(ctx->Exec, (n[1].ui));
+	    break;
 	 case OPCODE_UNIFORM_1F:
 	    CALL_Uniform1fARB(ctx->Exec, (n[1].i, n[2].f));
 	    break;
@@ -9676,6 +9716,10 @@ _mesa_create_save_table(void)
    SET_GetTexParameterIivEXT(table, exec_GetTexParameterIiv);
    SET_GetTexParameterIuivEXT(table, exec_GetTexParameterIuiv);
 
+   /* 377. GL_EXT_separate_shader_objects */
+   SET_UseShaderProgramEXT(table, save_UseShaderProgramEXT);
+   SET_ActiveProgramEXT(table, save_ActiveProgramEXT);
+
    /* GL 3.0 */
 #if 0
    SET_ClearBufferiv(table, save_ClearBufferiv);




More information about the mesa-commit mailing list