diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/Makefile.X11 | 7 | ||||
-rw-r--r-- | src/mesa/main/Makefile.BeOS-R5 | 1 | ||||
-rw-r--r-- | src/mesa/main/Makefile.DJ | 1 | ||||
-rw-r--r-- | src/mesa/main/Makefile.OSMesa16 | 3 | ||||
-rw-r--r-- | src/mesa/main/Makefile.X11 | 7 | ||||
-rw-r--r-- | src/mesa/main/Makefile.ugl | 1 | ||||
-rw-r--r-- | src/mesa/main/Makefile.win | 1 | ||||
-rw-r--r-- | src/mesa/main/arbprogram.c | 116 | ||||
-rw-r--r-- | src/mesa/main/descrip.mms | 1 | ||||
-rw-r--r-- | src/mesa/main/dlist.c | 219 | ||||
-rw-r--r-- | src/mesa/main/nvprogram.c | 3 | ||||
-rw-r--r-- | src/mesa/main/nvprogram.h | 4 | ||||
-rw-r--r-- | src/mesa/main/state.c | 73 |
13 files changed, 354 insertions, 83 deletions
diff --git a/src/mesa/Makefile.X11 b/src/mesa/Makefile.X11 index bbb9610bce..6300b601a1 100644 --- a/src/mesa/Makefile.X11 +++ b/src/mesa/Makefile.X11 @@ -1,8 +1,8 @@ -# $Id: Makefile.X11,v 1.78 2003/04/07 14:45:55 brianp Exp $ +# $Id: Makefile.X11,v 1.79 2003/04/17 02:33:11 brianp Exp $ # Mesa 3-D graphics library -# Version: 5.0 -# Copyright (C) 1995-2002 Brian Paul +# Version: 5.1 +# Copyright (C) 1995-2003 Brian Paul # Makefile for core library @@ -26,6 +26,7 @@ CORE_SOURCES = \ api_noop.c \ api_validate.c \ accum.c \ + arbprogram.c \ attrib.c \ blend.c \ bufferobj.c \ diff --git a/src/mesa/main/Makefile.BeOS-R5 b/src/mesa/main/Makefile.BeOS-R5 index 43f6ac1f83..037a3a59f3 100644 --- a/src/mesa/main/Makefile.BeOS-R5 +++ b/src/mesa/main/Makefile.BeOS-R5 @@ -61,6 +61,7 @@ MESA_CORE_SRCS = \ api_noop.c \ api_validate.c \ accum.c \ + arbprogram.c \ attrib.c \ blend.c \ bufferobj.c \ diff --git a/src/mesa/main/Makefile.DJ b/src/mesa/main/Makefile.DJ index 89f58a5dd4..518a168915 100644 --- a/src/mesa/main/Makefile.DJ +++ b/src/mesa/main/Makefile.DJ @@ -103,6 +103,7 @@ CORE_SOURCES = \ api_noop.c \
api_validate.c \
accum.c \
+ arbprogram.c \
attrib.c \
blend.c \
bufferobj.c \
diff --git a/src/mesa/main/Makefile.OSMesa16 b/src/mesa/main/Makefile.OSMesa16 index 62e934405c..4a4951d482 100644 --- a/src/mesa/main/Makefile.OSMesa16 +++ b/src/mesa/main/Makefile.OSMesa16 @@ -1,4 +1,4 @@ -# $Id: Makefile.OSMesa16,v 1.14 2003/03/29 17:01:02 brianp Exp $ +# $Id: Makefile.OSMesa16,v 1.15 2003/04/17 02:33:11 brianp Exp $ # Mesa 3-D graphics library # Version: 5.1 @@ -27,6 +27,7 @@ CORE_SOURCES = \ api_noop.c \ api_validate.c \ accum.c \ + arbprogram.c \ attrib.c \ blend.c \ bufferobj.c \ diff --git a/src/mesa/main/Makefile.X11 b/src/mesa/main/Makefile.X11 index bbb9610bce..6300b601a1 100644 --- a/src/mesa/main/Makefile.X11 +++ b/src/mesa/main/Makefile.X11 @@ -1,8 +1,8 @@ -# $Id: Makefile.X11,v 1.78 2003/04/07 14:45:55 brianp Exp $ +# $Id: Makefile.X11,v 1.79 2003/04/17 02:33:11 brianp Exp $ # Mesa 3-D graphics library -# Version: 5.0 -# Copyright (C) 1995-2002 Brian Paul +# Version: 5.1 +# Copyright (C) 1995-2003 Brian Paul # Makefile for core library @@ -26,6 +26,7 @@ CORE_SOURCES = \ api_noop.c \ api_validate.c \ accum.c \ + arbprogram.c \ attrib.c \ blend.c \ bufferobj.c \ diff --git a/src/mesa/main/Makefile.ugl b/src/mesa/main/Makefile.ugl index b01b564f79..b440e13643 100644 --- a/src/mesa/main/Makefile.ugl +++ b/src/mesa/main/Makefile.ugl @@ -56,6 +56,7 @@ GL_SOURCES = \ api_noop.c \ api_validate.c \ accum.c \ + arbprogram.c \ attrib.c \ blend.c \ bufferobj.c \ diff --git a/src/mesa/main/Makefile.win b/src/mesa/main/Makefile.win index e1923dffeb..63b5880c82 100644 --- a/src/mesa/main/Makefile.win +++ b/src/mesa/main/Makefile.win @@ -16,6 +16,7 @@ CORE_SRCS = \ api_noop.c \ api_validate.c \ accum.c \ + arbprogram.c \ attrib.c \ blend.c \ bufferobj.c \ diff --git a/src/mesa/main/arbprogram.c b/src/mesa/main/arbprogram.c index f78f257aa6..eeac11bd98 100644 --- a/src/mesa/main/arbprogram.c +++ b/src/mesa/main/arbprogram.c @@ -40,13 +40,21 @@ /* XXX temporary */ -extern void _mesa_parse_arb_vertex_program(GLcontext *ctx, GLenum target, - const GLubyte *string, GLsizei len, - struct vertex_program *prog); +static void +_mesa_parse_arb_vertex_program(GLcontext *ctx, GLenum target, + const GLubyte *string, GLsizei len, + struct vertex_program *prog) +{ +} + + +static void +_mesa_parse_arb_fragment_program(GLcontext *ctx, GLenum target, + const GLubyte *string, GLsizei len, + struct fragment_program *prog) +{ +} -extern void _mesa_parse_arb_fragment_program(GLcontext *ctx, GLenum target, - const GLubyte *string, GLsizei len, - struct fragment_program *prog); void @@ -448,7 +456,7 @@ _mesa_BindProgramARB(GLenum target, GLuint program) */ if (program == 0) { /* default program */ - if (target == GL_VERTEX_PROGRAM_NV) + if (target == GL_VERTEX_PROGRAM_ARB) prog = ctx->Shared->DefaultVertexProgram; else prog = ctx->Shared->DefaultFragmentProgram; @@ -471,10 +479,11 @@ _mesa_BindProgramARB(GLenum target, GLuint program) } /* bind now */ - if (target == GL_VERTEX_PROGRAM_NV) { + if (target == GL_VERTEX_PROGRAM_ARB) { ctx->VertexProgram.Current = (struct vertex_program *) prog; } - else if (target == GL_FRAGMENT_PROGRAM_NV) { + else { + ASSERT(target == GL_FRAGMENT_PROGRAM_ARB); ctx->FragmentProgram.Current = (struct fragment_program *) prog; } @@ -528,7 +537,7 @@ _mesa_ProgramEnvParameter4fARB(GLenum target, GLuint index, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); - if (target == GL_FRAGMENT_PROGRAM_NV + if (target == GL_FRAGMENT_PROGRAM_ARB && ctx->Extensions.ARB_fragment_program) { if (index >= ctx->Const.MaxFragmentProgramEnvParams) { _mesa_error(ctx, GL_INVALID_VALUE, "glProgramEnvParameter(index)"); @@ -537,7 +546,7 @@ _mesa_ProgramEnvParameter4fARB(GLenum target, GLuint index, index += MAX_NV_FRAGMENT_PROGRAM_TEMPS; /* XXX fix */ ASSIGN_4V(ctx->FragmentProgram.Machine.Registers[index], x, y, z, w); } - if (target == GL_VERTEX_PROGRAM_NV + if (target == GL_VERTEX_PROGRAM_ARB && ctx->Extensions.ARB_vertex_program) { if (index >= ctx->Const.MaxVertexProgramEnvParams) { _mesa_error(ctx, GL_INVALID_VALUE, "glProgramEnvParameter(index)"); @@ -586,7 +595,7 @@ _mesa_GetProgramEnvParameterfvARB(GLenum target, GLuint index, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); - if (target == GL_FRAGMENT_PROGRAM_NV + if (target == GL_FRAGMENT_PROGRAM_ARB && ctx->Extensions.ARB_fragment_program) { if (index >= ctx->Const.MaxFragmentProgramEnvParams) { _mesa_error(ctx, GL_INVALID_VALUE, "glGetProgramEnvParameter(index)"); @@ -595,7 +604,7 @@ _mesa_GetProgramEnvParameterfvARB(GLenum target, GLuint index, index += MAX_NV_FRAGMENT_PROGRAM_TEMPS; /* XXX fix */ COPY_4V(params, ctx->FragmentProgram.Machine.Registers[index]); } - if (target == GL_VERTEX_PROGRAM_NV + if (target == GL_VERTEX_PROGRAM_ARB && ctx->Extensions.ARB_vertex_program) { if (index >= ctx->Const.MaxVertexProgramEnvParams) { _mesa_error(ctx, GL_INVALID_VALUE, "glGetProgramEnvParameter(index)"); @@ -611,8 +620,9 @@ _mesa_GetProgramEnvParameterfvARB(GLenum target, GLuint index, } -#if 111 /* from nvprogram.c */ - +/** + * Note, this function is also used by the GL_NV_fragment_program extension. + */ void _mesa_ProgramLocalParameter4fARB(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) @@ -661,6 +671,9 @@ _mesa_ProgramLocalParameter4fARB(GLenum target, GLuint index, } +/** + * Note, this function is also used by the GL_NV_fragment_program extension. + */ void _mesa_ProgramLocalParameter4fvARB(GLenum target, GLuint index, const GLfloat *params) @@ -670,6 +683,9 @@ _mesa_ProgramLocalParameter4fvARB(GLenum target, GLuint index, } +/** + * Note, this function is also used by the GL_NV_fragment_program extension. + */ void _mesa_ProgramLocalParameter4dARB(GLenum target, GLuint index, GLdouble x, GLdouble y, @@ -680,6 +696,9 @@ _mesa_ProgramLocalParameter4dARB(GLenum target, GLuint index, } +/** + * Note, this function is also used by the GL_NV_fragment_program extension. + */ void _mesa_ProgramLocalParameter4dvARB(GLenum target, GLuint index, const GLdouble *params) @@ -690,6 +709,9 @@ _mesa_ProgramLocalParameter4dvARB(GLenum target, GLuint index, } +/** + * Note, this function is also used by the GL_NV_fragment_program extension. + */ void _mesa_GetProgramLocalParameterfvARB(GLenum target, GLuint index, GLfloat *params) @@ -704,13 +726,16 @@ _mesa_GetProgramLocalParameterfvARB(GLenum target, GLuint index, prog = &(ctx->VertexProgram.Current->Base); maxParams = ctx->Const.MaxVertexProgramLocalParams; } - else if ((target == GL_FRAGMENT_PROGRAM_ARB - && ctx->Extensions.ARB_fragment_program) || - (target == GL_FRAGMENT_PROGRAM_NV - && ctx->Extensions.NV_fragment_program)) { + else if (target == GL_FRAGMENT_PROGRAM_ARB + && ctx->Extensions.ARB_fragment_program) { prog = &(ctx->FragmentProgram.Current->Base); maxParams = ctx->Const.MaxFragmentProgramLocalParams; } + else if (target == GL_FRAGMENT_PROGRAM_NV + && ctx->Extensions.NV_fragment_program) { + prog = &(ctx->FragmentProgram.Current->Base); + maxParams = MAX_NV_FRAGMENT_PROGRAM_PARAMS; + } else { _mesa_error(ctx, GL_INVALID_ENUM, "glGetProgramLocalParameterARB(target)"); @@ -728,60 +753,21 @@ _mesa_GetProgramLocalParameterfvARB(GLenum target, GLuint index, } +/** + * Note, this function is also used by the GL_NV_fragment_program extension. + */ void _mesa_GetProgramLocalParameterdvARB(GLenum target, GLuint index, GLdouble *params) { + GET_CURRENT_CONTEXT(ctx); GLfloat floatParams[4]; _mesa_GetProgramLocalParameterfvARB(target, index, floatParams); - COPY_4V(params, floatParams); -} - -#else /* stubs */ - -void -_mesa_ProgramLocalParameter4dARB(GLenum target, GLuint index, - GLdouble x, GLdouble y, - GLdouble z, GLdouble w) -{ -} - - -void -_mesa_ProgramLocalParameter4dvARB(GLenum target, GLuint index, - const GLdouble *params) -{ -} - - -void -_mesa_ProgramLocalParameter4fARB(GLenum target, GLuint index, - GLfloat x, GLfloat y, GLfloat z, GLfloat w) -{ -} - - -void -_mesa_ProgramLocalParameter4fvARB(GLenum target, GLuint index, - const GLfloat *params) -{ -} - -void -_mesa_GetProgramLocalParameterdvARB(GLenum target, GLuint index, - GLdouble *params) -{ -} - - -void -_mesa_GetProgramLocalParameterfvARB(GLenum target, GLuint index, - GLfloat *params) -{ + if (ctx->ErrorValue == GL_NO_ERROR) { + COPY_4V(params, floatParams); + } } -#endif /* stubs */ - void _mesa_GetProgramivARB(GLenum target, GLenum pname, GLint *params) diff --git a/src/mesa/main/descrip.mms b/src/mesa/main/descrip.mms index d734092edd..bc79a5de03 100644 --- a/src/mesa/main/descrip.mms +++ b/src/mesa/main/descrip.mms @@ -19,6 +19,7 @@ CORE_SOURCES =accum.c \ api_loopback.c \ api_noop.c \ api_validate.c \ + arbprogram.c \ attrib.c \ blend.c \ bufferobj.c \ diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index 3fbb2ad928..00f7dad81a 100644 --- a/src/mesa/main/dlist.c +++ b/src/mesa/main/dlist.c @@ -1,10 +1,8 @@ -/* $Id: dlist.c,v 1.103 2003/03/03 15:37:45 brianp Exp $ */ - /* * Mesa 3-D graphics library - * Version: 5.0 + * Version: 5.1 * - * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2003 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -27,6 +25,10 @@ #include "glheader.h" #include "imports.h" #include "api_loopback.h" +#include "config.h" +#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program +#include "arbprogram.h" +#endif #include "attrib.h" #include "blend.h" #include "buffers.h" @@ -61,7 +63,7 @@ #include "texstate.h" #include "mtypes.h" #include "varray.h" -#if FEATURE_NV_vertex_program +#if FEATURE_NV_vertex_program || FEATURE_NV_fragment_program #include "nvprogram.h" #endif @@ -248,6 +250,9 @@ typedef enum { OPCODE_LOAD_PROGRAM_NV, OPCODE_PROGRAM_PARAMETER4F_NV, OPCODE_TRACK_MATRIX_NV, + /* GL_NV_fragment_program */ + OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, + OPCODE_PROGRAM_NAMED_PARAMETER_NV, /* GL_EXT_stencil_two_side */ OPCODE_ACTIVE_STENCIL_FACE_EXT, /* The following three are meta instructions */ @@ -336,6 +341,7 @@ void _mesa_destroy_list( GLcontext *ctx, GLuint list ) } else { switch (n[0].opcode) { + /* for some commands, we need to free malloc'd memory */ case OPCODE_MAP1: FREE(n[6].data); n += InstSize[n[0].opcode]; @@ -420,6 +426,12 @@ void _mesa_destroy_list( GLcontext *ctx, GLuint list ) FREE(n[11].data); n += InstSize[n[0].opcode]; break; +#if FEATURE_NV_fragment_program + case OPCODE_PROGRAM_NAMED_PARAMETER_NV: + FREE(n[3].data); + n += InstSize[n[0].opcode]; + break; +#endif case OPCODE_CONTINUE: n = (Node *) n[1].next; FREE( block ); @@ -644,6 +656,9 @@ void _mesa_init_lists( void ) InstSize[OPCODE_LOAD_PROGRAM_NV] = 4; InstSize[OPCODE_PROGRAM_PARAMETER4F_NV] = 7; InstSize[OPCODE_TRACK_MATRIX_NV] = 5; + /* GL_NV_fragment_program */ + InstSize[OPCODE_PROGRAM_LOCAL_PARAMETER_ARB] = 7; + InstSize[OPCODE_PROGRAM_NAMED_PARAMETER_NV] = 8; /* GL_EXT_stencil_two_side */ InstSize[OPCODE_ACTIVE_STENCIL_FACE_EXT] = 2; } @@ -4119,6 +4134,160 @@ save_TrackMatrixNV(GLenum target, GLuint address, #endif /* FEATURE_NV_vertex_program */ +/* + * GL_NV_fragment_program + */ +#if FEATURE_NV_fragment_program +static void +save_ProgramLocalParameter4fARB(GLenum target, GLuint index, + 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_PROGRAM_LOCAL_PARAMETER_ARB, 6 ); + if (n) { + n[1].e = target; + n[2].ui = index; + n[3].f = x; + n[4].f = y; + n[5].f = z; + n[6].f = w; + } + if (ctx->ExecuteFlag) { + (*ctx->Exec->ProgramLocalParameter4fARB)(target, index, x, y, z, w); + } +} + + +static void +save_ProgramLocalParameter4fvARB(GLenum target, GLuint index, + const GLfloat *params) +{ + GET_CURRENT_CONTEXT(ctx); + Node *n; + ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); + n = ALLOC_INSTRUCTION( ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6 ); + if (n) { + n[1].e = target; + n[2].ui = index; + n[3].f = params[0]; + n[4].f = params[1]; + n[5].f = params[2]; + n[6].f = params[3]; + } + if (ctx->ExecuteFlag) { + (*ctx->Exec->ProgramLocalParameter4fvARB)(target, index, params); + } +} + + +static void +save_ProgramLocalParameter4dARB(GLenum target, GLuint index, + GLdouble x, GLdouble y, + GLdouble z, GLdouble w) +{ + GET_CURRENT_CONTEXT(ctx); + Node *n; + ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); + n = ALLOC_INSTRUCTION( ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6 ); + if (n) { + n[1].e = target; + n[2].ui = index; + n[3].f = x; + n[4].f = y; + n[5].f = z; + n[6].f = w; + } + if (ctx->ExecuteFlag) { + (*ctx->Exec->ProgramLocalParameter4dARB)(target, index, x, y, z, w); + } +} + + +static void +save_ProgramLocalParameter4dvARB(GLenum target, GLuint index, + const GLdouble *params) +{ + GET_CURRENT_CONTEXT(ctx); + Node *n; + ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); + n = ALLOC_INSTRUCTION( ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6 ); + if (n) { + n[1].e = target; + n[2].ui = index; + n[3].f = params[0]; + n[4].f = params[1]; + n[5].f = params[2]; + n[6].f = params[3]; + } + if (ctx->ExecuteFlag) { + (*ctx->Exec->ProgramLocalParameter4dvARB)(target, index, params); + } +} + +static void +save_ProgramNamedParameter4fNV(GLuint id, GLsizei len, const GLubyte *name, + GLfloat x, GLfloat y, GLfloat z, GLfloat w) +{ + GET_CURRENT_CONTEXT(ctx); + Node *n; + GLubyte *nameCopy; + + nameCopy = _mesa_malloc(len); + if (!nameCopy) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glProgramNamedParameter4fNV"); + return; + } + _mesa_memcpy(nameCopy, name, len); + + ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); + n = ALLOC_INSTRUCTION( ctx, OPCODE_PROGRAM_NAMED_PARAMETER_NV, 6 ); + if (n) { + n[1].ui = id; + n[2].i = len; + n[3].data = nameCopy; + n[4].f = x; + n[5].f = y; + n[6].f = z; + n[7].f = w; + } + if (ctx->ExecuteFlag) { + (*ctx->Exec->ProgramNamedParameter4fNV)(id, len, name, x, y, z, w); + } +} + + +static void +save_ProgramNamedParameter4fvNV(GLuint id, GLsizei len, const GLubyte *name, + const float v[]) +{ + save_ProgramNamedParameter4fNV(id, len, name, v[0], v[1], v[2], v[3]); +} + + +static void +save_ProgramNamedParameter4dNV(GLuint id, GLsizei len, const GLubyte *name, + GLdouble x, GLdouble y, GLdouble z, GLdouble w) +{ + save_ProgramNamedParameter4fNV(id, len, name, (GLfloat) x, (GLfloat) y, + (GLfloat) z,(GLfloat) w); +} + + +static void +save_ProgramNamedParameter4dvNV(GLuint id, GLsizei len, const GLubyte *name, + const double v[]) +{ + save_ProgramNamedParameter4fNV(id, len, name, (GLfloat) v[0], + (GLfloat) v[1], (GLfloat) v[2], + (GLfloat) v[3]); +} + +#endif /* FEATURE_NV_fragment_program */ + + + /* GL_EXT_stencil_two_side */ static void save_ActiveStencilFaceEXT( GLenum face ) { @@ -4836,6 +5005,7 @@ execute_list( GLcontext *ctx, GLuint list ) case OPCODE_WINDOW_POS_ARB: /* GL_ARB_window_pos */ (*ctx->Exec->WindowPos3fMESA)( n[1].f, n[2].f, n[3].f ); break; +#if FEATURE_NV_vertex_program case OPCODE_BIND_PROGRAM_NV: /* GL_NV_vertex_program */ (*ctx->Exec->BindProgramNV)( n[1].e, n[2].ui ); break; @@ -4866,6 +5036,18 @@ execute_list( GLcontext *ctx, GLuint list ) case OPCODE_TRACK_MATRIX_NV: (*ctx->Exec->TrackMatrixNV)(n[1].e, n[2].ui, n[3].e, n[4].e); break; +#endif + +#if FEATURE_NV_fragment_program + case OPCODE_PROGRAM_LOCAL_PARAMETER_ARB: + (*ctx->Exec->ProgramLocalParameter4fARB)(n[1].e, n[2].ui, n[3].f, + n[4].f, n[5].f, n[6].f); + break; + case OPCODE_PROGRAM_NAMED_PARAMETER_NV: + (*ctx->Exec->ProgramNamedParameter4fNV)(n[1].ui, n[2].i, n[3].data, + n[4].f, n[5].f, n[6].f, n[7].f); + break; +#endif case OPCODE_CONTINUE: n = (Node *) n[1].next; @@ -6230,6 +6412,22 @@ _mesa_init_dlist_table( struct _glapi_table *table, GLuint tableSize ) table->VertexAttribPointerNV = _mesa_VertexAttribPointerNV; #endif + /* 282. GL_NV_fragment_program */ +#if FEATURE_NV_fragment_program + table->ProgramNamedParameter4fNV = save_ProgramNamedParameter4fNV; + table->ProgramNamedParameter4dNV = save_ProgramNamedParameter4dNV; + table->ProgramNamedParameter4fvNV = save_ProgramNamedParameter4fvNV; + table->ProgramNamedParameter4dvNV = save_ProgramNamedParameter4dvNV; + table->GetProgramNamedParameterfvNV = _mesa_GetProgramNamedParameterfvNV; + table->GetProgramNamedParameterdvNV = _mesa_GetProgramNamedParameterdvNV; + table->ProgramLocalParameter4dARB = save_ProgramLocalParameter4dARB; + table->ProgramLocalParameter4dvARB = save_ProgramLocalParameter4dvARB; + table->ProgramLocalParameter4fARB = save_ProgramLocalParameter4fARB; + table->ProgramLocalParameter4fvARB = save_ProgramLocalParameter4fvARB; + table->GetProgramLocalParameterdvARB = _mesa_GetProgramLocalParameterdvARB; + table->GetProgramLocalParameterfvARB = _mesa_GetProgramLocalParameterfvARB; +#endif + /* 262. GL_NV_point_sprite */ table->PointParameteriNV = save_PointParameteriNV; table->PointParameterivNV = save_PointParameterivNV; @@ -6260,10 +6458,17 @@ _mesa_init_dlist_table( struct _glapi_table *table, GLuint tableSize ) table->GetCompressedTexImageARB = exec_GetCompressedTexImageARB; /* ARB 14. GL_ARB_point_parameters */ - /* re-use EXT_point_parameters functions */ + /* aliased with EXT_point_parameters functions */ /* ARB 25. GL_ARB_window_pos */ - /* re-use MESA_window_pos functions */ + /* aliased with MESA_window_pos functions */ + + /* ARB 26. GL_ARB_vertex_program */ + /* XXX todo */ + /* ARB 27. GL_ARB_vertex_program */ + /* XXX todo */ + /* ARB 28. GL_ARB_vertex_buffer_object */ + /* XXX todo */ } diff --git a/src/mesa/main/nvprogram.c b/src/mesa/main/nvprogram.c index b91bf21e58..af1ff36f79 100644 --- a/src/mesa/main/nvprogram.c +++ b/src/mesa/main/nvprogram.c @@ -1183,7 +1183,7 @@ _mesa_GetProgramNamedParameterdvNV(GLuint id, GLsizei len, const GLubyte *name, } -/* XXX move into arbprogram.c */ +#if 000 void _mesa_ProgramLocalParameter4fARB(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) @@ -1284,3 +1284,4 @@ _mesa_GetProgramLocalParameterdvARB(GLenum target, GLuint index, _mesa_GetProgramLocalParameterfvARB(target, index, floatParams); COPY_4V(params, floatParams); } +#endif diff --git a/src/mesa/main/nvprogram.h b/src/mesa/main/nvprogram.h index bc5118dbc2..c9b8a838d9 100644 --- a/src/mesa/main/nvprogram.h +++ b/src/mesa/main/nvprogram.h @@ -1,5 +1,3 @@ -/* $Id: nvprogram.h,v 1.7 2003/04/17 01:48:20 brianp Exp $ */ - /* * Mesa 3-D graphics library * Version: 5.1 @@ -147,6 +145,7 @@ extern void _mesa_GetProgramNamedParameterdvNV(GLuint id, GLsizei len, const GLubyte *name, GLdouble *params); +#if 0 extern void _mesa_ProgramLocalParameter4fARB(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); @@ -171,6 +170,7 @@ _mesa_GetProgramLocalParameterfvARB(GLenum target, GLuint index, extern void _mesa_GetProgramLocalParameterdvARB(GLenum target, GLuint index, GLdouble *params); +#endif #endif diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c index ed3499c8e6..15b19d7a7b 100644 --- a/src/mesa/main/state.c +++ b/src/mesa/main/state.c @@ -1,4 +1,4 @@ -/* $Id: state.c,v 1.103 2003/04/08 02:27:16 brianp Exp $ */ +/* $Id: state.c,v 1.104 2003/04/17 02:33:09 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -34,6 +34,9 @@ #include "glheader.h" #include "accum.h" #include "api_loopback.h" +#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program +#include "arbprogram.h" +#endif #include "attrib.h" #include "blend.h" #if FEATURE_ARB_vertex_buffer_object @@ -510,6 +513,7 @@ _mesa_init_exec_table(struct _glapi_table *exec, GLuint tableSize) exec->VertexAttribPointerNV = _mesa_VertexAttribPointerNV; #endif + /* 282. GL_NV_fragment_program */ #if FEATURE_NV_fragment_program exec->ProgramNamedParameter4fNV = _mesa_ProgramNamedParameter4fNV; exec->ProgramNamedParameter4dNV = _mesa_ProgramNamedParameter4dNV; @@ -557,6 +561,73 @@ _mesa_init_exec_table(struct _glapi_table *exec, GLuint tableSize) /* ARB 14. GL_ARB_point_parameters */ /* reuse EXT_point_parameters functions */ + /* ARB 26. GL_ARB_vertex_program */ + /* ARB 27. GL_ARB_fragment_program */ +#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program + exec->VertexAttrib1sARB = _mesa_VertexAttrib1sARB; + exec->VertexAttrib1fARB = _mesa_VertexAttrib1fARB; + exec->VertexAttrib1dARB = _mesa_VertexAttrib1dARB; + exec->VertexAttrib2sARB = _mesa_VertexAttrib2sARB; + exec->VertexAttrib2fARB = _mesa_VertexAttrib2fARB; + exec->VertexAttrib2dARB = _mesa_VertexAttrib2dARB; + exec->VertexAttrib3sARB = _mesa_VertexAttrib3sARB; + exec->VertexAttrib3fARB = _mesa_VertexAttrib3fARB; + exec->VertexAttrib3dARB = _mesa_VertexAttrib3dARB; + exec->VertexAttrib4sARB = _mesa_VertexAttrib4sARB; + exec->VertexAttrib4fARB = _mesa_VertexAttrib4fARB; + exec->VertexAttrib4dARB = _mesa_VertexAttrib4dARB; + exec->VertexAttrib4NubARB = _mesa_VertexAttrib4NubARB; + exec->VertexAttrib1svARB = _mesa_VertexAttrib1svARB; + exec->VertexAttrib1fvARB = _mesa_VertexAttrib1fvARB; + exec->VertexAttrib1dvARB = _mesa_VertexAttrib1dvARB; + exec->VertexAttrib2svARB = _mesa_VertexAttrib2svARB; + exec->VertexAttrib2fvARB = _mesa_VertexAttrib2fvARB; + exec->VertexAttrib2dvARB = _mesa_VertexAttrib2dvARB; + exec->VertexAttrib3svARB = _mesa_VertexAttrib3svARB; + exec->VertexAttrib3fvARB = _mesa_VertexAttrib3fvARB; + exec->VertexAttrib3dvARB = _mesa_VertexAttrib3dvARB; + exec->VertexAttrib4bvARB = _mesa_VertexAttrib4bvARB; + exec->VertexAttrib4svARB = _mesa_VertexAttrib4svARB; + exec->VertexAttrib4ivARB = _mesa_VertexAttrib4ivARB; + exec->VertexAttrib4ubvARB = _mesa_VertexAttrib4ubvARB; + exec->VertexAttrib4usvARB = _mesa_VertexAttrib4usvARB; + exec->VertexAttrib4uivARB = _mesa_VertexAttrib4uivARB; + exec->VertexAttrib4fvARB = _mesa_VertexAttrib4fvARB; + exec->VertexAttrib4dvARB = _mesa_VertexAttrib4dvARB; + exec->VertexAttrib4NbvARB = _mesa_VertexAttrib4NbvARB; + exec->VertexAttrib4NsvARB = _mesa_VertexAttrib4NsvARB; + exec->VertexAttrib4NivARB = _mesa_VertexAttrib4NivARB; + exec->VertexAttrib4NubvARB = _mesa_VertexAttrib4NubvARB; + exec->VertexAttrib4NusvARB = _mesa_VertexAttrib4NusvARB; + exec->VertexAttrib4NuivARB = _mesa_VertexAttrib4NuivARB; + exec->VertexAttribPointerARB = _mesa_VertexAttribPointerARB; + exec->EnableVertexAttribArrayARB = _mesa_EnableVertexAttribArrayARB; + exec->DisableVertexAttribArrayARB = _mesa_DisableVertexAttribArrayARB; + exec->ProgramStringARB = _mesa_ProgramStringARB; + exec->BindProgramARB = _mesa_BindProgramARB; + exec->DeleteProgramsARB = _mesa_DeleteProgramsARB; + exec->GenProgramsARB = _mesa_GenProgramsARB; + exec->ProgramEnvParameter4dARB = _mesa_ProgramEnvParameter4dARB; + exec->ProgramEnvParameter4dvARB = _mesa_ProgramEnvParameter4dvARB; + exec->ProgramEnvParameter4fARB = _mesa_ProgramEnvParameter4fARB; + exec->ProgramEnvParameter4fvARB = _mesa_ProgramEnvParameter4fvARB; + exec->ProgramLocalParameter4dARB = _mesa_ProgramLocalParameter4dARB; + exec->ProgramLocalParameter4dvARB = _mesa_ProgramLocalParameter4dvARB; + exec->ProgramLocalParameter4fARB = _mesa_ProgramLocalParameter4fARB; + exec->ProgramLocalParameter4fvARB = _mesa_ProgramLocalParameter4fvARB; + exec->GetProgramEnvParameterdvARB = _mesa_GetProgramEnvParameterdvARB; + exec->GetProgramEnvParameterfvARB = _mesa_GetProgramEnvParameterfvARB; + exec->GetProgramLocalParameterdvARB = _mesa_GetProgramLocalParameterdvARB; + exec->GetProgramLocalParameterfvARB = _mesa_GetProgramLocalParameterfvARB; + exec->GetProgramivARB = _mesa_GetProgramivARB; + exec->GetProgramStringARB = _mesa_GetProgramStringARB; + exec->GetVertexAttribdvARB = _mesa_GetVertexAttribdvARB; + exec->GetVertexAttribfvARB = _mesa_GetVertexAttribfvARB; + exec->GetVertexAttribivARB = _mesa_GetVertexAttribivARB; + exec->GetVertexAttribPointervARB = _mesa_GetVertexAttribPointervARB; + exec->IsProgramARB = _mesa_IsProgramARB; +#endif + /* ARB 28. GL_ARB_vertex_buffer_object */ #if FEATURE_ARB_vertex_buffer_object exec->BindBufferARB = _mesa_BindBufferARB; |