From 5568a7d30120d830c93494a7b3382bfa8b4d2800 Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 17 Aug 2007 15:26:33 +0100 Subject: added vbo_use_buffer_objects() to specify that immediate mode data should be put into bufferobjects --- src/mesa/vbo/vbo_exec_api.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'src/mesa/vbo/vbo_exec_api.c') diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c index 7f56b3b629..24e2eba472 100644 --- a/src/mesa/vbo/vbo_exec_api.c +++ b/src/mesa/vbo/vbo_exec_api.c @@ -631,6 +631,41 @@ static void vbo_exec_vtxfmt_init( struct vbo_exec_context *exec ) } +/** + * Tell the VBO module to use a real OpenGL vertex buffer object to + * store accumulated immediate-mode vertex data. + * This replaces the malloced buffer which was created in + * vb_exec_vtx_init() below. + */ +void vbo_use_buffer_objects(GLcontext *ctx) +{ + struct vbo_exec_context *exec = &vbo_context(ctx)->exec; + /* Any buffer name but 0 can be used here since this bufferobj won't + * go into the bufferobj hashtable. + */ + GLuint bufName = 0xaabbccdd; + GLenum target = GL_ARRAY_BUFFER_ARB; + GLenum access = GL_READ_WRITE_ARB; + GLenum usage = GL_STREAM_DRAW_ARB; + GLsizei size = VBO_VERT_BUFFER_SIZE * sizeof(GLfloat); + + /* Make sure this func is only used once */ + assert(exec->vtx.bufferobj == ctx->Array.NullBufferObj); + if (exec->vtx.buffer_map) { + _mesa_align_free(exec->vtx.buffer_map); + } + + /* Allocate a real buffer object now */ + exec->vtx.bufferobj = ctx->Driver.NewBufferObject(ctx, bufName, target); + ctx->Driver.BufferData(ctx, target, size, NULL, usage, exec->vtx.bufferobj); + + /* and map it */ + exec->vtx.buffer_map + = ctx->Driver.MapBuffer(ctx, target, access, exec->vtx.bufferobj); +} + + + void vbo_exec_vtx_init( struct vbo_exec_context *exec ) { GLcontext *ctx = exec->ctx; -- cgit v1.2.3 From f252974121febc6a1a59793d932b32b798f90fc6 Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 20 Aug 2007 11:05:35 -0600 Subject: fix VBO clean-up in vbo_exec_vtx_destroy() --- src/mesa/vbo/vbo_exec_api.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'src/mesa/vbo/vbo_exec_api.c') diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c index 24e2eba472..b7f4d8a307 100644 --- a/src/mesa/vbo/vbo_exec_api.c +++ b/src/mesa/vbo/vbo_exec_api.c @@ -673,7 +673,8 @@ void vbo_exec_vtx_init( struct vbo_exec_context *exec ) GLuint i; /* Allocate a buffer object. Will just reuse this object - * continuously. + * continuously, unless vbo_use_buffer_objects() is called to enable + * use of real VBOs. */ exec->vtx.bufferobj = ctx->Array.NullBufferObj; exec->vtx.buffer_map = ALIGN_MALLOC(VBO_VERT_BUFFER_SIZE * sizeof(GLfloat), 64); @@ -702,9 +703,17 @@ void vbo_exec_vtx_init( struct vbo_exec_context *exec ) void vbo_exec_vtx_destroy( struct vbo_exec_context *exec ) { - if (exec->vtx.buffer_map) { - ALIGN_FREE(exec->vtx.buffer_map); - exec->vtx.buffer_map = NULL; + GLcontext *ctx = exec->ctx; + if (exec->vtx.bufferobj->Name) { + ctx->Driver.UnmapBuffer(ctx, GL_ARRAY_BUFFER_ARB, exec->vtx.bufferobj); + ctx->Driver.DeleteBuffer(ctx, exec->vtx.bufferobj); + exec->vtx.bufferobj = NULL; + } + else { + if (exec->vtx.buffer_map) { + ALIGN_FREE(exec->vtx.buffer_map); + exec->vtx.buffer_map = NULL; + } } } -- cgit v1.2.3 From d08cd68d3f5456b69ad504ede2b090c0bb6474db Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Mon, 10 Mar 2008 19:44:54 +0000 Subject: mesa: fast-track glColor and similar calls when not immediate mode rendering Often these are mixed in with draw arrays calls, etc. Try not to get the whole immediate rendering state machine going when we receive one of these on their own. --- src/mesa/vbo/vbo_exec_api.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/mesa/vbo/vbo_exec_api.c') diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c index b7f4d8a307..35dc0e768f 100644 --- a/src/mesa/vbo/vbo_exec_api.c +++ b/src/mesa/vbo/vbo_exec_api.c @@ -309,16 +309,23 @@ static void vbo_exec_fixup_vertex( GLcontext *ctx, GLuint attr, GLuint sz ) { struct vbo_exec_context *exec = &vbo_context(ctx)->exec; + static const GLfloat id[4] = { 0, 0, 0, 1 }; int i; - if (sz > exec->vtx.attrsz[attr]) { + if (exec->vtx.prim_count == 0) { + GLfloat *current = (GLfloat *)vbo_context(ctx)->currval[attr].Ptr; + exec->vtx.attrptr[attr] = current; + memcpy(current, id, sizeof(id)); + ctx->Driver.NeedFlush |= FLUSH_UPDATE_CURRENT; + return; + } + else if (sz > exec->vtx.attrsz[attr]) { /* New size is larger. Need to flush existing vertices and get * an enlarged vertex format. */ vbo_exec_wrap_upgrade_vertex( exec, attr, sz ); } else if (sz < exec->vtx.active_sz[attr]) { - static const GLfloat id[4] = { 0, 0, 0, 1 }; /* New size is smaller - just need to fill in some * zeros. Don't need to flush or wrap. -- cgit v1.2.3 From c45a525cdc4bd5f9b35c4f6abae6a65f3279e2c4 Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 14 Mar 2008 10:20:29 -0600 Subject: mesa: revert fast-track glColor and similar calls when not immediate mode rendering Revert commit d08cd68d3f5456b69ad504ede2b090c0bb6474db This change caused some glean tests to fail. The alpha value of colors was always 1.0 instead of the value from glColor4fv(). The mesa color array found in st_draw() has size=3 instead of size=4. --- src/mesa/vbo/vbo_exec_api.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'src/mesa/vbo/vbo_exec_api.c') diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c index 35dc0e768f..b7f4d8a307 100644 --- a/src/mesa/vbo/vbo_exec_api.c +++ b/src/mesa/vbo/vbo_exec_api.c @@ -309,23 +309,16 @@ static void vbo_exec_fixup_vertex( GLcontext *ctx, GLuint attr, GLuint sz ) { struct vbo_exec_context *exec = &vbo_context(ctx)->exec; - static const GLfloat id[4] = { 0, 0, 0, 1 }; int i; - if (exec->vtx.prim_count == 0) { - GLfloat *current = (GLfloat *)vbo_context(ctx)->currval[attr].Ptr; - exec->vtx.attrptr[attr] = current; - memcpy(current, id, sizeof(id)); - ctx->Driver.NeedFlush |= FLUSH_UPDATE_CURRENT; - return; - } - else if (sz > exec->vtx.attrsz[attr]) { + if (sz > exec->vtx.attrsz[attr]) { /* New size is larger. Need to flush existing vertices and get * an enlarged vertex format. */ vbo_exec_wrap_upgrade_vertex( exec, attr, sz ); } else if (sz < exec->vtx.active_sz[attr]) { + static const GLfloat id[4] = { 0, 0, 0, 1 }; /* New size is smaller - just need to fill in some * zeros. Don't need to flush or wrap. -- cgit v1.2.3 From d758479b9fbff803bdac15f3f39d32ef9064db71 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 11 Apr 2008 10:14:17 -0600 Subject: mesa: Fix glBegin-time test for invalid programs/shaders. Cherry-picked from master. --- src/mesa/vbo/vbo_exec.h | 3 +++ src/mesa/vbo/vbo_exec_api.c | 31 +++++++++++++++++++++++-------- src/mesa/vbo/vbo_exec_array.c | 15 +++++++++++++++ 3 files changed, 41 insertions(+), 8 deletions(-) (limited to 'src/mesa/vbo/vbo_exec_api.c') diff --git a/src/mesa/vbo/vbo_exec.h b/src/mesa/vbo/vbo_exec.h index b7e8c9fe79..ddbcbe1181 100644 --- a/src/mesa/vbo/vbo_exec.h +++ b/src/mesa/vbo/vbo_exec.h @@ -162,4 +162,7 @@ void vbo_exec_do_EvalCoord2f( struct vbo_exec_context *exec, void vbo_exec_do_EvalCoord1f( struct vbo_exec_context *exec, GLfloat u); +extern GLboolean +vbo_validate_shaders(GLcontext *ctx); + #endif diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c index b7f4d8a307..98580170e3 100644 --- a/src/mesa/vbo/vbo_exec_api.c +++ b/src/mesa/vbo/vbo_exec_api.c @@ -477,6 +477,23 @@ static void GLAPIENTRY vbo_exec_EvalPoint2( GLint i, GLint j ) } +/** + * Check if programs/shaders are enabled and valid at glBegin time. + */ +GLboolean +vbo_validate_shaders(GLcontext *ctx) +{ + if ((ctx->VertexProgram.Enabled && !ctx->VertexProgram._Enabled) || + (ctx->FragmentProgram.Enabled && !ctx->FragmentProgram._Enabled)) { + return GL_FALSE; + } + if (ctx->Shader.CurrentProgram && !ctx->Shader.CurrentProgram->LinkStatus) { + return GL_FALSE; + } + return GL_TRUE; +} + + /* Build a list of primitives on the fly. Keep * ctx->Driver.CurrentExecPrimitive uptodate as well. */ @@ -491,18 +508,16 @@ static void GLAPIENTRY vbo_exec_Begin( GLenum mode ) if (ctx->NewState) { _mesa_update_state( ctx ); - /* XXX also need to check if shader enabled, but invalid */ - if ((ctx->VertexProgram.Enabled && !ctx->VertexProgram._Enabled) || - (ctx->FragmentProgram.Enabled && !ctx->FragmentProgram._Enabled)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glBegin (invalid vertex/fragment program)"); - return; - } - CALL_Begin(ctx->Exec, (mode)); return; } + if (!vbo_validate_shaders(ctx)) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glBegin (invalid vertex/fragment program)"); + return; + } + /* Heuristic: attempt to isolate attributes occuring outside * begin/end pairs. */ diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c index 77f3cf1455..a52521db64 100644 --- a/src/mesa/vbo/vbo_exec_array.c +++ b/src/mesa/vbo/vbo_exec_array.c @@ -245,6 +245,11 @@ vbo_exec_DrawArrays(GLenum mode, GLint start, GLsizei count) if (ctx->NewState) _mesa_update_state( ctx ); + if (!vbo_validate_shaders(ctx)) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glDrawArrays(bad shader)"); + return; + } + bind_arrays( ctx ); prim[0].begin = 1; @@ -280,6 +285,11 @@ vbo_exec_DrawRangeElements(GLenum mode, if (ctx->NewState) _mesa_update_state( ctx ); + if (!vbo_validate_shaders(ctx)) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glDrawRangeElements(bad shader)"); + return; + } + bind_arrays( ctx ); ib.count = count; @@ -340,6 +350,11 @@ vbo_exec_DrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid *ind if (!_mesa_validate_DrawElements( ctx, mode, count, type, indices )) return; + if (!vbo_validate_shaders(ctx)) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glDrawElements(bad shader)"); + return; + } + if (ctx->Array.ElementArrayBufferObj->Name) { const GLvoid *map = ctx->Driver.MapBuffer(ctx, GL_ELEMENT_ARRAY_BUFFER_ARB, -- cgit v1.2.3 From 40d1a40f294f1ed2dacfad6f5498322fc08cc2d1 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 10 Jun 2008 16:13:42 -0600 Subject: mesa: refactor: move #define FEATURE flags into new mfeatures.h file Also, check the FEATURE flags in many places. --- src/mesa/main/api_exec.c | 140 ++++++++++++++++++++++++++++++-------------- src/mesa/main/api_exec.h | 5 +- src/mesa/main/api_noop.c | 9 +++ src/mesa/main/config.h | 38 ++---------- src/mesa/main/context.c | 50 +++++++++++++++- src/mesa/main/mfeatures.h | 77 ++++++++++++++++++++++++ src/mesa/main/state.c | 4 ++ src/mesa/main/texformat.c | 26 +++++--- src/mesa/main/teximage.c | 21 ++++++- src/mesa/main/texobj.c | 4 ++ src/mesa/main/texstate.c | 15 +++-- src/mesa/main/texstore.c | 17 +++++- src/mesa/vbo/vbo_context.c | 5 +- src/mesa/vbo/vbo_context.h | 6 +- src/mesa/vbo/vbo_exec.c | 1 - src/mesa/vbo/vbo_exec_api.c | 4 ++ 16 files changed, 323 insertions(+), 99 deletions(-) create mode 100644 src/mesa/main/mfeatures.h (limited to 'src/mesa/vbo/vbo_exec_api.c') diff --git a/src/mesa/main/api_exec.c b/src/mesa/main/api_exec.c index 8cdbaada9b..f7cf42f600 100644 --- a/src/mesa/main/api_exec.c +++ b/src/mesa/main/api_exec.c @@ -30,7 +30,9 @@ #include "glheader.h" +#if FEATURE_accum #include "accum.h" +#endif #include "api_loopback.h" #include "api_exec.h" #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program @@ -39,25 +41,42 @@ #if FEATURE_ATI_fragment_shader #include "shader/atifragshader.h" #endif +#if FEATURE_attrib_stack #include "attrib.h" +#endif #include "blend.h" #if FEATURE_ARB_vertex_buffer_object #include "bufferobj.h" #endif #include "arrayobj.h" +#if FEATURE_draw_read_buffer #include "buffers.h" +#endif #include "clear.h" #include "clip.h" +#if FEATURE_colortable #include "colortab.h" +#endif #include "context.h" +#if FEATURE_convolution #include "convolve.h" +#endif #include "depth.h" +#if FEATURE_dlist #include "dlist.h" +#endif +#if FEATURE_drawpix #include "drawpix.h" +#include "rastpos.h" +#endif #include "enable.h" +#if FEATURE_evaluators #include "eval.h" +#endif #include "get.h" +#if FEATURE_feadback #include "feedback.h" +#endif #include "fog.h" #if FEATURE_EXT_framebuffer_object #include "fbobject.h" @@ -65,21 +84,24 @@ #include "ffvertex_prog.h" #include "framebuffer.h" #include "hint.h" +#if FEATURE_histogram #include "histogram.h" +#endif #include "imports.h" #include "light.h" #include "lines.h" #include "macros.h" #include "matrix.h" #include "multisample.h" +#if FEATURE_pixel_transfer #include "pixel.h" +#endif #include "pixelstore.h" #include "points.h" #include "polygon.h" #if FEATURE_ARB_occlusion_query || FEATURE_EXT_timer_query #include "queryobj.h" #endif -#include "rastpos.h" #include "readpix.h" #include "scissor.h" #include "state.h" @@ -131,7 +153,10 @@ _mesa_init_exec_table(struct _glapi_table *exec) SET_ColorMask(exec, _mesa_ColorMask); SET_CullFace(exec, _mesa_CullFace); SET_Disable(exec, _mesa_Disable); +#if FEATURE_draw_read_buffer SET_DrawBuffer(exec, _mesa_DrawBuffer); + SET_ReadBuffer(exec, _mesa_ReadBuffer); +#endif SET_Enable(exec, _mesa_Enable); SET_Finish(exec, _mesa_Finish); SET_Flush(exec, _mesa_Flush); @@ -140,31 +165,20 @@ _mesa_init_exec_table(struct _glapi_table *exec) SET_GetError(exec, _mesa_GetError); SET_GetFloatv(exec, _mesa_GetFloatv); SET_GetString(exec, _mesa_GetString); - SET_InitNames(exec, _mesa_InitNames); SET_LineStipple(exec, _mesa_LineStipple); SET_LineWidth(exec, _mesa_LineWidth); SET_LoadIdentity(exec, _mesa_LoadIdentity); SET_LoadMatrixf(exec, _mesa_LoadMatrixf); - SET_LoadName(exec, _mesa_LoadName); SET_LogicOp(exec, _mesa_LogicOp); SET_MatrixMode(exec, _mesa_MatrixMode); SET_MultMatrixf(exec, _mesa_MultMatrixf); SET_Ortho(exec, _mesa_Ortho); SET_PixelStorei(exec, _mesa_PixelStorei); SET_PopMatrix(exec, _mesa_PopMatrix); - SET_PopName(exec, _mesa_PopName); SET_PushMatrix(exec, _mesa_PushMatrix); - SET_PushName(exec, _mesa_PushName); - SET_RasterPos2f(exec, _mesa_RasterPos2f); - SET_RasterPos2fv(exec, _mesa_RasterPos2fv); - SET_RasterPos2i(exec, _mesa_RasterPos2i); - SET_RasterPos2iv(exec, _mesa_RasterPos2iv); - SET_ReadBuffer(exec, _mesa_ReadBuffer); - SET_RenderMode(exec, _mesa_RenderMode); SET_Rotatef(exec, _mesa_Rotatef); SET_Scalef(exec, _mesa_Scalef); SET_Scissor(exec, _mesa_Scissor); - SET_SelectBuffer(exec, _mesa_SelectBuffer); SET_ShadeModel(exec, _mesa_ShadeModel); SET_StencilFunc(exec, _mesa_StencilFunc); SET_StencilMask(exec, _mesa_StencilMask); @@ -175,46 +189,57 @@ _mesa_init_exec_table(struct _glapi_table *exec) SET_TexParameteri(exec, _mesa_TexParameteri); SET_Translatef(exec, _mesa_Translatef); SET_Viewport(exec, _mesa_Viewport); -#if _HAVE_FULL_GL +#if FEATURE_accum SET_Accum(exec, _mesa_Accum); - SET_Bitmap(exec, _mesa_Bitmap); + SET_ClearAccum(exec, _mesa_ClearAccum); +#endif +#if FEATURE_dlist SET_CallList(exec, _mesa_CallList); SET_CallLists(exec, _mesa_CallLists); - SET_ClearAccum(exec, _mesa_ClearAccum); + SET_DeleteLists(exec, _mesa_DeleteLists); + SET_EndList(exec, _mesa_EndList); + SET_GenLists(exec, _mesa_GenLists); + SET_IsList(exec, _mesa_IsList); + SET_ListBase(exec, _mesa_ListBase); + SET_NewList(exec, _mesa_NewList); +#endif SET_ClearDepth(exec, _mesa_ClearDepth); SET_ClearIndex(exec, _mesa_ClearIndex); SET_ClipPlane(exec, _mesa_ClipPlane); SET_ColorMaterial(exec, _mesa_ColorMaterial); - SET_CopyPixels(exec, _mesa_CopyPixels); SET_CullParameterfvEXT(exec, _mesa_CullParameterfvEXT); SET_CullParameterdvEXT(exec, _mesa_CullParameterdvEXT); - SET_DeleteLists(exec, _mesa_DeleteLists); SET_DepthFunc(exec, _mesa_DepthFunc); SET_DepthMask(exec, _mesa_DepthMask); SET_DepthRange(exec, _mesa_DepthRange); +#if FEATURE_drawpix + SET_Bitmap(exec, _mesa_Bitmap); + SET_CopyPixels(exec, _mesa_CopyPixels); SET_DrawPixels(exec, _mesa_DrawPixels); - SET_EndList(exec, _mesa_EndList); +#endif +#if FEATURE_feadback + SET_InitNames(exec, _mesa_InitNames); SET_FeedbackBuffer(exec, _mesa_FeedbackBuffer); + SET_LoadName(exec, _mesa_LoadName); + SET_PassThrough(exec, _mesa_PassThrough); + SET_PopName(exec, _mesa_PopName); + SET_PushName(exec, _mesa_PushName); + SET_SelectBuffer(exec, _mesa_SelectBuffer); + SET_RenderMode(exec, _mesa_RenderMode); +#endif SET_FogCoordPointerEXT(exec, _mesa_FogCoordPointerEXT); SET_Fogf(exec, _mesa_Fogf); SET_Fogfv(exec, _mesa_Fogfv); SET_Fogi(exec, _mesa_Fogi); SET_Fogiv(exec, _mesa_Fogiv); - SET_GenLists(exec, _mesa_GenLists); SET_GetClipPlane(exec, _mesa_GetClipPlane); SET_GetBooleanv(exec, _mesa_GetBooleanv); SET_GetDoublev(exec, _mesa_GetDoublev); SET_GetIntegerv(exec, _mesa_GetIntegerv); SET_GetLightfv(exec, _mesa_GetLightfv); SET_GetLightiv(exec, _mesa_GetLightiv); - SET_GetMapdv(exec, _mesa_GetMapdv); - SET_GetMapfv(exec, _mesa_GetMapfv); - SET_GetMapiv(exec, _mesa_GetMapiv); SET_GetMaterialfv(exec, _mesa_GetMaterialfv); SET_GetMaterialiv(exec, _mesa_GetMaterialiv); - SET_GetPixelMapfv(exec, _mesa_GetPixelMapfv); - SET_GetPixelMapuiv(exec, _mesa_GetPixelMapuiv); - SET_GetPixelMapusv(exec, _mesa_GetPixelMapusv); SET_GetPolygonStipple(exec, _mesa_GetPolygonStipple); SET_GetTexEnvfv(exec, _mesa_GetTexEnvfv); SET_GetTexEnviv(exec, _mesa_GetTexEnviv); @@ -222,14 +247,10 @@ _mesa_init_exec_table(struct _glapi_table *exec) SET_GetTexLevelParameteriv(exec, _mesa_GetTexLevelParameteriv); SET_GetTexParameterfv(exec, _mesa_GetTexParameterfv); SET_GetTexParameteriv(exec, _mesa_GetTexParameteriv); - SET_GetTexGendv(exec, _mesa_GetTexGendv); - SET_GetTexGenfv(exec, _mesa_GetTexGenfv); - SET_GetTexGeniv(exec, _mesa_GetTexGeniv); SET_GetTexImage(exec, _mesa_GetTexImage); SET_Hint(exec, _mesa_Hint); SET_IndexMask(exec, _mesa_IndexMask); SET_IsEnabled(exec, _mesa_IsEnabled); - SET_IsList(exec, _mesa_IsList); SET_LightModelf(exec, _mesa_LightModelf); SET_LightModelfv(exec, _mesa_LightModelfv); SET_LightModeli(exec, _mesa_LightModeli); @@ -238,8 +259,11 @@ _mesa_init_exec_table(struct _glapi_table *exec) SET_Lightfv(exec, _mesa_Lightfv); SET_Lighti(exec, _mesa_Lighti); SET_Lightiv(exec, _mesa_Lightiv); - SET_ListBase(exec, _mesa_ListBase); SET_LoadMatrixd(exec, _mesa_LoadMatrixd); +#if FEATURE_evaluators + SET_GetMapdv(exec, _mesa_GetMapdv); + SET_GetMapfv(exec, _mesa_GetMapfv); + SET_GetMapiv(exec, _mesa_GetMapiv); SET_Map1d(exec, _mesa_Map1d); SET_Map1f(exec, _mesa_Map1f); SET_Map2d(exec, _mesa_Map2d); @@ -248,22 +272,35 @@ _mesa_init_exec_table(struct _glapi_table *exec) SET_MapGrid1f(exec, _mesa_MapGrid1f); SET_MapGrid2d(exec, _mesa_MapGrid2d); SET_MapGrid2f(exec, _mesa_MapGrid2f); +#endif SET_MultMatrixd(exec, _mesa_MultMatrixd); - SET_NewList(exec, _mesa_NewList); - SET_PassThrough(exec, _mesa_PassThrough); +#if FEATURE_pixel_transfer + SET_GetPixelMapfv(exec, _mesa_GetPixelMapfv); + SET_GetPixelMapuiv(exec, _mesa_GetPixelMapuiv); + SET_GetPixelMapusv(exec, _mesa_GetPixelMapusv); SET_PixelMapfv(exec, _mesa_PixelMapfv); SET_PixelMapuiv(exec, _mesa_PixelMapuiv); SET_PixelMapusv(exec, _mesa_PixelMapusv); - SET_PixelStoref(exec, _mesa_PixelStoref); SET_PixelTransferf(exec, _mesa_PixelTransferf); SET_PixelTransferi(exec, _mesa_PixelTransferi); SET_PixelZoom(exec, _mesa_PixelZoom); +#endif + SET_PixelStoref(exec, _mesa_PixelStoref); SET_PointSize(exec, _mesa_PointSize); SET_PolygonMode(exec, _mesa_PolygonMode); SET_PolygonOffset(exec, _mesa_PolygonOffset); SET_PolygonStipple(exec, _mesa_PolygonStipple); +#if FEATURE_attrib_stack SET_PopAttrib(exec, _mesa_PopAttrib); SET_PushAttrib(exec, _mesa_PushAttrib); + SET_PopClientAttrib(exec, _mesa_PopClientAttrib); + SET_PushClientAttrib(exec, _mesa_PushClientAttrib); +#endif +#if FEATURE_drawpix + SET_RasterPos2f(exec, _mesa_RasterPos2f); + SET_RasterPos2fv(exec, _mesa_RasterPos2fv); + SET_RasterPos2i(exec, _mesa_RasterPos2i); + SET_RasterPos2iv(exec, _mesa_RasterPos2iv); SET_RasterPos2d(exec, _mesa_RasterPos2d); SET_RasterPos2dv(exec, _mesa_RasterPos2dv); SET_RasterPos2s(exec, _mesa_RasterPos2s); @@ -284,24 +321,31 @@ _mesa_init_exec_table(struct _glapi_table *exec) SET_RasterPos4iv(exec, _mesa_RasterPos4iv); SET_RasterPos4s(exec, _mesa_RasterPos4s); SET_RasterPos4sv(exec, _mesa_RasterPos4sv); +#endif SET_ReadPixels(exec, _mesa_ReadPixels); SET_Rotated(exec, _mesa_Rotated); SET_Scaled(exec, _mesa_Scaled); SET_SecondaryColorPointerEXT(exec, _mesa_SecondaryColorPointerEXT); SET_TexEnvf(exec, _mesa_TexEnvf); SET_TexEnviv(exec, _mesa_TexEnviv); + +#if FEATURE_texgen + SET_GetTexGendv(exec, _mesa_GetTexGendv); + SET_GetTexGenfv(exec, _mesa_GetTexGenfv); + SET_GetTexGeniv(exec, _mesa_GetTexGeniv); SET_TexGend(exec, _mesa_TexGend); SET_TexGendv(exec, _mesa_TexGendv); SET_TexGenf(exec, _mesa_TexGenf); SET_TexGenfv(exec, _mesa_TexGenfv); SET_TexGeni(exec, _mesa_TexGeni); SET_TexGeniv(exec, _mesa_TexGeniv); +#endif + SET_TexImage1D(exec, _mesa_TexImage1D); SET_TexParameterf(exec, _mesa_TexParameterf); SET_TexParameterfv(exec, _mesa_TexParameterfv); SET_TexParameteriv(exec, _mesa_TexParameteriv); SET_Translated(exec, _mesa_Translated); -#endif /* 1.1 */ SET_BindTexture(exec, _mesa_BindTexture); @@ -322,9 +366,7 @@ _mesa_init_exec_table(struct _glapi_table *exec) SET_InterleavedArrays(exec, _mesa_InterleavedArrays); SET_IsTexture(exec, _mesa_IsTexture); SET_NormalPointer(exec, _mesa_NormalPointer); - SET_PopClientAttrib(exec, _mesa_PopClientAttrib); SET_PrioritizeTextures(exec, _mesa_PrioritizeTextures); - SET_PushClientAttrib(exec, _mesa_PushClientAttrib); SET_TexCoordPointer(exec, _mesa_TexCoordPointer); SET_TexSubImage1D(exec, _mesa_TexSubImage1D); SET_TexSubImage2D(exec, _mesa_TexSubImage2D); @@ -339,30 +381,37 @@ _mesa_init_exec_table(struct _glapi_table *exec) #endif /* OpenGL 1.2 GL_ARB_imaging */ -#if _HAVE_FULL_GL SET_BlendColor(exec, _mesa_BlendColor); SET_BlendEquation(exec, _mesa_BlendEquation); SET_BlendEquationSeparateEXT(exec, _mesa_BlendEquationSeparateEXT); + +#if FEATURE_colortable SET_ColorSubTable(exec, _mesa_ColorSubTable); SET_ColorTable(exec, _mesa_ColorTable); SET_ColorTableParameterfv(exec, _mesa_ColorTableParameterfv); SET_ColorTableParameteriv(exec, _mesa_ColorTableParameteriv); + SET_CopyColorSubTable(exec, _mesa_CopyColorSubTable); + SET_CopyColorTable(exec, _mesa_CopyColorTable); + SET_GetColorTable(exec, _mesa_GetColorTable); + SET_GetColorTableParameterfv(exec, _mesa_GetColorTableParameterfv); + SET_GetColorTableParameteriv(exec, _mesa_GetColorTableParameteriv); +#endif + +#if FEATURE_convolution SET_ConvolutionFilter1D(exec, _mesa_ConvolutionFilter1D); SET_ConvolutionFilter2D(exec, _mesa_ConvolutionFilter2D); SET_ConvolutionParameterf(exec, _mesa_ConvolutionParameterf); SET_ConvolutionParameterfv(exec, _mesa_ConvolutionParameterfv); SET_ConvolutionParameteri(exec, _mesa_ConvolutionParameteri); SET_ConvolutionParameteriv(exec, _mesa_ConvolutionParameteriv); - SET_CopyColorSubTable(exec, _mesa_CopyColorSubTable); - SET_CopyColorTable(exec, _mesa_CopyColorTable); SET_CopyConvolutionFilter1D(exec, _mesa_CopyConvolutionFilter1D); SET_CopyConvolutionFilter2D(exec, _mesa_CopyConvolutionFilter2D); - SET_GetColorTable(exec, _mesa_GetColorTable); - SET_GetColorTableParameterfv(exec, _mesa_GetColorTableParameterfv); - SET_GetColorTableParameteriv(exec, _mesa_GetColorTableParameteriv); SET_GetConvolutionFilter(exec, _mesa_GetConvolutionFilter); SET_GetConvolutionParameterfv(exec, _mesa_GetConvolutionParameterfv); SET_GetConvolutionParameteriv(exec, _mesa_GetConvolutionParameteriv); + SET_SeparableFilter2D(exec, _mesa_SeparableFilter2D); +#endif +#if FEATURE_histogram SET_GetHistogram(exec, _mesa_GetHistogram); SET_GetHistogramParameterfv(exec, _mesa_GetHistogramParameterfv); SET_GetHistogramParameteriv(exec, _mesa_GetHistogramParameteriv); @@ -374,7 +423,6 @@ _mesa_init_exec_table(struct _glapi_table *exec) SET_Minmax(exec, _mesa_Minmax); SET_ResetHistogram(exec, _mesa_ResetHistogram); SET_ResetMinmax(exec, _mesa_ResetMinmax); - SET_SeparableFilter2D(exec, _mesa_SeparableFilter2D); #endif /* OpenGL 2.0 */ @@ -488,7 +536,7 @@ _mesa_init_exec_table(struct _glapi_table *exec) #endif /* 197. GL_MESA_window_pos */ -#if _HAVE_FULL_GL +#if FEATURE_drawpix SET_WindowPos2dMESA(exec, _mesa_WindowPos2dMESA); SET_WindowPos2dvMESA(exec, _mesa_WindowPos2dvMESA); SET_WindowPos2fMESA(exec, _mesa_WindowPos2fMESA); @@ -715,8 +763,10 @@ _mesa_init_exec_table(struct _glapi_table *exec) #endif /* ARB 37. GL_ARB_draw_buffers */ +#if FEATURE_draw_read_buffer SET_DrawBuffersARB(exec, _mesa_DrawBuffersARB); - +#endif + #if FEATURE_ARB_shader_objects SET_DeleteObjectARB(exec, _mesa_DeleteObjectARB); SET_GetHandleARB(exec, _mesa_GetHandleARB); diff --git a/src/mesa/main/api_exec.h b/src/mesa/main/api_exec.h index 7f15ea9d00..4bd715053a 100644 --- a/src/mesa/main/api_exec.h +++ b/src/mesa/main/api_exec.h @@ -27,7 +27,10 @@ #define API_EXEC_H -void +struct _glapi_table; + + +extern void _mesa_init_exec_table(struct _glapi_table *exec); diff --git a/src/mesa/main/api_noop.c b/src/mesa/main/api_noop.c index 3df64362ea..a1cc3a2a4b 100644 --- a/src/mesa/main/api_noop.c +++ b/src/mesa/main/api_noop.c @@ -30,7 +30,9 @@ #include "context.h" #include "light.h" #include "macros.h" +#if FEATURE_dlist #include "dlist.h" +#endif #include "glapi/dispatch.h" @@ -621,6 +623,8 @@ static void GLAPIENTRY _mesa_noop_Vertex4f( GLfloat a, GLfloat b, GLfloat c, GLf (void) a; (void) b; (void) c; (void) d; } + +#if FEATURE_evaluators /* Similarly, these have no effect outside begin/end: */ static void GLAPIENTRY _mesa_noop_EvalCoord1f( GLfloat a ) @@ -652,6 +656,7 @@ static void GLAPIENTRY _mesa_noop_EvalPoint2( GLint a, GLint b ) { (void) a; (void) b; } +#endif /* FEATURE_evaluators */ /* Begin -- call into driver, should result in the vtxfmt being @@ -904,20 +909,24 @@ _mesa_noop_vtxfmt_init( GLvertexformat *vfmt ) { vfmt->ArrayElement = _ae_loopback_array_elt; /* generic helper */ vfmt->Begin = _mesa_noop_Begin; +#if FEATURE_dlist vfmt->CallList = _mesa_CallList; vfmt->CallLists = _mesa_CallLists; +#endif vfmt->Color3f = _mesa_noop_Color3f; vfmt->Color3fv = _mesa_noop_Color3fv; vfmt->Color4f = _mesa_noop_Color4f; vfmt->Color4fv = _mesa_noop_Color4fv; vfmt->EdgeFlag = _mesa_noop_EdgeFlag; vfmt->End = _mesa_noop_End; +#if FEATURE_evaluators vfmt->EvalCoord1f = _mesa_noop_EvalCoord1f; vfmt->EvalCoord1fv = _mesa_noop_EvalCoord1fv; vfmt->EvalCoord2f = _mesa_noop_EvalCoord2f; vfmt->EvalCoord2fv = _mesa_noop_EvalCoord2fv; vfmt->EvalPoint1 = _mesa_noop_EvalPoint1; vfmt->EvalPoint2 = _mesa_noop_EvalPoint2; +#endif vfmt->FogCoordfEXT = _mesa_noop_FogCoordfEXT; vfmt->FogCoordfvEXT = _mesa_noop_FogCoordfvEXT; vfmt->Indexf = _mesa_noop_Indexf; diff --git a/src/mesa/main/config.h b/src/mesa/main/config.h index 232e698f50..9ff0b708dd 100644 --- a/src/mesa/main/config.h +++ b/src/mesa/main/config.h @@ -31,6 +31,10 @@ #ifndef MESA_CONFIG_H_INCLUDED #define MESA_CONFIG_H_INCLUDED + +#include "main/mfeatures.h" + + /** * \name OpenGL implementation limits */ @@ -283,40 +287,6 @@ #define ACOMP 3 -/* - * Enable/disable features (blocks of code) by setting FEATURE_xyz to 0 or 1. - */ -#ifndef _HAVE_FULL_GL -#define _HAVE_FULL_GL 1 -#endif - -#define FEATURE_userclip _HAVE_FULL_GL -#define FEATURE_texgen _HAVE_FULL_GL -#define FEATURE_windowpos _HAVE_FULL_GL -#define FEATURE_ARB_occlusion_query _HAVE_FULL_GL -#define FEATURE_ARB_fragment_program _HAVE_FULL_GL -#define FEATURE_ARB_vertex_buffer_object _HAVE_FULL_GL -#define FEATURE_ARB_vertex_program _HAVE_FULL_GL - -#define FEATURE_ARB_vertex_shader _HAVE_FULL_GL -#define FEATURE_ARB_fragment_shader _HAVE_FULL_GL -#define FEATURE_ARB_shader_objects (FEATURE_ARB_vertex_shader || FEATURE_ARB_fragment_shader) -#define FEATURE_ARB_shading_language_100 FEATURE_ARB_shader_objects -#define FEATURE_ARB_shading_language_120 FEATURE_ARB_shader_objects - -#define FEATURE_EXT_framebuffer_blit _HAVE_FULL_GL -#define FEATURE_EXT_framebuffer_object _HAVE_FULL_GL -#define FEATURE_EXT_pixel_buffer_object _HAVE_FULL_GL -#define FEATURE_EXT_texture_sRGB _HAVE_FULL_GL -#define FEATURE_EXT_timer_query _HAVE_FULL_GL -#define FEATURE_ATI_fragment_shader _HAVE_FULL_GL -#define FEATURE_MESA_program_debug _HAVE_FULL_GL -#define FEATURE_NV_fence _HAVE_FULL_GL -#define FEATURE_NV_fragment_program _HAVE_FULL_GL -#define FEATURE_NV_vertex_program _HAVE_FULL_GL -/*@}*/ - - /** * Maximum number of temporary vertices required for clipping. * diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index 1b357ae6c2..d975814592 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -78,27 +78,41 @@ #include "glheader.h" #include "imports.h" +#if FEATURE_accum #include "accum.h" +#endif #include "api_exec.h" #include "arrayobj.h" +#if FEATURE_attrib_stack #include "attrib.h" +#endif #include "blend.h" #include "buffers.h" #include "bufferobj.h" +#if FEATURE_colortable #include "colortab.h" +#endif #include "context.h" #include "debug.h" #include "depth.h" +#if FEATURE_dlist #include "dlist.h" +#endif +#if FEATURE_evaluators #include "eval.h" +#endif #include "enums.h" #include "extensions.h" #include "fbobject.h" +#if FEATURE_feedback #include "feedback.h" +#endif #include "fog.h" #include "framebuffer.h" #include "get.h" +#if FEATURE_histogram #include "histogram.h" +#endif #include "hint.h" #include "hash.h" #include "light.h" @@ -106,12 +120,16 @@ #include "macros.h" #include "matrix.h" #include "multisample.h" +#if FEATURE_pixel_transfer #include "pixel.h" +#endif #include "pixelstore.h" #include "points.h" #include "polygon.h" #include "queryobj.h" +#if FEATURE_drawpix #include "rastpos.h" +#endif #include "scissor.h" #include "simple_list.h" #include "state.h" @@ -573,9 +591,11 @@ alloc_shared_state( GLcontext *ctx ) static void delete_displaylist_cb(GLuint id, void *data, void *userData) { +#if FEATURE_dlist struct mesa_display_list *list = (struct mesa_display_list *) data; GLcontext *ctx = (GLcontext *) userData; _mesa_delete_list(ctx, list); +#endif } /** @@ -954,31 +974,49 @@ init_attrib_groups(GLcontext *ctx) _mesa_init_extensions( ctx ); /* Attribute Groups */ +#if FEATURE_accum _mesa_init_accum( ctx ); +#endif +#if FEATURE_attrib_stack _mesa_init_attrib( ctx ); +#endif _mesa_init_buffer_objects( ctx ); _mesa_init_color( ctx ); +#if FEATURE_colortable _mesa_init_colortables( ctx ); +#endif _mesa_init_current( ctx ); _mesa_init_depth( ctx ); _mesa_init_debug( ctx ); +#if FEATURE_dlist _mesa_init_display_list( ctx ); +#endif +#if FEATURE_evaluators _mesa_init_eval( ctx ); +#endif +#if FEATURE_feedback _mesa_init_feedback( ctx ); +#endif _mesa_init_fog( ctx ); +#if FEATURE_histogram _mesa_init_histogram( ctx ); +#endif _mesa_init_hint( ctx ); _mesa_init_line( ctx ); _mesa_init_lighting( ctx ); _mesa_init_matrix( ctx ); _mesa_init_multisample( ctx ); +#if FEATURE_pixel_transfer _mesa_init_pixel( ctx ); +#endif _mesa_init_pixelstore( ctx ); _mesa_init_point( ctx ); _mesa_init_polygon( ctx ); _mesa_init_program( ctx ); _mesa_init_query( ctx ); +#if FEATURE_drawpix _mesa_init_rastpos( ctx ); +#endif _mesa_init_scissor( ctx ); _mesa_init_shader_state( ctx ); _mesa_init_stencil( ctx ); @@ -989,8 +1027,12 @@ init_attrib_groups(GLcontext *ctx) if (!_mesa_init_texture( ctx )) return GL_FALSE; +#if FEATURE_texture_s3tc _mesa_init_texture_s3tc( ctx ); +#endif +#if FEATURE_texture_fxt1 _mesa_init_texture_fxt1( ctx ); +#endif /* Miscellaneous */ ctx->NewState = _NEW_ALL; @@ -1123,14 +1165,14 @@ _mesa_initialize_context(GLcontext *ctx, } _mesa_init_exec_table(ctx->Exec); ctx->CurrentDispatch = ctx->Exec; -#if _HAVE_FULL_GL +#if FEATURE_dlist _mesa_init_dlist_table(ctx->Save); _mesa_install_save_vtxfmt( ctx, &ctx->ListState.ListVtxfmt ); +#endif /* Neutral tnl module stuff */ _mesa_init_exec_vtxfmt( ctx ); ctx->TnlModule.Current = NULL; ctx->TnlModule.SwapCount = 0; -#endif ctx->FragmentProgram._MaintainTexEnvProgram = (_mesa_getenv("MESA_TEX_PROG") != NULL); @@ -1220,11 +1262,15 @@ _mesa_free_context_data( GLcontext *ctx ) _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._TexEnvProgram, NULL); _mesa_free_lighting_data( ctx ); +#if FEATURE_evaluators _mesa_free_eval_data( ctx ); +#endif _mesa_free_texture_data( ctx ); _mesa_free_matrix_data( ctx ); _mesa_free_viewport_data( ctx ); +#if FEATURE_colortable _mesa_free_colortables_data( ctx ); +#endif _mesa_free_program_data(ctx); _mesa_free_shader_state(ctx); _mesa_free_query_data(ctx); diff --git a/src/mesa/main/mfeatures.h b/src/mesa/main/mfeatures.h new file mode 100644 index 0000000000..228de76af1 --- /dev/null +++ b/src/mesa/main/mfeatures.h @@ -0,0 +1,77 @@ +/* + * Mesa 3-D graphics library + * Version: 7.1 + * + * Copyright (C) 1999-2008 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"), + * 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 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 + * BRIAN PAUL 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 mfeatures.h + * Flags to enable/disable specific parts of the API. + */ + +#ifndef FEATURES_H +#define FEATURES_H + + +#ifndef _HAVE_FULL_GL +#define _HAVE_FULL_GL 1 +#endif + +#define FEATURE_accum _HAVE_FULL_GL +#define FEATURE_attrib_stacks _HAVE_FULL_GL +#define FEATURE_colortable _HAVE_FULL_GL +#define FEATURE_convolution _HAVE_FULL_GL +#define FEATURE_dlist _HAVE_FULL_GL +#define FEATURE_draw_read_buffer _HAVE_FULL_GL +#define FEATURE_drawpix _HAVE_FULL_GL +#define FEATURE_evaluators _HAVE_FULL_GL +#define FEATURE_feedback _HAVE_FULL_GL +#define FEATURE_histogram _HAVE_FULL_GL +#define FEATURE_pixeltransfer _HAVE_FULL_GL +#define FEATURE_texgen _HAVE_FULL_GL +#define FEATURE_texture_fxt1 _HAVE_FULL_GL +#define FEATURE_texture_s3tc _HAVE_FULL_GL +#define FEATURE_userclip _HAVE_FULL_GL + +#define FEATURE_ARB_occlusion_query _HAVE_FULL_GL +#define FEATURE_ARB_fragment_program _HAVE_FULL_GL +#define FEATURE_ARB_vertex_buffer_object _HAVE_FULL_GL +#define FEATURE_ARB_vertex_program _HAVE_FULL_GL +#define FEATURE_ARB_vertex_shader _HAVE_FULL_GL +#define FEATURE_ARB_fragment_shader _HAVE_FULL_GL +#define FEATURE_ARB_shader_objects (FEATURE_ARB_vertex_shader || FEATURE_ARB_fragment_shader) +#define FEATURE_ARB_shading_language_100 FEATURE_ARB_shader_objects +#define FEATURE_ARB_shading_language_120 FEATURE_ARB_shader_objects + +#define FEATURE_EXT_framebuffer_blit _HAVE_FULL_GL +#define FEATURE_EXT_framebuffer_object _HAVE_FULL_GL +#define FEATURE_EXT_pixel_buffer_object _HAVE_FULL_GL +#define FEATURE_EXT_texture_sRGB _HAVE_FULL_GL +#define FEATURE_EXT_timer_query _HAVE_FULL_GL +#define FEATURE_ATI_fragment_shader _HAVE_FULL_GL +#define FEATURE_MESA_program_debug _HAVE_FULL_GL +#define FEATURE_NV_fence _HAVE_FULL_GL +#define FEATURE_NV_fragment_program _HAVE_FULL_GL +#define FEATURE_NV_vertex_program _HAVE_FULL_GL + + +#endif /* FEATURES_H */ diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c index 89920f8443..4d1fdbf47c 100644 --- a/src/mesa/main/state.c +++ b/src/mesa/main/state.c @@ -40,7 +40,9 @@ #include "framebuffer.h" #include "light.h" #include "matrix.h" +#if FEATURE_pixel_transfer #include "pixel.h" +#endif #include "shader/program.h" #include "state.h" #include "stencil.h" @@ -412,8 +414,10 @@ _mesa_update_state_locked( GLcontext *ctx ) if (new_state & _NEW_STENCIL) _mesa_update_stencil( ctx ); +#if FEATURE_pixel_transfer if (new_state & _IMAGE_NEW_TRANSFER_STATE) _mesa_update_pixel( ctx, new_state ); +#endif if (new_state & (_NEW_ARRAY | _NEW_PROGRAM)) update_arrays( ctx ); diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c index 17859a9fec..a35195a695 100644 --- a/src/mesa/main/texformat.c +++ b/src/mesa/main/texformat.c @@ -1449,21 +1449,27 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, case GL_COMPRESSED_INTENSITY_ARB: return &_mesa_texformat_intensity; case GL_COMPRESSED_RGB_ARB: +#if FEATURE_texture_fxt1 if (ctx->Extensions.TDFX_texture_compression_FXT1) return &_mesa_texformat_rgb_fxt1; - else if (ctx->Extensions.EXT_texture_compression_s3tc || - ctx->Extensions.S3_s3tc) +#endif +#if FEATURE_texture_s3tc + if (ctx->Extensions.EXT_texture_compression_s3tc || + ctx->Extensions.S3_s3tc) return &_mesa_texformat_rgb_dxt1; - else - return &_mesa_texformat_rgb; +#endif + return &_mesa_texformat_rgb; case GL_COMPRESSED_RGBA_ARB: +#if FEATURE_texture_fxt1 if (ctx->Extensions.TDFX_texture_compression_FXT1) return &_mesa_texformat_rgba_fxt1; - else if (ctx->Extensions.EXT_texture_compression_s3tc || - ctx->Extensions.S3_s3tc) +#endif +#if FEATURE_texture_s3tc + if (ctx->Extensions.EXT_texture_compression_s3tc || + ctx->Extensions.S3_s3tc) return &_mesa_texformat_rgba_dxt3; /* Not rgba_dxt1, see spec */ - else - return &_mesa_texformat_rgba; +#endif + return &_mesa_texformat_rgba; default: ; /* fallthrough */ } @@ -1478,6 +1484,7 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, } } +#if FEATURE_texture_fxt1 if (ctx->Extensions.TDFX_texture_compression_FXT1) { switch (internalFormat) { case GL_COMPRESSED_RGB_FXT1_3DFX: @@ -1488,7 +1495,9 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, ; /* fallthrough */ } } +#endif +#if FEATURE_texture_s3tc if (ctx->Extensions.EXT_texture_compression_s3tc) { switch (internalFormat) { case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: @@ -1516,6 +1525,7 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, ; /* fallthrough */ } } +#endif if (ctx->Extensions.ARB_texture_float) { switch (internalFormat) { diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 384e145520..eed1937517 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -32,7 +32,9 @@ #include "glheader.h" #include "bufferobj.h" #include "context.h" +#if FEATURE_convolve #include "convolve.h" +#endif #include "fbobject.h" #include "framebuffer.h" #include "image.h" @@ -2429,9 +2431,11 @@ _mesa_TexImage1D( GLenum target, GLint level, GLint internalFormat, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); +#if FEATURE_convolve if (is_color_format(internalFormat)) { _mesa_adjust_image_for_convolution(ctx, 1, &postConvWidth, NULL); } +#endif if (target == GL_TEXTURE_1D) { /* non-proxy target */ @@ -2524,10 +2528,12 @@ _mesa_TexImage2D( GLenum target, GLint level, GLint internalFormat, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); +#if FEATURE_convolve if (is_color_format(internalFormat)) { _mesa_adjust_image_for_convolution(ctx, 2, &postConvWidth, &postConvHeight); } +#endif if (target == GL_TEXTURE_2D || (ctx->Extensions.ARB_texture_cube_map && @@ -2746,10 +2752,12 @@ _mesa_TexSubImage1D( GLenum target, GLint level, if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE) _mesa_update_state(ctx); +#if FEATURE_convolve /* XXX should test internal format */ if (is_color_format(format)) { _mesa_adjust_image_for_convolution(ctx, 1, &postConvWidth, NULL); } +#endif if (subtexture_error_check(ctx, 1, target, level, xoffset, 0, 0, postConvWidth, 1, 1, format, type)) { @@ -2804,11 +2812,13 @@ _mesa_TexSubImage2D( GLenum target, GLint level, if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE) _mesa_update_state(ctx); +#if FEATURE_convolve /* XXX should test internal format */ if (is_color_format(format)) { _mesa_adjust_image_for_convolution(ctx, 2, &postConvWidth, &postConvHeight); } +#endif if (subtexture_error_check(ctx, 2, target, level, xoffset, yoffset, 0, postConvWidth, postConvHeight, 1, format, type)) { @@ -2918,9 +2928,11 @@ _mesa_CopyTexImage1D( GLenum target, GLint level, if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE) _mesa_update_state(ctx); +#if FEATURE_convolve if (is_color_format(internalFormat)) { _mesa_adjust_image_for_convolution(ctx, 1, &postConvWidth, NULL); } +#endif if (copytexture_error_check(ctx, 1, target, level, internalFormat, postConvWidth, 1, border)) @@ -2981,11 +2993,12 @@ _mesa_CopyTexImage2D( GLenum target, GLint level, GLenum internalFormat, if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE) _mesa_update_state(ctx); +#if FEATURE_convolve if (is_color_format(internalFormat)) { _mesa_adjust_image_for_convolution(ctx, 2, &postConvWidth, &postConvHeight); } - +#endif if (copytexture_error_check(ctx, 2, target, level, internalFormat, postConvWidth, postConvHeight, border)) return; @@ -3047,8 +3060,10 @@ _mesa_CopyTexSubImage1D( GLenum target, GLint level, if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE) _mesa_update_state(ctx); +#if FEATURE_convolve /* XXX should test internal format */ _mesa_adjust_image_for_convolution(ctx, 1, &postConvWidth, NULL); +#endif if (copytexsubimage_error_check(ctx, 1, target, level, xoffset, 0, 0, postConvWidth, 1)) @@ -3100,8 +3115,10 @@ _mesa_CopyTexSubImage2D( GLenum target, GLint level, if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE) _mesa_update_state(ctx); +#if FEATURE_convolve /* XXX should test internal format */ _mesa_adjust_image_for_convolution(ctx, 2, &postConvWidth, &postConvHeight); +#endif if (copytexsubimage_error_check(ctx, 2, target, level, xoffset, yoffset, 0, postConvWidth, postConvHeight)) @@ -3152,8 +3169,10 @@ _mesa_CopyTexSubImage3D( GLenum target, GLint level, if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE) _mesa_update_state(ctx); +#if FEATURE_convolve /* XXX should test internal format */ _mesa_adjust_image_for_convolution(ctx, 2, &postConvWidth, &postConvHeight); +#endif if (copytexsubimage_error_check(ctx, 3, target, level, xoffset, yoffset, zoffset, postConvWidth, postConvHeight)) diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index df64002f99..606e62d7a0 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -29,7 +29,9 @@ #include "glheader.h" +#if FEATURE_colortable #include "colortab.h" +#endif #include "context.h" #include "enums.h" #include "fbobject.h" @@ -153,7 +155,9 @@ _mesa_delete_texture_object( GLcontext *ctx, struct gl_texture_object *texObj ) (void) ctx; +#if FEATURE_colortable _mesa_free_colortable_data(&texObj->Palette); +#endif /* free the texture images */ for (face = 0; face < 6; face++) { diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c index 84acfbd92c..2a83d6df4a 100644 --- a/src/mesa/main/texstate.c +++ b/src/mesa/main/texstate.c @@ -30,7 +30,9 @@ #include "glheader.h" #include "colormac.h" +#if FEATURE_colortable #include "colortab.h" +#endif #include "context.h" #include "enums.h" #include "macros.h" @@ -3213,7 +3215,9 @@ _mesa_init_texture(GLcontext *ctx) for (i=0; iTexture.SharedPalette = GL_FALSE; +#if FEATURE_colortable _mesa_init_colortable(&ctx->Texture.Palette); +#endif /* Allocate proxy textures */ if (!alloc_proxy_textures( ctx )) @@ -3229,8 +3233,6 @@ _mesa_init_texture(GLcontext *ctx) void _mesa_free_texture_data(GLcontext *ctx) { - GLuint i; - /* Free proxy texture objects */ (ctx->Driver.DeleteTexture)(ctx, ctx->Texture.Proxy1D ); (ctx->Driver.DeleteTexture)(ctx, ctx->Texture.Proxy2D ); @@ -3240,6 +3242,11 @@ _mesa_free_texture_data(GLcontext *ctx) (ctx->Driver.DeleteTexture)(ctx, ctx->Texture.Proxy1DArray ); (ctx->Driver.DeleteTexture)(ctx, ctx->Texture.Proxy2DArray ); - for (i = 0; i < MAX_TEXTURE_IMAGE_UNITS; i++) - _mesa_free_colortable_data( &ctx->Texture.Unit[i].ColorTable ); +#if FEATURE_colortable + { + GLuint i; + for (i = 0; i < MAX_TEXTURE_IMAGE_UNITS; i++) + _mesa_free_colortable_data( &ctx->Texture.Unit[i].ColorTable ); + } +#endif } diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index a6a18910fc..5ac6116950 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -55,7 +55,9 @@ #include "bufferobj.h" #include "colormac.h" #include "context.h" +#if FEATURE_convolve #include "convolve.h" +#endif #include "image.h" #include "macros.h" #include "mipmap.h" @@ -269,6 +271,16 @@ compute_component_mapping(GLenum inFormat, GLenum outFormat, } +#if !FEATURE_convolve +static void +_mesa_adjust_image_for_convolution(GLcontext *ctx, GLuint dims, + GLsizei *srcWidth, GLsizei *srcHeight) +{ + /* no-op */ +} +#endif + + /** * Make a temporary (color) texture image with GLfloat components. * Apply all needed pixel unpacking and pixel transfer operations. @@ -368,6 +380,7 @@ make_temp_float_image(GLcontext *ctx, GLuint dims, dst += srcWidth * 4; } +#if FEATURE_convolve /* do convolution */ { GLfloat *src = tempImage + img * (srcWidth * srcHeight * 4); @@ -389,7 +402,7 @@ make_temp_float_image(GLcontext *ctx, GLuint dims, } } } - +#endif /* do post-convolution transfer and pack into tempImage */ { const GLint logComponents @@ -546,6 +559,7 @@ _mesa_make_temp_chan_image(GLcontext *ctx, GLuint dims, textureBaseFormat == GL_ALPHA || textureBaseFormat == GL_INTENSITY); +#if FEATURE_convolve if ((dims == 1 && ctx->Pixel.Convolution1DEnabled) || (dims >= 2 && ctx->Pixel.Convolution2DEnabled) || (dims >= 2 && ctx->Pixel.Separable2DEnabled)) { @@ -567,6 +581,7 @@ _mesa_make_temp_chan_image(GLcontext *ctx, GLuint dims, transferOps = 0; freeSrcImage = GL_TRUE; } +#endif /* unpack and transfer the source image */ tempImage = (GLchan *) _mesa_malloc(srcWidth * srcHeight * srcDepth diff --git a/src/mesa/vbo/vbo_context.c b/src/mesa/vbo/vbo_context.c index 235cee2429..dc7c534251 100644 --- a/src/mesa/vbo/vbo_context.c +++ b/src/mesa/vbo/vbo_context.c @@ -225,9 +225,10 @@ GLboolean _vbo_CreateContext( GLcontext *ctx ) * vtxfmt mechanism can be removed now. */ vbo_exec_init( ctx ); +#if FEATURE_dlist vbo_save_init( ctx ); +#endif - return GL_TRUE; } @@ -246,7 +247,9 @@ void _vbo_DestroyContext( GLcontext *ctx ) } vbo_exec_destroy(ctx); +#if FEATURE_dlist vbo_save_destroy(ctx); +#endif FREE(vbo_context(ctx)); ctx->swtnl_im = NULL; } diff --git a/src/mesa/vbo/vbo_context.h b/src/mesa/vbo/vbo_context.h index 013f81bdd5..bf405eb693 100644 --- a/src/mesa/vbo/vbo_context.h +++ b/src/mesa/vbo/vbo_context.h @@ -53,8 +53,10 @@ #include "vbo.h" #include "vbo_attrib.h" -#include "vbo_save.h" #include "vbo_exec.h" +#if FEATURE_dlist +#include "vbo_save.h" +#endif struct vbo_context { @@ -74,7 +76,9 @@ struct vbo_context { struct vbo_exec_context exec; +#if FEATURE_dlist struct vbo_save_context save; +#endif /* Callback into the driver. This must always succeed, the driver * is responsible for initiating any fallback actions required: diff --git a/src/mesa/vbo/vbo_exec.c b/src/mesa/vbo/vbo_exec.c index 1efa74945d..635f239acc 100644 --- a/src/mesa/vbo/vbo_exec.c +++ b/src/mesa/vbo/vbo_exec.c @@ -32,7 +32,6 @@ #include "main/context.h" #include "main/macros.h" #include "main/mtypes.h" -#include "main/dlist.h" #include "main/vtxfmt.h" #include "vbo_context.h" diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c index 98580170e3..5dd774d839 100644 --- a/src/mesa/vbo/vbo_exec_api.c +++ b/src/mesa/vbo/vbo_exec_api.c @@ -34,7 +34,9 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "main/context.h" #include "main/macros.h" #include "main/vtxfmt.h" +#if FEATURE_dlist #include "main/dlist.h" +#endif #include "main/state.h" #include "main/light.h" #include "main/api_arrayelt.h" @@ -569,8 +571,10 @@ static void vbo_exec_vtxfmt_init( struct vbo_exec_context *exec ) vfmt->ArrayElement = _ae_loopback_array_elt; /* generic helper */ vfmt->Begin = vbo_exec_Begin; +#if FEATURE_dlist vfmt->CallList = _mesa_CallList; vfmt->CallLists = _mesa_CallLists; +#endif vfmt->End = vbo_exec_End; vfmt->EvalCoord1f = vbo_exec_EvalCoord1f; vfmt->EvalCoord1fv = vbo_exec_EvalCoord1fv; -- cgit v1.2.3 From 8a369b909a6648ae7a5a0c2dcb972a2f96f99a80 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 17 Jun 2008 11:31:45 -0600 Subject: mesa: s/GL_POLYGON+1/PRIM_OUTSIDE_BEGIN_END/ --- src/mesa/vbo/vbo_exec_api.c | 10 +++++----- src/mesa/vbo/vbo_exec_draw.c | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/mesa/vbo/vbo_exec_api.c') diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c index 5dd774d839..b263885388 100644 --- a/src/mesa/vbo/vbo_exec_api.c +++ b/src/mesa/vbo/vbo_exec_api.c @@ -67,7 +67,7 @@ static void vbo_exec_wrap_buffers( struct vbo_exec_context *exec ) GLuint last_begin = exec->vtx.prim[exec->vtx.prim_count-1].begin; GLuint last_count; - if (exec->ctx->Driver.CurrentExecPrimitive != GL_POLYGON+1) { + if (exec->ctx->Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END) { GLint i = exec->vtx.prim_count - 1; assert(i >= 0); exec->vtx.prim[i].count = (exec->vtx.vert_count - @@ -89,7 +89,7 @@ static void vbo_exec_wrap_buffers( struct vbo_exec_context *exec ) */ assert(exec->vtx.prim_count == 0); - if (exec->ctx->Driver.CurrentExecPrimitive != GL_POLYGON+1) { + if (exec->ctx->Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END) { exec->vtx.prim[0].mode = exec->ctx->Driver.CurrentExecPrimitive; exec->vtx.prim[0].start = 0; exec->vtx.prim[0].count = 0; @@ -503,7 +503,7 @@ static void GLAPIENTRY vbo_exec_Begin( GLenum mode ) { GET_CURRENT_CONTEXT( ctx ); - if (ctx->Driver.CurrentExecPrimitive == GL_POLYGON+1) { + if (ctx->Driver.CurrentExecPrimitive == PRIM_OUTSIDE_BEGIN_END) { struct vbo_exec_context *exec = &vbo_context(ctx)->exec; int i; @@ -547,7 +547,7 @@ static void GLAPIENTRY vbo_exec_End( void ) { GET_CURRENT_CONTEXT( ctx ); - if (ctx->Driver.CurrentExecPrimitive != GL_POLYGON+1) { + if (ctx->Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END) { struct vbo_exec_context *exec = &vbo_context(ctx)->exec; int idx = exec->vtx.vert_count; int i = exec->vtx.prim_count - 1; @@ -555,7 +555,7 @@ static void GLAPIENTRY vbo_exec_End( void ) exec->vtx.prim[i].end = 1; exec->vtx.prim[i].count = idx - exec->vtx.prim[i].start; - ctx->Driver.CurrentExecPrimitive = GL_POLYGON+1; + ctx->Driver.CurrentExecPrimitive = PRIM_OUTSIDE_BEGIN_END; if (exec->vtx.prim_count == VBO_MAX_PRIM) vbo_exec_vtx_flush( exec ); diff --git a/src/mesa/vbo/vbo_exec_draw.c b/src/mesa/vbo/vbo_exec_draw.c index 6bb6849a6a..3609a7452a 100644 --- a/src/mesa/vbo/vbo_exec_draw.c +++ b/src/mesa/vbo/vbo_exec_draw.c @@ -128,7 +128,7 @@ static GLuint vbo_copy_vertices( struct vbo_exec_context *exec ) for (i = 0 ; i < ovf ; i++) _mesa_memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz * sizeof(GLfloat) ); return i; - case GL_POLYGON+1: + case PRIM_OUTSIDE_BEGIN_END: return 0; default: assert(0); -- cgit v1.2.3 From 71f67dde34546f40c7617948f8fa945288e55e17 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 20 Jun 2008 10:48:14 -0600 Subject: mesa: _vbo_Color4f, _vbo_Normal3f, _vbo_MultiTexCoord4f functions --- src/mesa/vbo/vbo.h | 10 ++++++++++ src/mesa/vbo/vbo_exec_api.c | 21 +++++++++++++++++++++ 2 files changed, 31 insertions(+) (limited to 'src/mesa/vbo/vbo_exec_api.c') diff --git a/src/mesa/vbo/vbo.h b/src/mesa/vbo/vbo.h index 79d33d09c1..1a737babd3 100644 --- a/src/mesa/vbo/vbo.h +++ b/src/mesa/vbo/vbo.h @@ -120,4 +120,14 @@ void vbo_use_buffer_objects(GLcontext *ctx); void vbo_set_draw_func(GLcontext *ctx, vbo_draw_func func); +void +_vbo_Color4f(GLfloat r, GLfloat g, GLfloat b, GLfloat a); + +void +_vbo_Normal3f(GLfloat x, GLfloat y, GLfloat z); + +void +_vbo_MultiTexCoord4f(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); + + #endif diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c index b263885388..cf9c860263 100644 --- a/src/mesa/vbo/vbo_exec_api.c +++ b/src/mesa/vbo/vbo_exec_api.c @@ -769,3 +769,24 @@ static void reset_attrfv( struct vbo_exec_context *exec ) exec->vtx.vertex_size = 0; } + +void +_vbo_Color4f(GLfloat r, GLfloat g, GLfloat b, GLfloat a) +{ + vbo_Color4f(r, g, b, a); +} + + +void +_vbo_Normal3f(GLfloat x, GLfloat y, GLfloat z) +{ + vbo_Normal3f(x, y, z); +} + + +void +_vbo_MultiTexCoord4f(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q) +{ + vbo_MultiTexCoord4f(target, s, t, r, q); +} + -- cgit v1.2.3 From 1b241a4369fcba5972a7ab38b9a5595a434e0b56 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 20 Jun 2008 11:04:37 -0600 Subject: mesa: added _vbo_Materialfv() --- src/mesa/vbo/vbo.h | 3 +++ src/mesa/vbo/vbo_exec_api.c | 5 +++++ 2 files changed, 8 insertions(+) (limited to 'src/mesa/vbo/vbo_exec_api.c') diff --git a/src/mesa/vbo/vbo.h b/src/mesa/vbo/vbo.h index 1a737babd3..bd10956ee4 100644 --- a/src/mesa/vbo/vbo.h +++ b/src/mesa/vbo/vbo.h @@ -129,5 +129,8 @@ _vbo_Normal3f(GLfloat x, GLfloat y, GLfloat z); void _vbo_MultiTexCoord4f(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +void +_vbo_Materialfv(GLenum face, GLenum pname, const GLfloat *params); + #endif diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c index cf9c860263..1e2a08bc8e 100644 --- a/src/mesa/vbo/vbo_exec_api.c +++ b/src/mesa/vbo/vbo_exec_api.c @@ -790,3 +790,8 @@ _vbo_MultiTexCoord4f(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q) vbo_MultiTexCoord4f(target, s, t, r, q); } +void +_vbo_Materialfv(GLenum face, GLenum pname, const GLfloat *params) +{ + vbo_Materialfv(face, pname, params); +} -- cgit v1.2.3 From dd3311aa89035aa2e624f54b6914cfbcf57b33d7 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 3 Jul 2008 16:59:24 -0600 Subject: mesa: added _vbo_VertexAttrib4f() --- src/mesa/vbo/vbo.h | 2 ++ src/mesa/vbo/vbo_exec_api.c | 7 +++++++ 2 files changed, 9 insertions(+) (limited to 'src/mesa/vbo/vbo_exec_api.c') diff --git a/src/mesa/vbo/vbo.h b/src/mesa/vbo/vbo.h index bd10956ee4..59cd7f6984 100644 --- a/src/mesa/vbo/vbo.h +++ b/src/mesa/vbo/vbo.h @@ -132,5 +132,7 @@ _vbo_MultiTexCoord4f(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); void _vbo_Materialfv(GLenum face, GLenum pname, const GLfloat *params); +void +_vbo_VertexAttrib4f(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); #endif diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c index 1e2a08bc8e..2c2e66dd0b 100644 --- a/src/mesa/vbo/vbo_exec_api.c +++ b/src/mesa/vbo/vbo_exec_api.c @@ -795,3 +795,10 @@ _vbo_Materialfv(GLenum face, GLenum pname, const GLfloat *params) { vbo_Materialfv(face, pname, params); } + + +void +_vbo_VertexAttrib4f(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) +{ + vbo_VertexAttrib4fARB(index, x, y, z, w); +} -- cgit v1.2.3 From 8d2400f2161efa95d2ef18fec353db4841f09637 Mon Sep 17 00:00:00 2001 From: Jonathan White Date: Mon, 7 Jul 2008 17:56:29 -0600 Subject: mesa: added GLAPIENTRY keywords --- src/mesa/vbo/vbo.h | 10 +++++----- src/mesa/vbo/vbo_exec_api.c | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'src/mesa/vbo/vbo_exec_api.c') diff --git a/src/mesa/vbo/vbo.h b/src/mesa/vbo/vbo.h index 59cd7f6984..5362226c2f 100644 --- a/src/mesa/vbo/vbo.h +++ b/src/mesa/vbo/vbo.h @@ -120,19 +120,19 @@ void vbo_use_buffer_objects(GLcontext *ctx); void vbo_set_draw_func(GLcontext *ctx, vbo_draw_func func); -void +void GLAPIENTRY _vbo_Color4f(GLfloat r, GLfloat g, GLfloat b, GLfloat a); -void +void GLAPIENTRY _vbo_Normal3f(GLfloat x, GLfloat y, GLfloat z); -void +void GLAPIENTRY _vbo_MultiTexCoord4f(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); -void +void GLAPIENTRY _vbo_Materialfv(GLenum face, GLenum pname, const GLfloat *params); -void +void GLAPIENTRY _vbo_VertexAttrib4f(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); #endif diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c index 2c2e66dd0b..579bbeb4f3 100644 --- a/src/mesa/vbo/vbo_exec_api.c +++ b/src/mesa/vbo/vbo_exec_api.c @@ -770,34 +770,34 @@ static void reset_attrfv( struct vbo_exec_context *exec ) } -void +void GLAPIENTRY _vbo_Color4f(GLfloat r, GLfloat g, GLfloat b, GLfloat a) { vbo_Color4f(r, g, b, a); } -void +void GLAPIENTRY _vbo_Normal3f(GLfloat x, GLfloat y, GLfloat z) { vbo_Normal3f(x, y, z); } -void +void GLAPIENTRY _vbo_MultiTexCoord4f(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q) { vbo_MultiTexCoord4f(target, s, t, r, q); } -void +void GLAPIENTRY _vbo_Materialfv(GLenum face, GLenum pname, const GLfloat *params) { vbo_Materialfv(face, pname, params); } -void +void GLAPIENTRY _vbo_VertexAttrib4f(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) { vbo_VertexAttrib4fARB(index, x, y, z, w); -- cgit v1.2.3