From 8c41c757fe8efa04df0dd5cdfb33a75b84891c19 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 15 Aug 2006 16:47:34 +0000 Subject: Add support for GL_EXT_gpu_program_parameters. Any driver that enables either GL_ARB_vertex_program or GL_ARB_fragment_program should enable this extension as well. --- src/mesa/main/dlist.c | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) (limited to 'src/mesa/main/dlist.c') diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index 46e33a1..83200d8 100644 --- a/src/mesa/main/dlist.c +++ b/src/mesa/main/dlist.c @@ -4468,6 +4468,38 @@ save_ProgramLocalParameter4fvARB(GLenum target, GLuint index, static void GLAPIENTRY +save_ProgramLocalParameters4fvEXT(GLenum target, GLuint index, GLsizei count, + const GLfloat *params) +{ + GET_CURRENT_CONTEXT(ctx); + Node *n; + ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); + + if (count > 0) { + unsigned i; + const GLfloat * p = params; + + for (i = 0 ; i < count ; i++) { + n = ALLOC_INSTRUCTION(ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6); + if (n) { + n[1].e = target; + n[2].ui = index; + n[3].f = p[0]; + n[4].f = p[1]; + n[5].f = p[2]; + n[6].f = p[3]; + p += 4; + } + } + } + + if (ctx->ExecuteFlag) { + CALL_ProgramLocalParameters4fvEXT(ctx->Exec, (target, index, count, params)); + } +} + + +static void GLAPIENTRY save_ProgramLocalParameter4dARB(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) @@ -4670,6 +4702,38 @@ save_ProgramEnvParameter4fvARB(GLenum target, GLuint index, static void GLAPIENTRY +save_ProgramEnvParameters4fvEXT(GLenum target, GLuint index, GLsizei count, + const GLfloat * params) +{ + GET_CURRENT_CONTEXT(ctx); + Node *n; + ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); + + if (count > 0) { + unsigned i; + const GLfloat * p = params; + + for (i = 0 ; i < count ; i++) { + n = ALLOC_INSTRUCTION(ctx, OPCODE_PROGRAM_ENV_PARAMETER_ARB, 6); + if (n) { + n[1].e = target; + n[2].ui = index; + n[3].f = p[0]; + n[4].f = p[1]; + n[5].f = p[2]; + n[6].f = p[3]; + p += 4; + } + } + } + + if (ctx->ExecuteFlag) { + CALL_ProgramEnvParameters4fvEXT(ctx->Exec, (target, index, count, params)); + } +} + + +static void GLAPIENTRY save_ProgramEnvParameter4dARB(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) { @@ -8154,6 +8218,12 @@ _mesa_init_dlist_table(struct _glapi_table *table) /* 299. GL_EXT_blend_equation_separate */ SET_BlendEquationSeparateEXT(table, save_BlendEquationSeparateEXT); + + /* GL_EXT_gpu_program_parmaeters */ +#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program + SET_ProgramEnvParameters4fvEXT(table, save_ProgramEnvParameters4fvEXT); + SET_ProgramLocalParameters4fvEXT(table, save_ProgramLocalParameters4fvEXT); +#endif } -- cgit v1.1