summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2009-09-15 14:31:10 -0600
committerBrian Paul <brianp@vmware.com>2009-09-15 14:37:45 -0600
commitf42c66c138c4bf96fe9d9d007797c63d9f326e22 (patch)
treec0ab953e385ec94b7934953decdebabedc248930
parent81de9d68f7299d7b053914b6c886cd2ea4958a85 (diff)
mesa: compile glUniform4f() into display lists
Note: there are more glUniform functions to compile...
-rw-r--r--src/mesa/main/dlist.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
index b7e5b8d289..3e369e8633 100644
--- a/src/mesa/main/dlist.c
+++ b/src/mesa/main/dlist.c
@@ -331,6 +331,7 @@ typedef enum
/* GL_ARB_shader_objects */
OPCODE_USE_PROGRAM,
+ OPCODE_UNIFORM_4F, /* XXX many more glUniform functions */
/* GL_EXT_framebuffer_blit */
OPCODE_BLIT_FRAMEBUFFER,
@@ -5803,6 +5804,26 @@ save_UseProgramObjectARB(GLhandleARB program)
}
+static void GLAPIENTRY
+save_Uniform4fARB(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_4F, 5);
+ if (n) {
+ n[1].i = location;
+ n[2].f = x;
+ n[3].f = y;
+ n[4].f = z;
+ n[5].f = w;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_Uniform4fARB(ctx->Exec, (location, x, y, z, w));
+ }
+}
+
+
/**
* Save an error-generating command into display list.
*
@@ -6639,6 +6660,10 @@ execute_list(GLcontext *ctx, GLuint list)
case OPCODE_USE_PROGRAM:
CALL_UseProgramObjectARB(ctx->Exec, (n[1].ui));
break;
+ case OPCODE_UNIFORM_4F:
+ CALL_Uniform4fARB(ctx->Exec,
+ (n[1].i, n[2].f, n[3].f, n[4].f, n[5].f));
+ break;
case OPCODE_TEX_BUMP_PARAMETER_ATI:
{
@@ -8324,6 +8349,7 @@ _mesa_init_dlist_table(struct _glapi_table *table)
/* GL_ARB_shader_objects */
SET_UseProgramObjectARB(table, save_UseProgramObjectARB);
+ SET_Uniform4fARB(table, save_Uniform4fARB);
/* ARB 30/31/32. GL_ARB_shader_objects, GL_ARB_vertex/fragment_shader */
SET_BindAttribLocationARB(table, exec_BindAttribLocationARB);