diff options
Diffstat (limited to 'src/mesa/main')
54 files changed, 1295 insertions, 1035 deletions
diff --git a/src/mesa/main/accum.c b/src/mesa/main/accum.c index 2345695f3c..032e13b96e 100644 --- a/src/mesa/main/accum.c +++ b/src/mesa/main/accum.c @@ -29,6 +29,10 @@ #include "macros.h" #include "state.h" #include "mtypes.h" +#include "glapi/dispatch.h" + + +#if FEATURE_accum void GLAPIENTRY @@ -51,7 +55,7 @@ _mesa_ClearAccum( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_Accum( GLenum op, GLfloat value ) { GET_CURRENT_CONTEXT(ctx); @@ -99,6 +103,16 @@ _mesa_Accum( GLenum op, GLfloat value ) } +void +_mesa_init_accum_dispatch(struct _glapi_table *disp) +{ + SET_Accum(disp, _mesa_Accum); + SET_ClearAccum(disp, _mesa_ClearAccum); +} + + +#endif /* FEATURE_accum */ + void _mesa_init_accum( GLcontext *ctx ) diff --git a/src/mesa/main/accum.h b/src/mesa/main/accum.h index ce92688a5b..63740f07ed 100644 --- a/src/mesa/main/accum.h +++ b/src/mesa/main/accum.h @@ -38,25 +38,40 @@ #define ACCUM_H -#include "mtypes.h" +#include "main/mtypes.h" -#if _HAVE_FULL_GL - -extern void GLAPIENTRY -_mesa_Accum( GLenum op, GLfloat value ); +#if FEATURE_accum +#define _MESA_INIT_ACCUM_FUNCTIONS(driver, impl) \ + do { \ + (driver)->Accum = impl ## Accum; \ + } while (0) extern void GLAPIENTRY _mesa_ClearAccum( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ); -extern void -_mesa_init_accum( GLcontext *ctx ); +extern void +_mesa_init_accum_dispatch(struct _glapi_table *disp); + +#else /* FEATURE_accum */ -#else +#define _MESA_INIT_ACCUM_FUNCTIONS(driver, impl) do { } while (0) -/** No-op */ -#define _mesa_init_accum( c ) ((void)0) +static INLINE void +_mesa_ClearAccum( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ) +{ + /* this is used in _mesa_PopAttrib */ + ASSERT_NO_FEATURE(); +} -#endif +static INLINE void +_mesa_init_accum_dispatch(struct _glapi_table *disp) +{ +} + +#endif /* FEATURE_accum */ + +extern void +_mesa_init_accum( GLcontext *ctx ); -#endif +#endif /* ACCUM_H */ diff --git a/src/mesa/main/api_arrayelt.c b/src/mesa/main/api_arrayelt.c index 2462a1b003..a058227110 100644 --- a/src/mesa/main/api_arrayelt.c +++ b/src/mesa/main/api_arrayelt.c @@ -71,6 +71,10 @@ typedef struct { */ #define TYPE_IDX(t) ( (t) == GL_DOUBLE ? 7 : (t) & 7 ) + +#if FEATURE_arrayelt + + static const int ColorFuncs[2][8] = { { _gloffset_Color3bv, @@ -1160,7 +1164,7 @@ static void _ae_update_state( GLcontext *ctx ) at->array = attribArray; /* Note: we can't grab the _glapi_Dispatch->VertexAttrib1fvNV * function pointer here (for float arrays) since the pointer may - * change from one execution of _ae_loopback_array_elt() to + * change from one execution of _ae_ArrayElement() to * the next. Doing so caused UT to break. */ if (ctx->VertexProgram._Enabled @@ -1254,7 +1258,7 @@ void _ae_unmap_vbos( GLcontext *ctx ) * for all enabled vertex arrays (for elt-th element). * Note: this may be called during display list construction. */ -void GLAPIENTRY _ae_loopback_array_elt( GLint elt ) +void GLAPIENTRY _ae_ArrayElement( GLint elt ) { GET_CURRENT_CONTEXT(ctx); const AEcontext *actx = AE_CONTEXT(ctx); @@ -1317,3 +1321,13 @@ void _ae_invalidate_state( GLcontext *ctx, GLuint new_state ) actx->NewState |= new_state; } } + + +void _mesa_install_arrayelt_vtxfmt(struct _glapi_table *disp, + const GLvertexformat *vfmt) +{ + SET_ArrayElement(disp, vfmt->ArrayElement); +} + + +#endif /* FEATURE_arrayelt */ diff --git a/src/mesa/main/api_arrayelt.h b/src/mesa/main/api_arrayelt.h index e621724fb2..d18c0792c3 100644 --- a/src/mesa/main/api_arrayelt.h +++ b/src/mesa/main/api_arrayelt.h @@ -27,16 +27,57 @@ #ifndef API_ARRAYELT_H #define API_ARRAYELT_H -#include "mtypes.h" + +#include "main/mtypes.h" + +#if FEATURE_arrayelt + +#define _MESA_INIT_ARRAYELT_VTXFMT(vfmt, impl) \ + do { \ + (vfmt)->ArrayElement = impl ## ArrayElement; \ + } while (0) extern GLboolean _ae_create_context( GLcontext *ctx ); extern void _ae_destroy_context( GLcontext *ctx ); extern void _ae_invalidate_state( GLcontext *ctx, GLuint new_state ); -extern void GLAPIENTRY _ae_loopback_array_elt( GLint elt ); +extern void GLAPIENTRY _ae_ArrayElement( GLint elt ); /* May optionally be called before a batch of element calls: */ extern void _ae_map_vbos( GLcontext *ctx ); extern void _ae_unmap_vbos( GLcontext *ctx ); -#endif +extern void +_mesa_install_arrayelt_vtxfmt(struct _glapi_table *disp, + const GLvertexformat *vfmt); + +#else /* FEATURE_arrayelt */ + +#define _MESA_INIT_ARRAYELT_VTXFMT(vfmt, impl) do { } while (0) + +static INLINE GLboolean +_ae_create_context( GLcontext *ctx ) +{ + return GL_TRUE; +} + +static INLINE void +_ae_destroy_context( GLcontext *ctx ) +{ +} + +static INLINE void +_ae_invalidate_state( GLcontext *ctx, GLuint new_state ) +{ +} + +static INLINE void +_mesa_install_arrayelt_vtxfmt(struct _glapi_table *disp, + const GLvertexformat *vfmt) +{ +} + +#endif /* FEATURE_arrayelt */ + + +#endif /* API_ARRAYELT_H */ diff --git a/src/mesa/main/api_exec.c b/src/mesa/main/api_exec.c index 02550ae108..1559984f43 100644 --- a/src/mesa/main/api_exec.c +++ b/src/mesa/main/api_exec.c @@ -30,9 +30,7 @@ #include "mfeatures.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 @@ -41,9 +39,7 @@ #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" @@ -54,29 +50,17 @@ #endif #include "clear.h" #include "clip.h" -#if FEATURE_colortable #include "colortab.h" -#endif #include "context.h" -#if FEATURE_convolve #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_feedback #include "feedback.h" -#endif #include "fog.h" #if FEATURE_EXT_framebuffer_object #include "fbobject.h" @@ -84,24 +68,18 @@ #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 "readpix.h" #include "scissor.h" #include "state.h" @@ -109,9 +87,7 @@ #include "texenv.h" #include "texgetimage.h" #include "teximage.h" -#if FEATURE_texgen #include "texgen.h" -#endif #include "texobj.h" #include "texparam.h" #include "texstate.h" @@ -199,20 +175,10 @@ _mesa_init_exec_table(struct _glapi_table *exec) SET_TexParameteri(exec, _mesa_TexParameteri); SET_Translatef(exec, _mesa_Translatef); SET_Viewport(exec, _mesa_Viewport); -#if FEATURE_accum - SET_Accum(exec, _mesa_Accum); - SET_ClearAccum(exec, _mesa_ClearAccum); -#endif -#if FEATURE_dlist - SET_CallList(exec, _mesa_CallList); - SET_CallLists(exec, _mesa_CallLists); - 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 + + _mesa_init_accum_dispatch(exec); + _mesa_init_dlist_dispatch(exec); + SET_ClearDepth(exec, _mesa_ClearDepth); SET_ClearIndex(exec, _mesa_ClearIndex); SET_ClipPlane(exec, _mesa_ClipPlane); @@ -222,21 +188,10 @@ _mesa_init_exec_table(struct _glapi_table *exec) 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); -#endif -#if FEATURE_feedback - 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 + + _mesa_init_drawpix_dispatch(exec); + _mesa_init_feedback_dispatch(exec); + SET_FogCoordPointerEXT(exec, _mesa_FogCoordPointerEXT); SET_Fogf(exec, _mesa_Fogf); SET_Fogfv(exec, _mesa_Fogfv); @@ -270,68 +225,22 @@ _mesa_init_exec_table(struct _glapi_table *exec) SET_Lighti(exec, _mesa_Lighti); SET_Lightiv(exec, _mesa_Lightiv); 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); - SET_Map2f(exec, _mesa_Map2f); - SET_MapGrid1d(exec, _mesa_MapGrid1d); - SET_MapGrid1f(exec, _mesa_MapGrid1f); - SET_MapGrid2d(exec, _mesa_MapGrid2d); - SET_MapGrid2f(exec, _mesa_MapGrid2f); -#endif + + _mesa_init_eval_dispatch(exec); + SET_MultMatrixd(exec, _mesa_MultMatrixd); -#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_PixelTransferf(exec, _mesa_PixelTransferf); - SET_PixelTransferi(exec, _mesa_PixelTransferi); - SET_PixelZoom(exec, _mesa_PixelZoom); -#endif + + _mesa_init_pixel_dispatch(exec); + 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); - SET_RasterPos2sv(exec, _mesa_RasterPos2sv); - SET_RasterPos3d(exec, _mesa_RasterPos3d); - SET_RasterPos3dv(exec, _mesa_RasterPos3dv); - SET_RasterPos3f(exec, _mesa_RasterPos3f); - SET_RasterPos3fv(exec, _mesa_RasterPos3fv); - SET_RasterPos3i(exec, _mesa_RasterPos3i); - SET_RasterPos3iv(exec, _mesa_RasterPos3iv); - SET_RasterPos3s(exec, _mesa_RasterPos3s); - SET_RasterPos3sv(exec, _mesa_RasterPos3sv); - SET_RasterPos4d(exec, _mesa_RasterPos4d); - SET_RasterPos4dv(exec, _mesa_RasterPos4dv); - SET_RasterPos4f(exec, _mesa_RasterPos4f); - SET_RasterPos4fv(exec, _mesa_RasterPos4fv); - SET_RasterPos4i(exec, _mesa_RasterPos4i); - SET_RasterPos4iv(exec, _mesa_RasterPos4iv); - SET_RasterPos4s(exec, _mesa_RasterPos4s); - SET_RasterPos4sv(exec, _mesa_RasterPos4sv); -#endif + + _mesa_init_attrib_dispatch(exec); + _mesa_init_rastpos_dispatch(exec); + SET_ReadPixels(exec, _mesa_ReadPixels); SET_Rotated(exec, _mesa_Rotated); SET_Scaled(exec, _mesa_Scaled); @@ -339,17 +248,7 @@ _mesa_init_exec_table(struct _glapi_table *exec) 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 + _mesa_init_texgen_dispatch(exec); SET_TexImage1D(exec, _mesa_TexImage1D); SET_TexParameterf(exec, _mesa_TexParameterf); @@ -395,45 +294,9 @@ _mesa_init_exec_table(struct _glapi_table *exec) 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_convolve - 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_CopyConvolutionFilter1D(exec, _mesa_CopyConvolutionFilter1D); - SET_CopyConvolutionFilter2D(exec, _mesa_CopyConvolutionFilter2D); - 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); - SET_GetMinmax(exec, _mesa_GetMinmax); - SET_GetMinmaxParameterfv(exec, _mesa_GetMinmaxParameterfv); - SET_GetMinmaxParameteriv(exec, _mesa_GetMinmaxParameteriv); - SET_GetSeparableFilter(exec, _mesa_GetSeparableFilter); - SET_Histogram(exec, _mesa_Histogram); - SET_Minmax(exec, _mesa_Minmax); - SET_ResetHistogram(exec, _mesa_ResetHistogram); - SET_ResetMinmax(exec, _mesa_ResetMinmax); -#endif + _mesa_init_colortable_dispatch(exec); + _mesa_init_convolve_dispatch(exec); + _mesa_init_histogram_dispatch(exec); /* OpenGL 2.0 */ SET_StencilFuncSeparate(exec, _mesa_StencilFuncSeparate); @@ -545,32 +408,7 @@ _mesa_init_exec_table(struct _glapi_table *exec) #endif /* 197. GL_MESA_window_pos */ -#if FEATURE_drawpix - SET_WindowPos2dMESA(exec, _mesa_WindowPos2dMESA); - SET_WindowPos2dvMESA(exec, _mesa_WindowPos2dvMESA); - SET_WindowPos2fMESA(exec, _mesa_WindowPos2fMESA); - SET_WindowPos2fvMESA(exec, _mesa_WindowPos2fvMESA); - SET_WindowPos2iMESA(exec, _mesa_WindowPos2iMESA); - SET_WindowPos2ivMESA(exec, _mesa_WindowPos2ivMESA); - SET_WindowPos2sMESA(exec, _mesa_WindowPos2sMESA); - SET_WindowPos2svMESA(exec, _mesa_WindowPos2svMESA); - SET_WindowPos3dMESA(exec, _mesa_WindowPos3dMESA); - SET_WindowPos3dvMESA(exec, _mesa_WindowPos3dvMESA); - SET_WindowPos3fMESA(exec, _mesa_WindowPos3fMESA); - SET_WindowPos3fvMESA(exec, _mesa_WindowPos3fvMESA); - SET_WindowPos3iMESA(exec, _mesa_WindowPos3iMESA); - SET_WindowPos3ivMESA(exec, _mesa_WindowPos3ivMESA); - SET_WindowPos3sMESA(exec, _mesa_WindowPos3sMESA); - SET_WindowPos3svMESA(exec, _mesa_WindowPos3svMESA); - SET_WindowPos4dMESA(exec, _mesa_WindowPos4dMESA); - SET_WindowPos4dvMESA(exec, _mesa_WindowPos4dvMESA); - SET_WindowPos4fMESA(exec, _mesa_WindowPos4fMESA); - SET_WindowPos4fvMESA(exec, _mesa_WindowPos4fvMESA); - SET_WindowPos4iMESA(exec, _mesa_WindowPos4iMESA); - SET_WindowPos4ivMESA(exec, _mesa_WindowPos4ivMESA); - SET_WindowPos4sMESA(exec, _mesa_WindowPos4sMESA); - SET_WindowPos4svMESA(exec, _mesa_WindowPos4svMESA); -#endif + /* part of _mesa_init_rastpos_dispatch(exec); */ /* 200. GL_IBM_multimode_draw_arrays */ #if _HAVE_FULL_GL @@ -762,16 +600,7 @@ _mesa_init_exec_table(struct _glapi_table *exec) #endif /* ARB 29. GL_ARB_occlusion_query */ -#if FEATURE_ARB_occlusion_query - SET_GenQueriesARB(exec, _mesa_GenQueriesARB); - SET_DeleteQueriesARB(exec, _mesa_DeleteQueriesARB); - SET_IsQueryARB(exec, _mesa_IsQueryARB); - SET_BeginQueryARB(exec, _mesa_BeginQueryARB); - SET_EndQueryARB(exec, _mesa_EndQueryARB); - SET_GetQueryivARB(exec, _mesa_GetQueryivARB); - SET_GetQueryObjectivARB(exec, _mesa_GetQueryObjectivARB); - SET_GetQueryObjectuivARB(exec, _mesa_GetQueryObjectuivARB); -#endif + _mesa_init_queryobj_dispatch(exec); /* ARB 37. GL_ARB_draw_buffers */ #if FEATURE_draw_read_buffer @@ -881,11 +710,6 @@ _mesa_init_exec_table(struct _glapi_table *exec) SET_GenerateMipmapEXT(exec, _mesa_GenerateMipmapEXT); #endif -#if FEATURE_EXT_timer_query - SET_GetQueryObjecti64vEXT(exec, _mesa_GetQueryObjecti64vEXT); - SET_GetQueryObjectui64vEXT(exec, _mesa_GetQueryObjectui64vEXT); -#endif - #if FEATURE_EXT_framebuffer_blit SET_BlitFramebufferEXT(exec, _mesa_BlitFramebufferEXT); #endif diff --git a/src/mesa/main/api_loopback.c b/src/mesa/main/api_loopback.c index 0e3f5ff957..3d466ac44a 100644 --- a/src/mesa/main/api_loopback.c +++ b/src/mesa/main/api_loopback.c @@ -77,6 +77,10 @@ #define FOGCOORDF(x) CALL_FogCoordfEXT(GET_DISPATCH(), (x)) #define SECONDARYCOLORF(a,b,c) CALL_SecondaryColor3fEXT(GET_DISPATCH(), (a,b,c)) + +#if FEATURE_beginend + + static void GLAPIENTRY loopback_Color3b_f( GLbyte red, GLbyte green, GLbyte blue ) { @@ -1655,3 +1659,6 @@ _mesa_loopback_init_api_table( struct _glapi_table *dest ) SET_VertexAttrib4NusvARB(dest, loopback_VertexAttrib4NusvARB); SET_VertexAttrib4NuivARB(dest, loopback_VertexAttrib4NuivARB); } + + +#endif /* FEATURE_beginend */ diff --git a/src/mesa/main/api_loopback.h b/src/mesa/main/api_loopback.h index 6f85bbc1d9..3140eb515e 100644 --- a/src/mesa/main/api_loopback.h +++ b/src/mesa/main/api_loopback.h @@ -27,11 +27,19 @@ #ifndef API_LOOPBACK_H #define API_LOOPBACK_H -#include "glheader.h" +#include "main/mtypes.h" - -struct _glapi_table; +#if FEATURE_beginend extern void _mesa_loopback_init_api_table( struct _glapi_table *dest ); -#endif +#else /* FEATURE_beginend */ + +static INLINE void +_mesa_loopback_init_api_table( struct _glapi_table *dest ) +{ +} + +#endif /* FEATURE_beginend */ + +#endif /* API_LOOPBACK_H */ diff --git a/src/mesa/main/api_noop.c b/src/mesa/main/api_noop.c index 0b669e7e7f..f72f957300 100644 --- a/src/mesa/main/api_noop.c +++ b/src/mesa/main/api_noop.c @@ -30,9 +30,8 @@ #include "context.h" #include "light.h" #include "macros.h" -#if FEATURE_dlist #include "dlist.h" -#endif +#include "eval.h" #include "glapi/dispatch.h" @@ -44,6 +43,9 @@ */ +#if FEATURE_beginend + + static void GLAPIENTRY _mesa_noop_EdgeFlag( GLboolean b ) { GET_CURRENT_CONTEXT(ctx); @@ -992,26 +994,21 @@ _mesa_noop_EvalMesh2( GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 ) void _mesa_noop_vtxfmt_init( GLvertexformat *vfmt ) { - vfmt->ArrayElement = _ae_loopback_array_elt; /* generic helper */ + _MESA_INIT_ARRAYELT_VTXFMT(vfmt, _ae_); + vfmt->Begin = _mesa_noop_Begin; -#if FEATURE_dlist - vfmt->CallList = _mesa_CallList; - vfmt->CallLists = _mesa_CallLists; -#endif + + _MESA_INIT_DLIST_VTXFMT(vfmt, _mesa_); + 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 + + _MESA_INIT_EVAL_VTXFMT(vfmt, _mesa_noop_); + vfmt->FogCoordfEXT = _mesa_noop_FogCoordfEXT; vfmt->FogCoordfvEXT = _mesa_noop_FogCoordfvEXT; vfmt->Indexf = _mesa_noop_Indexf; @@ -1069,6 +1066,7 @@ _mesa_noop_vtxfmt_init( GLvertexformat *vfmt ) vfmt->DrawElementsBaseVertex = _mesa_noop_DrawElementsBaseVertex; vfmt->DrawRangeElementsBaseVertex = _mesa_noop_DrawRangeElementsBaseVertex; vfmt->MultiDrawElementsBaseVertex = _mesa_noop_MultiDrawElementsBaseVertex; - vfmt->EvalMesh1 = _mesa_noop_EvalMesh1; - vfmt->EvalMesh2 = _mesa_noop_EvalMesh2; } + + +#endif /* FEATURE_beginend */ diff --git a/src/mesa/main/api_noop.h b/src/mesa/main/api_noop.h index 1150984d64..e7fd49bafb 100644 --- a/src/mesa/main/api_noop.h +++ b/src/mesa/main/api_noop.h @@ -25,8 +25,9 @@ #ifndef _API_NOOP_H #define _API_NOOP_H -#include "mtypes.h" -#include "context.h" +#include "main/mtypes.h" + +#if FEATURE_beginend extern void GLAPIENTRY _mesa_noop_Rectf(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2); @@ -54,4 +55,6 @@ _mesa_noop_MultiDrawElementsBaseVertex(GLenum mode, const GLsizei *count, extern void _mesa_noop_vtxfmt_init(GLvertexformat *vfmt); -#endif +#endif /* FEATURE_beginend */ + +#endif /* _API_NOOP_H */ diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c index 4a1448deee..e71e5a6ce8 100644 --- a/src/mesa/main/api_validate.c +++ b/src/mesa/main/api_validate.c @@ -52,6 +52,51 @@ index_bytes(GLenum type, GLsizei count) /** + * Find the max index in the given element/index buffer + */ +GLuint +_mesa_max_buffer_index(GLcontext *ctx, GLuint count, GLenum type, + const void *indices, + struct gl_buffer_object *elementBuf) +{ + const GLubyte *map = NULL; + GLuint max = 0; + GLuint i; + + if (_mesa_is_bufferobj(elementBuf)) { + /* elements are in a user-defined buffer object. need to map it */ + map = ctx->Driver.MapBuffer(ctx, GL_ELEMENT_ARRAY_BUFFER, + GL_READ_ONLY, elementBuf); + /* Actual address is the sum of pointers */ + indices = (const GLvoid *) ADD_POINTERS(map, (const GLubyte *) indices); + } + + if (type == GL_UNSIGNED_INT) { + for (i = 0; i < count; i++) + if (((GLuint *) indices)[i] > max) + max = ((GLuint *) indices)[i]; + } + else if (type == GL_UNSIGNED_SHORT) { + for (i = 0; i < count; i++) + if (((GLushort *) indices)[i] > max) + max = ((GLushort *) indices)[i]; + } + else { + ASSERT(type == GL_UNSIGNED_BYTE); + for (i = 0; i < count; i++) + if (((GLubyte *) indices)[i] > max) + max = ((GLubyte *) indices)[i]; + } + + if (map) { + ctx->Driver.UnmapBuffer(ctx, GL_ELEMENT_ARRAY_BUFFER_ARB, elementBuf); + } + + return max; +} + + +/** * Check if OK to draw arrays/elements. */ static GLboolean diff --git a/src/mesa/main/api_validate.h b/src/mesa/main/api_validate.h index 1d3ae157d7..6064d15fe6 100644 --- a/src/mesa/main/api_validate.h +++ b/src/mesa/main/api_validate.h @@ -30,6 +30,12 @@ #include "mtypes.h" + +extern GLuint +_mesa_max_buffer_index(GLcontext *ctx, GLuint count, GLenum type, + const void *indices, + struct gl_buffer_object *elementBuf); + extern GLboolean _mesa_validate_DrawArrays(GLcontext *ctx, GLenum mode, GLint start, GLsizei count); diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c index 0fb8fa3bba..246c5521b7 100644 --- a/src/mesa/main/attrib.c +++ b/src/mesa/main/attrib.c @@ -57,6 +57,7 @@ #include "varray.h" #include "viewport.h" #include "mtypes.h" +#include "glapi/dispatch.h" /** @@ -174,6 +175,9 @@ struct texture_state }; +#if FEATURE_attrib_stack + + /** * Allocate new attribute node of given type/kind. Attach payload data. * Insert it into the linked list named by 'head'. @@ -1464,6 +1468,19 @@ _mesa_PopClientAttrib(void) } +void +_mesa_init_attrib_dispatch(struct _glapi_table *disp) +{ + SET_PopAttrib(disp, _mesa_PopAttrib); + SET_PushAttrib(disp, _mesa_PushAttrib); + SET_PopClientAttrib(disp, _mesa_PopClientAttrib); + SET_PushClientAttrib(disp, _mesa_PushClientAttrib); +} + + +#endif /* FEATURE_attrib_stack */ + + /** * Free any attribute state data that might be attached to the context. */ diff --git a/src/mesa/main/attrib.h b/src/mesa/main/attrib.h index 2cf8fe6934..6b48a17663 100644 --- a/src/mesa/main/attrib.h +++ b/src/mesa/main/attrib.h @@ -26,10 +26,10 @@ #define ATTRIB_H -#include "mtypes.h" +#include "main/mtypes.h" -#if _HAVE_FULL_GL +#if FEATURE_attrib_stack extern void GLAPIENTRY _mesa_PushAttrib( GLbitfield mask ); @@ -43,18 +43,34 @@ _mesa_PushClientAttrib( GLbitfield mask ); extern void GLAPIENTRY _mesa_PopClientAttrib( void ); +extern void +_mesa_init_attrib_dispatch(struct _glapi_table *disp); + +#else /* FEATURE_attrib_stack */ + +static INLINE void +_mesa_PushClientAttrib( GLbitfield mask ) +{ + ASSERT_NO_FEATURE(); +} + +static INLINE void +_mesa_PopClientAttrib( void ) +{ + ASSERT_NO_FEATURE(); +} + +static INLINE void +_mesa_init_attrib_dispatch(struct _glapi_table *disp) +{ +} + +#endif /* FEATURE_attrib_stack */ + extern void _mesa_init_attrib( GLcontext *ctx ); extern void _mesa_free_attrib_data( GLcontext *ctx ); -#else - -/** No-op */ -#define _mesa_init_attrib( c ) ((void)0) -#define _mesa_free_attrib_data( c ) ((void)0) - -#endif - -#endif +#endif /* ATTRIB_H */ diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c index b95e00af5b..189b5e1655 100644 --- a/src/mesa/main/bufferobj.c +++ b/src/mesa/main/bufferobj.c @@ -1173,7 +1173,7 @@ _mesa_BufferDataARB(GLenum target, GLsizeiptrARB size, ASSERT(ctx->Driver.BufferData); if (!ctx->Driver.BufferData( ctx, target, size, data, usage, bufObj )) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBufferDataARB(access)"); + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBufferDataARB()"); } } @@ -1262,7 +1262,7 @@ _mesa_MapBufferARB(GLenum target, GLenum access) ASSERT(ctx->Driver.MapBuffer); map = ctx->Driver.MapBuffer( ctx, target, access, bufObj ); if (!map) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glMapBufferARB(access)"); + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glMapBufferARB(map failed)"); return NULL; } else { @@ -1593,7 +1593,7 @@ _mesa_MapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length, map = ctx->Driver.MapBufferRange(ctx, target, offset, length, access, bufObj); if (!map) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glMapBufferARB(access)"); + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glMapBufferARB(map failed)"); } else { /* The driver callback should have set all these fields. diff --git a/src/mesa/main/colortab.c b/src/mesa/main/colortab.c index 5447eb18ef..5ede76c1fb 100644 --- a/src/mesa/main/colortab.c +++ b/src/mesa/main/colortab.c @@ -32,6 +32,10 @@ #include "state.h" #include "teximage.h" #include "texstate.h" +#include "glapi/dispatch.h" + + +#if FEATURE_colortable /** @@ -536,7 +540,7 @@ _mesa_ColorSubTable( GLenum target, GLsizei start, -void GLAPIENTRY +static void GLAPIENTRY _mesa_CopyColorTable(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width) { @@ -552,7 +556,7 @@ _mesa_CopyColorTable(GLenum target, GLenum internalformat, -void GLAPIENTRY +static void GLAPIENTRY _mesa_CopyColorSubTable(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width) { @@ -568,7 +572,7 @@ _mesa_CopyColorSubTable(GLenum target, GLsizei start, -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetColorTable( GLenum target, GLenum format, GLenum type, GLvoid *data ) { @@ -702,7 +706,7 @@ _mesa_GetColorTable( GLenum target, GLenum format, -void GLAPIENTRY +static void GLAPIENTRY _mesa_ColorTableParameterfv(GLenum target, GLenum pname, const GLfloat *params) { GLfloat *scale, *bias; @@ -747,7 +751,7 @@ _mesa_ColorTableParameterfv(GLenum target, GLenum pname, const GLfloat *params) -void GLAPIENTRY +static void GLAPIENTRY _mesa_ColorTableParameteriv(GLenum target, GLenum pname, const GLint *params) { GLfloat fparams[4]; @@ -770,7 +774,7 @@ _mesa_ColorTableParameteriv(GLenum target, GLenum pname, const GLint *params) -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetColorTableParameterfv( GLenum target, GLenum pname, GLfloat *params ) { GET_CURRENT_CONTEXT(ctx); @@ -897,7 +901,7 @@ _mesa_GetColorTableParameterfv( GLenum target, GLenum pname, GLfloat *params ) -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetColorTableParameteriv( GLenum target, GLenum pname, GLint *params ) { GET_CURRENT_CONTEXT(ctx); @@ -1052,6 +1056,25 @@ _mesa_GetColorTableParameteriv( GLenum target, GLenum pname, GLint *params ) } } + +void +_mesa_init_colortable_dispatch(struct _glapi_table *disp) +{ + SET_ColorSubTable(disp, _mesa_ColorSubTable); + SET_ColorTable(disp, _mesa_ColorTable); + SET_ColorTableParameterfv(disp, _mesa_ColorTableParameterfv); + SET_ColorTableParameteriv(disp, _mesa_ColorTableParameteriv); + SET_CopyColorSubTable(disp, _mesa_CopyColorSubTable); + SET_CopyColorTable(disp, _mesa_CopyColorTable); + SET_GetColorTable(disp, _mesa_GetColorTable); + SET_GetColorTableParameterfv(disp, _mesa_GetColorTableParameterfv); + SET_GetColorTableParameteriv(disp, _mesa_GetColorTableParameteriv); +} + + +#endif /* FEATURE_colortable */ + + /**********************************************************************/ /***** Initialization *****/ /**********************************************************************/ diff --git a/src/mesa/main/colortab.h b/src/mesa/main/colortab.h index b6ff737a65..652fb58246 100644 --- a/src/mesa/main/colortab.h +++ b/src/mesa/main/colortab.h @@ -27,9 +27,16 @@ #define COLORTAB_H -#include "mtypes.h" +#include "main/mtypes.h" -#if _HAVE_FULL_GL +#if FEATURE_colortable + +#define _MESA_INIT_COLORTABLE_FUNCTIONS(driver, impl) \ + do { \ + (driver)->CopyColorTable = impl ## CopyColorTable; \ + (driver)->CopyColorSubTable = impl ## CopyColorSubTable; \ + (driver)->UpdateTexturePalette = impl ## UpdateTexturePalette; \ + } while (0) extern void GLAPIENTRY _mesa_ColorTable( GLenum target, GLenum internalformat, @@ -41,32 +48,35 @@ _mesa_ColorSubTable( GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *table ); -extern void GLAPIENTRY -_mesa_CopyColorSubTable(GLenum target, GLsizei start, - GLint x, GLint y, GLsizei width); - -extern void GLAPIENTRY -_mesa_CopyColorTable(GLenum target, GLenum internalformat, - GLint x, GLint y, GLsizei width); +extern void +_mesa_init_colortable_dispatch(struct _glapi_table *disp); -extern void GLAPIENTRY -_mesa_GetColorTable( GLenum target, GLenum format, - GLenum type, GLvoid *table ); +#else /* FEATURE_colortable */ -extern void GLAPIENTRY -_mesa_ColorTableParameterfv(GLenum target, GLenum pname, - const GLfloat *params); +#define _MESA_INIT_COLORTABLE_FUNCTIONS(driver, impl) do { } while (0) -extern void GLAPIENTRY -_mesa_ColorTableParameteriv(GLenum target, GLenum pname, - const GLint *params); +static INLINE void GLAPIENTRY +_mesa_ColorTable( GLenum target, GLenum internalformat, + GLsizei width, GLenum format, GLenum type, + const GLvoid *table ) +{ + ASSERT_NO_FEATURE(); +} -extern void GLAPIENTRY -_mesa_GetColorTableParameterfv( GLenum target, GLenum pname, GLfloat *params ); +static INLINE void GLAPIENTRY +_mesa_ColorSubTable( GLenum target, GLsizei start, + GLsizei count, GLenum format, GLenum type, + const GLvoid *table ) +{ + ASSERT_NO_FEATURE(); +} -extern void GLAPIENTRY -_mesa_GetColorTableParameteriv( GLenum target, GLenum pname, GLint *params ); +static INLINE void +_mesa_init_colortable_dispatch(struct _glapi_table *disp) +{ +} +#endif /* FEATURE_colortable */ extern void @@ -81,20 +91,5 @@ _mesa_init_colortables( GLcontext *ctx ); extern void _mesa_free_colortables_data( GLcontext *ctx ); -#else - -/** No-op */ -#define _mesa_init_colortable( p ) ((void) 0) - -/** No-op */ -#define _mesa_free_colortable_data( p ) ((void) 0) - -/** No-op */ -#define _mesa_init_colortables( p ) ((void)0) - -/** No-op */ -#define _mesa_free_colortables_data( p ) ((void)0) - -#endif -#endif +#endif /* COLORTAB_H */ diff --git a/src/mesa/main/compiler.h b/src/mesa/main/compiler.h index 9319505a75..380663ec97 100644 --- a/src/mesa/main/compiler.h +++ b/src/mesa/main/compiler.h @@ -107,8 +107,7 @@ extern "C" { /** * finite macro. */ -#if defined(_WIN32) && !defined(__WIN32__) && !defined(__CYGWIN__) && !defined(BUILD_FOR_SNAP) -# define __WIN32__ +#if defined(_MSC_VER) # define finite _finite #elif defined(__WATCOMC__) # define finite _finite diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index f6d4ac4595..11b1d24453 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -79,42 +79,28 @@ #include "glheader.h" #include "mfeatures.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 "cpuinfo.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" @@ -126,15 +112,11 @@ #include "pixelstore.h" #include "points.h" #include "polygon.h" -#if FEATURE_ARB_occlusion_query #include "queryobj.h" -#endif #if FEATURE_ARB_sync #include "syncobj.h" #endif -#if FEATURE_drawpix #include "rastpos.h" -#endif #include "scissor.h" #include "shared.h" #include "simple_list.h" @@ -678,36 +660,20 @@ 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 _mesa_init_fbobjects( ctx ); -#if FEATURE_feedback _mesa_init_feedback( ctx ); -#else - ctx->RenderMode = GL_RENDER; -#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 ); @@ -718,15 +684,11 @@ init_attrib_groups(GLcontext *ctx) _mesa_init_point( ctx ); _mesa_init_polygon( ctx ); _mesa_init_program( ctx ); -#if FEATURE_ARB_occlusion_query - _mesa_init_query( ctx ); -#endif + _mesa_init_queryobj( ctx ); #if FEATURE_ARB_sync _mesa_init_sync( ctx ); #endif -#if FEATURE_drawpix _mesa_init_rastpos( ctx ); -#endif _mesa_init_scissor( ctx ); _mesa_init_shader_state( ctx ); _mesa_init_stencil( ctx ); @@ -903,10 +865,12 @@ _mesa_initialize_context(GLcontext *ctx, _mesa_init_exec_table(ctx->Exec); #endif ctx->CurrentDispatch = ctx->Exec; + #if FEATURE_dlist - _mesa_init_dlist_table(ctx->Save); + _mesa_init_save_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; @@ -1005,24 +969,16 @@ _mesa_free_context_data( GLcontext *ctx ) _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._Current, NULL); _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._TexEnvProgram, NULL); -#if FEATURE_attrib_stack _mesa_free_attrib_data(ctx); -#endif _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); -#if FEATURE_ARB_occlusion_query - _mesa_free_query_data(ctx); -#endif + _mesa_free_queryobj_data(ctx); #if FEATURE_ARB_sync _mesa_free_sync_data(ctx); #endif diff --git a/src/mesa/main/convolve.c b/src/mesa/main/convolve.c index bf6f6619d4..8db3e79d38 100644 --- a/src/mesa/main/convolve.c +++ b/src/mesa/main/convolve.c @@ -40,6 +40,10 @@ #include "mtypes.h" #include "pixel.h" #include "state.h" +#include "glapi/dispatch.h" + + +#if FEATURE_convolve /* @@ -256,7 +260,7 @@ _mesa_ConvolutionFilter2D(GLenum target, GLenum internalFormat, GLsizei width, G } -void GLAPIENTRY +static void GLAPIENTRY _mesa_ConvolutionParameterf(GLenum target, GLenum pname, GLfloat param) { GET_CURRENT_CONTEXT(ctx); @@ -299,7 +303,7 @@ _mesa_ConvolutionParameterf(GLenum target, GLenum pname, GLfloat param) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_ConvolutionParameterfv(GLenum target, GLenum pname, const GLfloat *params) { GET_CURRENT_CONTEXT(ctx); @@ -351,7 +355,7 @@ _mesa_ConvolutionParameterfv(GLenum target, GLenum pname, const GLfloat *params) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_ConvolutionParameteri(GLenum target, GLenum pname, GLint param) { GET_CURRENT_CONTEXT(ctx); @@ -394,7 +398,7 @@ _mesa_ConvolutionParameteri(GLenum target, GLenum pname, GLint param) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_ConvolutionParameteriv(GLenum target, GLenum pname, const GLint *params) { GET_CURRENT_CONTEXT(ctx); @@ -459,7 +463,7 @@ _mesa_ConvolutionParameteriv(GLenum target, GLenum pname, const GLint *params) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_CopyConvolutionFilter1D(GLenum target, GLenum internalFormat, GLint x, GLint y, GLsizei width) { GLint baseFormat; @@ -491,7 +495,7 @@ _mesa_CopyConvolutionFilter1D(GLenum target, GLenum internalFormat, GLint x, GLi } -void GLAPIENTRY +static void GLAPIENTRY _mesa_CopyConvolutionFilter2D(GLenum target, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height) { GLint baseFormat; @@ -527,7 +531,7 @@ _mesa_CopyConvolutionFilter2D(GLenum target, GLenum internalFormat, GLint x, GLi } -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetConvolutionFilter(GLenum target, GLenum format, GLenum type, GLvoid *image) { @@ -586,7 +590,7 @@ _mesa_GetConvolutionFilter(GLenum target, GLenum format, GLenum type, } -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetConvolutionParameterfv(GLenum target, GLenum pname, GLfloat *params) { GET_CURRENT_CONTEXT(ctx); @@ -647,7 +651,7 @@ _mesa_GetConvolutionParameterfv(GLenum target, GLenum pname, GLfloat *params) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetConvolutionParameteriv(GLenum target, GLenum pname, GLint *params) { GET_CURRENT_CONTEXT(ctx); @@ -717,7 +721,7 @@ _mesa_GetConvolutionParameteriv(GLenum target, GLenum pname, GLint *params) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetSeparableFilter(GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span) { @@ -784,7 +788,7 @@ _mesa_GetSeparableFilter(GLenum target, GLenum format, GLenum type, } -void GLAPIENTRY +static void GLAPIENTRY _mesa_SeparableFilter2D(GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column) { const GLint colStart = MAX_CONVOLUTION_WIDTH * 4; @@ -1433,3 +1437,25 @@ _mesa_adjust_image_for_convolution(const GLcontext *ctx, GLuint dimensions, *height = *height - (MAX2(ctx->Separable2D.Height, 1) - 1); } } + + +void +_mesa_init_convolve_dispatch(struct _glapi_table *disp) +{ + SET_ConvolutionFilter1D(disp, _mesa_ConvolutionFilter1D); + SET_ConvolutionFilter2D(disp, _mesa_ConvolutionFilter2D); + SET_ConvolutionParameterf(disp, _mesa_ConvolutionParameterf); + SET_ConvolutionParameterfv(disp, _mesa_ConvolutionParameterfv); + SET_ConvolutionParameteri(disp, _mesa_ConvolutionParameteri); + SET_ConvolutionParameteriv(disp, _mesa_ConvolutionParameteriv); + SET_CopyConvolutionFilter1D(disp, _mesa_CopyConvolutionFilter1D); + SET_CopyConvolutionFilter2D(disp, _mesa_CopyConvolutionFilter2D); + SET_GetConvolutionFilter(disp, _mesa_GetConvolutionFilter); + SET_GetConvolutionParameterfv(disp, _mesa_GetConvolutionParameterfv); + SET_GetConvolutionParameteriv(disp, _mesa_GetConvolutionParameteriv); + SET_SeparableFilter2D(disp, _mesa_SeparableFilter2D); + SET_GetSeparableFilter(disp, _mesa_GetSeparableFilter); +} + + +#endif /* FEATURE_convolve */ diff --git a/src/mesa/main/convolve.h b/src/mesa/main/convolve.h index 4505cdae01..59492bc7c5 100644 --- a/src/mesa/main/convolve.h +++ b/src/mesa/main/convolve.h @@ -28,10 +28,17 @@ #define CONVOLVE_H -#include "mtypes.h" +#include "main/mtypes.h" -#if _HAVE_FULL_GL +#if FEATURE_convolve + +#define _MESA_INIT_CONVOLVE_FUNCTIONS(driver, impl) \ + do { \ + (driver)->CopyConvolutionFilter1D = impl ## CopyConvolutionFilter1D; \ + (driver)->CopyConvolutionFilter2D = impl ## CopyConvolutionFilter2D; \ + } while (0) + extern void GLAPIENTRY _mesa_ConvolutionFilter1D(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); @@ -41,74 +48,79 @@ _mesa_ConvolutionFilter2D(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); -extern void GLAPIENTRY -_mesa_ConvolutionParameterf(GLenum target, GLenum pname, GLfloat params); - -extern void GLAPIENTRY -_mesa_ConvolutionParameterfv(GLenum target, GLenum pname, - const GLfloat *params); - -extern void GLAPIENTRY -_mesa_ConvolutionParameteri(GLenum target, GLenum pname, GLint params); - -extern void GLAPIENTRY -_mesa_ConvolutionParameteriv(GLenum target, GLenum pname, const GLint *params); - -extern void GLAPIENTRY -_mesa_CopyConvolutionFilter1D(GLenum target, GLenum internalformat, - GLint x, GLint y, GLsizei width); +extern void +_mesa_convolve_1d_image(const GLcontext *ctx, GLsizei *width, + const GLfloat *srcImage, GLfloat *dstImage); -extern void GLAPIENTRY -_mesa_CopyConvolutionFilter2D(GLenum target, GLenum internalformat, - GLint x, GLint y, GLsizei width, GLsizei height); +extern void +_mesa_convolve_2d_image(const GLcontext *ctx, GLsizei *width, GLsizei *height, + const GLfloat *srcImage, GLfloat *dstImage); -extern void GLAPIENTRY -_mesa_GetConvolutionFilter(GLenum target, GLenum format, GLenum type, - GLvoid *image); +extern void +_mesa_convolve_sep_image(const GLcontext *ctx, + GLsizei *width, GLsizei *height, + const GLfloat *srcImage, GLfloat *dstImage); -extern void GLAPIENTRY -_mesa_GetConvolutionParameterfv(GLenum target, GLenum pname, GLfloat *params); +extern void +_mesa_adjust_image_for_convolution(const GLcontext *ctx, GLuint dimensions, + GLsizei *width, GLsizei *height); -extern void GLAPIENTRY -_mesa_GetConvolutionParameteriv(GLenum target, GLenum pname, GLint *params); +extern void +_mesa_init_convolve_dispatch(struct _glapi_table *disp); -extern void GLAPIENTRY -_mesa_GetSeparableFilter(GLenum target, GLenum format, GLenum type, - GLvoid *row, GLvoid *column, GLvoid *span); +#else /* FEATURE_convolve */ -extern void GLAPIENTRY -_mesa_SeparableFilter2D(GLenum target, GLenum internalformat, - GLsizei width, GLsizei height, - GLenum format, GLenum type, - const GLvoid *row, const GLvoid *column); +#define _MESA_INIT_CONVOLVE_FUNCTIONS(driver, impl) do { } while (0) +static INLINE void GLAPIENTRY +_mesa_ConvolutionFilter1D(GLenum target, GLenum internalformat, GLsizei width, + GLenum format, GLenum type, const GLvoid *image) +{ + ASSERT_NO_FEATURE(); +} +static INLINE void GLAPIENTRY +_mesa_ConvolutionFilter2D(GLenum target, GLenum internalformat, GLsizei width, + GLsizei height, GLenum format, GLenum type, + const GLvoid *image) +{ + ASSERT_NO_FEATURE(); +} -extern void +static INLINE void _mesa_convolve_1d_image(const GLcontext *ctx, GLsizei *width, - const GLfloat *srcImage, GLfloat *dstImage); - + const GLfloat *srcImage, GLfloat *dstImage) +{ + ASSERT_NO_FEATURE(); +} -extern void +static INLINE void _mesa_convolve_2d_image(const GLcontext *ctx, GLsizei *width, GLsizei *height, - const GLfloat *srcImage, GLfloat *dstImage); + const GLfloat *srcImage, GLfloat *dstImage) +{ + ASSERT_NO_FEATURE(); +} -extern void +static INLINE void _mesa_convolve_sep_image(const GLcontext *ctx, GLsizei *width, GLsizei *height, - const GLfloat *srcImage, GLfloat *dstImage); - + const GLfloat *srcImage, GLfloat *dstImage) +{ + ASSERT_NO_FEATURE(); +} -extern void +static INLINE void _mesa_adjust_image_for_convolution(const GLcontext *ctx, GLuint dimensions, - GLsizei *width, GLsizei *height); + GLsizei *width, GLsizei *height) +{ +} + +static INLINE void +_mesa_init_convolve_dispatch(struct _glapi_table *disp) +{ +} -#else -#define _mesa_adjust_image_for_convolution(c, d, w, h) ((void)0) -#define _mesa_convolve_1d_image(c,w,s,d) ((void)0) -#define _mesa_convolve_2d_image(c,w,h,s,d) ((void)0) -#define _mesa_convolve_sep_image(c,w,h,s,d) ((void)0) -#endif +#endif /* FEATURE_convolve */ -#endif +#endif /* CONVOLVE_H */ diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index 9c25de4187..6354ed7474 100644 --- a/src/mesa/main/dlist.c +++ b/src/mesa/main/dlist.c @@ -73,6 +73,7 @@ #include "texstate.h" #include "mtypes.h" #include "varray.h" +#include "vtxfmt.h" #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program #include "shader/arbprogram.h" #include "shader/program.h" @@ -438,6 +439,10 @@ typedef union gl_dlist_node Node; */ static GLuint InstSize[OPCODE_END_OF_LIST + 1]; + +#if FEATURE_dlist + + void mesa_print_display_list(GLuint list); @@ -1047,8 +1052,8 @@ static void invalidate_saved_current_state( GLcontext *ctx ) ctx->Driver.CurrentSavePrimitive = PRIM_UNKNOWN; } -void GLAPIENTRY -_mesa_save_CallList(GLuint list) +static void GLAPIENTRY +save_CallList(GLuint list) { GET_CURRENT_CONTEXT(ctx); Node *n; @@ -1070,8 +1075,8 @@ _mesa_save_CallList(GLuint list) } -void GLAPIENTRY -_mesa_save_CallLists(GLsizei num, GLenum type, const GLvoid * lists) +static void GLAPIENTRY +save_CallLists(GLsizei num, GLenum type, const GLvoid * lists) { GET_CURRENT_CONTEXT(ctx); GLint i; @@ -1876,7 +1881,7 @@ save_Enable(GLenum cap) static void GLAPIENTRY -_mesa_save_EvalMesh1(GLenum mode, GLint i1, GLint i2) +save_EvalMesh1(GLenum mode, GLint i1, GLint i2) { GET_CURRENT_CONTEXT(ctx); Node *n; @@ -1894,7 +1899,7 @@ _mesa_save_EvalMesh1(GLenum mode, GLint i1, GLint i2) static void GLAPIENTRY -_mesa_save_EvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2) +save_EvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2) { GET_CURRENT_CONTEXT(ctx); Node *n; @@ -4856,7 +4861,7 @@ save_ProgramStringARB(GLenum target, GLenum format, GLsizei len, #endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program */ -#if FEATURE_ARB_occlusion_query +#if FEATURE_queryobj static void GLAPIENTRY save_BeginQueryARB(GLenum target, GLuint id) @@ -4890,7 +4895,7 @@ save_EndQueryARB(GLenum target) } } -#endif /* FEATURE_ARB_occlusion_query */ +#endif /* FEATURE_queryobj */ static void GLAPIENTRY @@ -7155,7 +7160,7 @@ execute_list(GLcontext *ctx, GLuint list) n[6].f)); break; #endif -#if FEATURE_ARB_occlusion_query +#if FEATURE_queryobj case OPCODE_BEGIN_QUERY_ARB: CALL_BeginQueryARB(ctx->Exec, (n[1].e, n[2].ui)); break; @@ -7426,7 +7431,7 @@ execute_list(GLcontext *ctx, GLuint list) /** * Test if a display list number is valid. */ -GLboolean GLAPIENTRY +static GLboolean GLAPIENTRY _mesa_IsList(GLuint list) { GET_CURRENT_CONTEXT(ctx); @@ -7439,7 +7444,7 @@ _mesa_IsList(GLuint list) /** * Delete a sequence of consecutive display lists. */ -void GLAPIENTRY +static void GLAPIENTRY _mesa_DeleteLists(GLuint list, GLsizei range) { GET_CURRENT_CONTEXT(ctx); @@ -7461,7 +7466,7 @@ _mesa_DeleteLists(GLuint list, GLsizei range) * Return a display list number, n, such that lists n through n+range-1 * are free. */ -GLuint GLAPIENTRY +static GLuint GLAPIENTRY _mesa_GenLists(GLsizei range) { GET_CURRENT_CONTEXT(ctx); @@ -7501,7 +7506,7 @@ _mesa_GenLists(GLsizei range) /** * Begin a new display list. */ -void GLAPIENTRY +static void GLAPIENTRY _mesa_NewList(GLuint name, GLenum mode) { GET_CURRENT_CONTEXT(ctx); @@ -7551,7 +7556,7 @@ _mesa_NewList(GLuint name, GLenum mode) /** * End definition of current display list. */ -void GLAPIENTRY +static void GLAPIENTRY _mesa_EndList(void) { GET_CURRENT_CONTEXT(ctx); @@ -7685,7 +7690,7 @@ _mesa_CallLists(GLsizei n, GLenum type, const GLvoid * lists) /** * Set the offset added to list numbers in glCallLists. */ -void GLAPIENTRY +static void GLAPIENTRY _mesa_ListBase(GLuint base) { GET_CURRENT_CONTEXT(ctx); @@ -8420,7 +8425,7 @@ exec_MultiModeDrawElementsIBM(const GLenum * mode, * struct. */ void -_mesa_init_dlist_table(struct _glapi_table *table) +_mesa_init_save_table(struct _glapi_table *table) { _mesa_loopback_init_api_table(table); @@ -8429,8 +8434,8 @@ _mesa_init_dlist_table(struct _glapi_table *table) SET_AlphaFunc(table, save_AlphaFunc); SET_Bitmap(table, save_Bitmap); SET_BlendFunc(table, save_BlendFunc); - SET_CallList(table, _mesa_save_CallList); - SET_CallLists(table, _mesa_save_CallLists); + SET_CallList(table, save_CallList); + SET_CallLists(table, save_CallLists); SET_Clear(table, save_Clear); SET_ClearAccum(table, save_ClearAccum); SET_ClearColor(table, save_ClearColor); @@ -8451,8 +8456,8 @@ _mesa_init_dlist_table(struct _glapi_table *table) SET_DrawPixels(table, save_DrawPixels); SET_Enable(table, save_Enable); SET_EndList(table, _mesa_EndList); - SET_EvalMesh1(table, _mesa_save_EvalMesh1); - SET_EvalMesh2(table, _mesa_save_EvalMesh2); + SET_EvalMesh1(table, save_EvalMesh1); + SET_EvalMesh2(table, save_EvalMesh2); SET_Finish(table, exec_Finish); SET_Flush(table, exec_Flush); SET_Fogf(table, save_Fogf); @@ -8924,7 +8929,7 @@ _mesa_init_dlist_table(struct _glapi_table *table) SET_UnmapBufferARB(table, _mesa_UnmapBufferARB); #endif -#if FEATURE_ARB_occlusion_query +#if FEATURE_queryobj SET_BeginQueryARB(table, save_BeginQueryARB); SET_EndQueryARB(table, save_EndQueryARB); SET_GenQueriesARB(table, _mesa_GenQueriesARB); @@ -9291,22 +9296,21 @@ mesa_print_display_list(GLuint list) void _mesa_save_vtxfmt_init(GLvertexformat * vfmt) { - vfmt->ArrayElement = _ae_loopback_array_elt; /* generic helper */ + _MESA_INIT_ARRAYELT_VTXFMT(vfmt, _ae_); + vfmt->Begin = save_Begin; - vfmt->CallList = _mesa_save_CallList; - vfmt->CallLists = _mesa_save_CallLists; + + _MESA_INIT_DLIST_VTXFMT(vfmt, save_); + vfmt->Color3f = save_Color3f; vfmt->Color3fv = save_Color3fv; vfmt->Color4f = save_Color4f; vfmt->Color4fv = save_Color4fv; vfmt->EdgeFlag = save_EdgeFlag; vfmt->End = save_End; - vfmt->EvalCoord1f = save_EvalCoord1f; - vfmt->EvalCoord1fv = save_EvalCoord1fv; - vfmt->EvalCoord2f = save_EvalCoord2f; - vfmt->EvalCoord2fv = save_EvalCoord2fv; - vfmt->EvalPoint1 = save_EvalPoint1; - vfmt->EvalPoint2 = save_EvalPoint2; + + _MESA_INIT_EVAL_VTXFMT(vfmt, save_); + vfmt->FogCoordfEXT = save_FogCoordfEXT; vfmt->FogCoordfvEXT = save_FogCoordfvEXT; vfmt->Indexf = save_Indexf; @@ -9355,8 +9359,6 @@ _mesa_save_vtxfmt_init(GLvertexformat * vfmt) vfmt->VertexAttrib4fARB = save_VertexAttrib4fARB; vfmt->VertexAttrib4fvARB = save_VertexAttrib4fvARB; - vfmt->EvalMesh1 = _mesa_save_EvalMesh1; - vfmt->EvalMesh2 = _mesa_save_EvalMesh2; vfmt->Rectf = save_Rectf; /* The driver is required to implement these as @@ -9377,6 +9379,32 @@ _mesa_save_vtxfmt_init(GLvertexformat * vfmt) } +void +_mesa_install_dlist_vtxfmt(struct _glapi_table *disp, + const GLvertexformat *vfmt) +{ + SET_CallList(disp, vfmt->CallList); + SET_CallLists(disp, vfmt->CallLists); +} + + +void _mesa_init_dlist_dispatch(struct _glapi_table *disp) +{ + SET_CallList(disp, _mesa_CallList); + SET_CallLists(disp, _mesa_CallLists); + + SET_DeleteLists(disp, _mesa_DeleteLists); + SET_EndList(disp, _mesa_EndList); + SET_GenLists(disp, _mesa_GenLists); + SET_IsList(disp, _mesa_IsList); + SET_ListBase(disp, _mesa_ListBase); + SET_NewList(disp, _mesa_NewList); +} + + +#endif /* FEATURE_dlist */ + + /** * Initialize display list state for given context. */ @@ -9401,5 +9429,7 @@ _mesa_init_display_list(GLcontext *ctx) /* Display List group */ ctx->List.ListBase = 0; +#if FEATURE_dlist _mesa_save_vtxfmt_init(&ctx->ListState.ListVtxfmt); +#endif } diff --git a/src/mesa/main/dlist.h b/src/mesa/main/dlist.h index ab7ec2c8db..af36991d5e 100644 --- a/src/mesa/main/dlist.h +++ b/src/mesa/main/dlist.h @@ -33,41 +33,34 @@ #define DLIST_H -#include "mtypes.h" +#include "main/mtypes.h" -#if _HAVE_FULL_GL +#if FEATURE_dlist -extern void -_mesa_delete_list(GLcontext *ctx, struct gl_display_list *dlist); +#define _MESA_INIT_DLIST_FUNCTIONS(driver, impl) \ + do { \ + (driver)->NewList = impl ## NewList; \ + (driver)->EndList = impl ## EndList; \ + (driver)->BeginCallList = impl ## BeginCallList; \ + (driver)->EndCallList = impl ## EndCallList; \ + (driver)->SaveFlushVertices = impl ## SaveFlushVertices; \ + (driver)->NotifySaveBegin = impl ## NotifyBegin; \ + } while (0) + +#define _MESA_INIT_DLIST_VTXFMT(vfmt, impl) \ + do { \ + (vfmt)->CallList = impl ## CallList; \ + (vfmt)->CallLists = impl ## CallLists; \ + } while (0) extern void GLAPIENTRY _mesa_CallList( GLuint list ); extern void GLAPIENTRY _mesa_CallLists( GLsizei n, GLenum type, const GLvoid *lists ); -extern void GLAPIENTRY _mesa_DeleteLists( GLuint list, GLsizei range ); - -extern void GLAPIENTRY _mesa_EndList( void ); - -extern GLuint GLAPIENTRY _mesa_GenLists( GLsizei range ); - -extern GLboolean GLAPIENTRY _mesa_IsList( GLuint list ); - -extern void GLAPIENTRY _mesa_ListBase( GLuint base ); - -extern void GLAPIENTRY _mesa_NewList( GLuint list, GLenum mode ); - -extern void GLAPIENTRY _mesa_save_CallLists( GLsizei n, GLenum type, const GLvoid *lists ); - -extern void GLAPIENTRY _mesa_save_CallList( GLuint list ); - - - -extern void _mesa_init_dlist_table( struct _glapi_table *table ); extern void _mesa_compile_error( GLcontext *ctx, GLenum error, const char *s ); - extern void *_mesa_alloc_instruction(GLcontext *ctx, GLuint opcode, GLuint sz); extern GLint _mesa_alloc_opcode( GLcontext *ctx, GLuint sz, @@ -75,22 +68,43 @@ extern GLint _mesa_alloc_opcode( GLcontext *ctx, GLuint sz, void (*destroy)( GLcontext *, void * ), void (*print)( GLcontext *, void * ) ); -extern void _mesa_init_display_list( GLcontext * ctx ); +extern void _mesa_delete_list(GLcontext *ctx, struct gl_display_list *dlist); extern void _mesa_save_vtxfmt_init( GLvertexformat *vfmt ); +extern void _mesa_init_save_table( struct _glapi_table *table ); + +extern void _mesa_install_dlist_vtxfmt(struct _glapi_table *disp, + const GLvertexformat *vfmt); + +extern void _mesa_init_dlist_dispatch(struct _glapi_table *disp); -#else +#else /* FEATURE_dlist */ -/** No-op */ -#define _mesa_init_dlist_table(t,ts) ((void)0) +#define _MESA_INIT_DLIST_FUNCTIONS(driver, impl) do { } while (0) +#define _MESA_INIT_DLIST_VTXFMT(vfmt, impl) do { } while (0) -/** No-op */ -#define _mesa_init_display_list(c) ((void)0) +static INLINE void +_mesa_delete_list(GLcontext *ctx, struct gl_display_list *dlist) +{ + /* there should be no list to delete */ + ASSERT_NO_FEATURE(); +} -/** No-op */ -#define _mesa_save_vtxfmt_init(v) ((void)0) +static INLINE void +_mesa_install_dlist_vtxfmt(struct _glapi_table *disp, + const GLvertexformat *vfmt) +{ +} + +static INLINE void +_mesa_init_dlist_dispatch(struct _glapi_table *disp) +{ +} + +#endif /* FEATURE_dlist */ + +extern void _mesa_init_display_list( GLcontext * ctx ); -#endif -#endif +#endif /* DLIST_H */ diff --git a/src/mesa/main/drawpix.c b/src/mesa/main/drawpix.c index aef6585641..5d4b53af4c 100644 --- a/src/mesa/main/drawpix.c +++ b/src/mesa/main/drawpix.c @@ -33,8 +33,11 @@ #include "image.h" #include "readpix.h" #include "state.h" +#include "glapi/dispatch.h" +#if FEATURE_drawpix + /** * If a fragment program is enabled, check that it's valid. @@ -47,12 +50,10 @@ valid_fragment_program(GLcontext *ctx) } -#if _HAVE_FULL_GL - /* * Execute glDrawPixels */ -void GLAPIENTRY +static void GLAPIENTRY _mesa_DrawPixels( GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels ) { @@ -140,7 +141,7 @@ end: } -void GLAPIENTRY +static void GLAPIENTRY _mesa_CopyPixels( GLint srcx, GLint srcy, GLsizei width, GLsizei height, GLenum type ) { @@ -225,11 +226,8 @@ end: _mesa_set_vp_override(ctx, GL_FALSE); } -#endif /* _HAVE_FULL_GL */ - - -void GLAPIENTRY +static void GLAPIENTRY _mesa_Bitmap( GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap ) @@ -309,3 +307,15 @@ _mesa_Bitmap( GLsizei width, GLsizei height, ctx->Current.RasterPos[0] += xmove; ctx->Current.RasterPos[1] += ymove; } + + +void +_mesa_init_drawpix_dispatch(struct _glapi_table *disp) +{ + SET_Bitmap(disp, _mesa_Bitmap); + SET_CopyPixels(disp, _mesa_CopyPixels); + SET_DrawPixels(disp, _mesa_DrawPixels); +} + + +#endif /* FEATURE_drawpix */ diff --git a/src/mesa/main/drawpix.h b/src/mesa/main/drawpix.h index 6177adad6d..8ffb1a6d88 100644 --- a/src/mesa/main/drawpix.h +++ b/src/mesa/main/drawpix.h @@ -22,28 +22,35 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +#ifndef DRAWPIX_H +#define DRAWPIX_H -#ifndef DRAWPIXELS_H -#define DRAWPIXELS_H +#include "main/mtypes.h" -#include "main/glheader.h" +#if FEATURE_drawpix -extern void GLAPIENTRY -_mesa_DrawPixels( GLsizei width, GLsizei height, - GLenum format, GLenum type, const GLvoid *pixels ); +#define _MESA_INIT_DRAWPIX_FUNCTIONS(driver, impl) \ + do { \ + (driver)->DrawPixels = impl ## DrawPixels; \ + (driver)->CopyPixels = impl ## CopyPixels; \ + (driver)->Bitmap = impl ## Bitmap; \ + } while (0) +extern void +_mesa_init_drawpix_dispatch(struct _glapi_table *disp); -extern void GLAPIENTRY -_mesa_CopyPixels( GLint srcx, GLint srcy, GLsizei width, GLsizei height, - GLenum type ); +#else /* FEATURE_drawpix */ +#define _MESA_INIT_DRAWPIX_FUNCTIONS(driver, impl) do { } while (0) -extern void GLAPIENTRY -_mesa_Bitmap( GLsizei width, GLsizei height, - GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, - const GLubyte *bitmap ); +static INLINE void +_mesa_init_drawpix_dispatch(struct _glapi_table *disp) +{ +} +#endif /* FEATURE_drawpix */ -#endif + +#endif /* DRAWPIX_H */ diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c index 4c1f46102d..4383aed669 100644 --- a/src/mesa/main/enable.c +++ b/src/mesa/main/enable.c @@ -37,6 +37,7 @@ #include "mtypes.h" #include "enums.h" #include "api_arrayelt.h" +#include "texstate.h" @@ -228,12 +229,11 @@ get_texcoord_unit(GLcontext *ctx) static GLboolean enable_texture(GLcontext *ctx, GLboolean state, GLbitfield texBit) { - const GLuint curr = ctx->Texture.CurrentUnit; - struct gl_texture_unit *texUnit = &ctx->Texture.Unit[curr]; + struct gl_texture_unit *texUnit = _mesa_get_current_tex_unit(ctx); const GLbitfield newenabled = state ? (texUnit->Enabled | texBit) : (texUnit->Enabled & ~texBit); - if (!ctx->DrawBuffer->Visual.rgbMode || texUnit->Enabled == newenabled) + if (texUnit->Enabled == newenabled) return GL_FALSE; FLUSH_VERTICES(ctx, _NEW_TEXTURE); @@ -935,11 +935,6 @@ _mesa_set_enable(GLcontext *ctx, GLenum cap, GLboolean state) /* GL_EXT_depth_bounds_test */ case GL_DEPTH_BOUNDS_TEST_EXT: CHECK_EXTENSION(EXT_depth_bounds_test, cap); - if (state && ctx->DrawBuffer->Visual.depthBits == 0) { - _mesa_warning(ctx, - "glEnable(GL_DEPTH_BOUNDS_TEST_EXT) but no depth buffer"); - return; - } if (ctx->Depth.BoundsTest == state) return; FLUSH_VERTICES(ctx, _NEW_DEPTH); diff --git a/src/mesa/main/eval.c b/src/mesa/main/eval.c index 3f89f9c1ea..95d6e23187 100644 --- a/src/mesa/main/eval.c +++ b/src/mesa/main/eval.c @@ -44,6 +44,10 @@ #include "eval.h" #include "macros.h" #include "mtypes.h" +#include "glapi/dispatch.h" + + +#if FEATURE_evaluators /* @@ -417,7 +421,7 @@ map1(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, -void GLAPIENTRY +static void GLAPIENTRY _mesa_Map1f( GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points ) { @@ -425,7 +429,7 @@ _mesa_Map1f( GLenum target, GLfloat u1, GLfloat u2, GLint stride, } -void GLAPIENTRY +static void GLAPIENTRY _mesa_Map1d( GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points ) { @@ -516,7 +520,7 @@ map2( GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, } -void GLAPIENTRY +static void GLAPIENTRY _mesa_Map2f( GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, @@ -527,7 +531,7 @@ _mesa_Map2f( GLenum target, } -void GLAPIENTRY +static void GLAPIENTRY _mesa_Map2d( GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, @@ -539,7 +543,7 @@ _mesa_Map2d( GLenum target, -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetMapdv( GLenum target, GLenum query, GLdouble *v ) { GET_CURRENT_CONTEXT(ctx); @@ -604,7 +608,7 @@ _mesa_GetMapdv( GLenum target, GLenum query, GLdouble *v ) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetMapfv( GLenum target, GLenum query, GLfloat *v ) { GET_CURRENT_CONTEXT(ctx); @@ -669,7 +673,7 @@ _mesa_GetMapfv( GLenum target, GLenum query, GLfloat *v ) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetMapiv( GLenum target, GLenum query, GLint *v ) { GET_CURRENT_CONTEXT(ctx); @@ -735,7 +739,7 @@ _mesa_GetMapiv( GLenum target, GLenum query, GLint *v ) -void GLAPIENTRY +static void GLAPIENTRY _mesa_MapGrid1f( GLint un, GLfloat u1, GLfloat u2 ) { GET_CURRENT_CONTEXT(ctx); @@ -753,14 +757,14 @@ _mesa_MapGrid1f( GLint un, GLfloat u1, GLfloat u2 ) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_MapGrid1d( GLint un, GLdouble u1, GLdouble u2 ) { _mesa_MapGrid1f( un, (GLfloat) u1, (GLfloat) u2 ); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_MapGrid2f( GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2 ) { @@ -788,7 +792,7 @@ _mesa_MapGrid2f( GLint un, GLfloat u1, GLfloat u2, } -void GLAPIENTRY +static void GLAPIENTRY _mesa_MapGrid2d( GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2 ) { @@ -797,6 +801,41 @@ _mesa_MapGrid2d( GLint un, GLdouble u1, GLdouble u2, } +void +_mesa_install_eval_vtxfmt(struct _glapi_table *disp, + const GLvertexformat *vfmt) +{ + SET_EvalCoord1f(disp, vfmt->EvalCoord1f); + SET_EvalCoord1fv(disp, vfmt->EvalCoord1fv); + SET_EvalCoord2f(disp, vfmt->EvalCoord2f); + SET_EvalCoord2fv(disp, vfmt->EvalCoord2fv); + SET_EvalPoint1(disp, vfmt->EvalPoint1); + SET_EvalPoint2(disp, vfmt->EvalPoint2); + + SET_EvalMesh1(disp, vfmt->EvalMesh1); + SET_EvalMesh2(disp, vfmt->EvalMesh2); +} + + +void +_mesa_init_eval_dispatch(struct _glapi_table *disp) +{ + SET_GetMapdv(disp, _mesa_GetMapdv); + SET_GetMapfv(disp, _mesa_GetMapfv); + SET_GetMapiv(disp, _mesa_GetMapiv); + SET_Map1d(disp, _mesa_Map1d); + SET_Map1f(disp, _mesa_Map1f); + SET_Map2d(disp, _mesa_Map2d); + SET_Map2f(disp, _mesa_Map2f); + SET_MapGrid1d(disp, _mesa_MapGrid1d); + SET_MapGrid1f(disp, _mesa_MapGrid1f); + SET_MapGrid2d(disp, _mesa_MapGrid2d); + SET_MapGrid2f(disp, _mesa_MapGrid2f); +} + + +#endif /* FEATURE_evaluators */ + /**********************************************************************/ /***** Initialization *****/ diff --git a/src/mesa/main/eval.h b/src/mesa/main/eval.h index b3ff0a96f8..ffd1bab76d 100644 --- a/src/mesa/main/eval.h +++ b/src/mesa/main/eval.h @@ -37,13 +37,22 @@ #define EVAL_H -#include "mtypes.h" +#include "main/mtypes.h" -#if _HAVE_FULL_GL -extern void _mesa_init_eval( GLcontext *ctx ); -extern void _mesa_free_eval_data( GLcontext *ctx ); +#if FEATURE_evaluators +#define _MESA_INIT_EVAL_VTXFMT(vfmt, impl) \ + do { \ + (vfmt)->EvalCoord1f = impl ## EvalCoord1f; \ + (vfmt)->EvalCoord1fv = impl ## EvalCoord1fv; \ + (vfmt)->EvalCoord2f = impl ## EvalCoord2f; \ + (vfmt)->EvalCoord2fv = impl ## EvalCoord2fv; \ + (vfmt)->EvalPoint1 = impl ## EvalPoint1; \ + (vfmt)->EvalPoint2 = impl ## EvalPoint2; \ + (vfmt)->EvalMesh1 = impl ## EvalMesh1; \ + (vfmt)->EvalMesh2 = impl ## EvalMesh2; \ + } while (0) extern GLuint _mesa_evaluator_components( GLenum target ); @@ -70,59 +79,32 @@ extern GLfloat *_mesa_copy_map_points2d(GLenum target, GLint vstride, GLint vorder, const GLdouble *points ); +extern void +_mesa_install_eval_vtxfmt(struct _glapi_table *disp, + const GLvertexformat *vfmt); +extern void +_mesa_init_eval_dispatch(struct _glapi_table *disp); -extern void GLAPIENTRY -_mesa_Map1f( GLenum target, GLfloat u1, GLfloat u2, GLint stride, - GLint order, const GLfloat *points ); - -extern void GLAPIENTRY -_mesa_Map2f( GLenum target, - GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, - GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, - const GLfloat *points ); - -extern void GLAPIENTRY -_mesa_Map1d( GLenum target, GLdouble u1, GLdouble u2, GLint stride, - GLint order, const GLdouble *points ); - -extern void GLAPIENTRY -_mesa_Map2d( GLenum target, - GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, - GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, - const GLdouble *points ); - -extern void GLAPIENTRY -_mesa_MapGrid1f( GLint un, GLfloat u1, GLfloat u2 ); +#else /* FEATURE_evaluators */ -extern void GLAPIENTRY -_mesa_MapGrid1d( GLint un, GLdouble u1, GLdouble u2 ); +#define _MESA_INIT_EVAL_VTXFMT(vfmt, impl) do { } while (0) -extern void GLAPIENTRY -_mesa_MapGrid2f( GLint un, GLfloat u1, GLfloat u2, - GLint vn, GLfloat v1, GLfloat v2 ); +static INLINE void +_mesa_install_eval_vtxfmt(struct _glapi_table *disp, + const GLvertexformat *vfmt) +{ +} -extern void GLAPIENTRY -_mesa_MapGrid2d( GLint un, GLdouble u1, GLdouble u2, - GLint vn, GLdouble v1, GLdouble v2 ); +static INLINE void +_mesa_init_eval_dispatch(struct _glapi_table *disp) +{ +} -extern void GLAPIENTRY -_mesa_GetMapdv( GLenum target, GLenum query, GLdouble *v ); +#endif /* FEATURE_evaluators */ -extern void GLAPIENTRY -_mesa_GetMapfv( GLenum target, GLenum query, GLfloat *v ); - -extern void GLAPIENTRY -_mesa_GetMapiv( GLenum target, GLenum query, GLint *v ); - -#else - -/** No-op */ -#define _mesa_init_eval( c ) ((void)0) - -/** No-op */ -#define _mesa_free_eval_data( c ) ((void)0) +extern void _mesa_init_eval( GLcontext *ctx ); +extern void _mesa_free_eval_data( GLcontext *ctx ); -#endif -#endif +#endif /* EVAL_H */ diff --git a/src/mesa/main/execmem.c b/src/mesa/main/execmem.c index 57c1e117c8..4c6139985f 100644 --- a/src/mesa/main/execmem.c +++ b/src/mesa/main/execmem.c @@ -80,11 +80,10 @@ init_heap(void) exec_heap = mmInit( 0, EXEC_HEAP_SIZE ); if (!exec_mem) - exec_mem = (unsigned char *) mmap(0, EXEC_HEAP_SIZE, - PROT_EXEC | PROT_READ | PROT_WRITE, - MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); + exec_mem = mmap(NULL, EXEC_HEAP_SIZE, PROT_EXEC | PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); - return (exec_mem != NULL); + return (exec_mem != MAP_FAILED); } diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 6b11aceb5c..54cf37c5f4 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -167,6 +167,7 @@ static const struct { { OFF, "GL_NV_blend_square", F(NV_blend_square) }, { OFF, "GL_NV_depth_clamp", F(ARB_depth_clamp) }, { OFF, "GL_NV_fragment_program", F(NV_fragment_program) }, + { OFF, "GL_NV_fragment_program_option", F(NV_fragment_program_option) }, { ON, "GL_NV_light_max_exponent", F(NV_light_max_exponent) }, { OFF, "GL_NV_point_sprite", F(NV_point_sprite) }, { OFF, "GL_NV_texture_env_combine4", F(NV_texture_env_combine4) }, @@ -214,7 +215,7 @@ _mesa_enable_sw_extensions(GLcontext *ctx) ctx->Extensions.ARB_imaging = GL_TRUE; ctx->Extensions.ARB_map_buffer_range = GL_TRUE; ctx->Extensions.ARB_multitexture = GL_TRUE; -#if FEATURE_ARB_occlusion_query +#if FEATURE_queryobj ctx->Extensions.ARB_occlusion_query = GL_TRUE; #endif ctx->Extensions.ARB_point_sprite = GL_TRUE; @@ -315,6 +316,9 @@ _mesa_enable_sw_extensions(GLcontext *ctx) #if FEATURE_NV_fragment_program ctx->Extensions.NV_fragment_program = GL_TRUE; #endif +#if FEATURE_NV_fragment_program && FEATURE_ARB_fragment_program + ctx->Extensions.NV_fragment_program_option = GL_TRUE; +#endif ctx->Extensions.SGI_color_matrix = GL_TRUE; ctx->Extensions.SGI_color_table = GL_TRUE; ctx->Extensions.SGI_texture_color_table = GL_TRUE; diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 13f49da5a7..6e767bb24d 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -44,6 +44,7 @@ #include "teximage.h" #include "texobj.h" #include "texstore.h" +#include "texstate.h" /** Set this to 1 to help debug FBO incompleteness problems */ @@ -717,12 +718,6 @@ _mesa_BindRenderbufferEXT(GLenum target, GLuint renderbuffer) } FLUSH_CURRENT(ctx, _NEW_BUFFERS); - /* The above doesn't fully flush the drivers in the way that a - * glFlush does, but that is required here: - */ - if (ctx->Driver.Flush) - ctx->Driver.Flush(ctx); - if (renderbuffer) { newRb = _mesa_lookup_renderbuffer(ctx, renderbuffer); @@ -1212,9 +1207,6 @@ _mesa_BindFramebufferEXT(GLenum target, GLuint framebuffer) } FLUSH_CURRENT(ctx, _NEW_BUFFERS); - if (ctx->Driver.Flush) { - ctx->Driver.Flush(ctx); - } if (framebuffer) { /* Binding a user-created framebuffer object */ @@ -1293,11 +1285,6 @@ _mesa_DeleteFramebuffersEXT(GLsizei n, const GLuint *framebuffers) ASSERT_OUTSIDE_BEGIN_END(ctx); FLUSH_CURRENT(ctx, _NEW_BUFFERS); - /* The above doesn't fully flush the drivers in the way that a - * glFlush does, but that is required here: - */ - if (ctx->Driver.Flush) - ctx->Driver.Flush(ctx); for (i = 0; i < n; i++) { if (framebuffers[i] > 0) { @@ -1531,11 +1518,6 @@ framebuffer_texture(GLcontext *ctx, const char *caller, GLenum target, } FLUSH_CURRENT(ctx, _NEW_BUFFERS); - /* The above doesn't fully flush the drivers in the way that a - * glFlush does, but that is required here: - */ - if (ctx->Driver.Flush) - ctx->Driver.Flush(ctx); _glthread_LOCK_MUTEX(fb->Mutex); if (texObj) { @@ -1712,11 +1694,6 @@ _mesa_FramebufferRenderbufferEXT(GLenum target, GLenum attachment, FLUSH_CURRENT(ctx, _NEW_BUFFERS); - /* The above doesn't fully flush the drivers in the way that a - * glFlush does, but that is required here: - */ - if (ctx->Driver.Flush) - ctx->Driver.Flush(ctx); assert(ctx->Driver.FramebufferRenderbuffer); ctx->Driver.FramebufferRenderbuffer(ctx, fb, attachment, rb); @@ -1793,11 +1770,6 @@ _mesa_GetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment, } FLUSH_CURRENT(ctx, _NEW_BUFFERS); - /* The above doesn't fully flush the drivers in the way that a - * glFlush does, but that is required here: - */ - if (ctx->Driver.Flush) - ctx->Driver.Flush(ctx); switch (pname) { case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT: @@ -1955,7 +1927,7 @@ _mesa_GenerateMipmapEXT(GLenum target) return; } - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; + texUnit = _mesa_get_current_tex_unit(ctx); texObj = _mesa_select_tex_object(ctx, texUnit, target); _mesa_lock_texture(ctx, texObj); diff --git a/src/mesa/main/feedback.c b/src/mesa/main/feedback.c index 818a804540..fcdbb75fc4 100644 --- a/src/mesa/main/feedback.c +++ b/src/mesa/main/feedback.c @@ -36,9 +36,10 @@ #include "feedback.h" #include "macros.h" #include "mtypes.h" +#include "glapi/dispatch.h" -#if _HAVE_FULL_GL +#if FEATURE_feedback #define FB_3D 0x01 @@ -49,7 +50,7 @@ -void GLAPIENTRY +static void GLAPIENTRY _mesa_FeedbackBuffer( GLsizei size, GLenum type, GLfloat *buffer ) { GET_CURRENT_CONTEXT(ctx); @@ -103,7 +104,7 @@ _mesa_FeedbackBuffer( GLsizei size, GLenum type, GLfloat *buffer ) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_PassThrough( GLfloat token ) { GET_CURRENT_CONTEXT(ctx); @@ -153,9 +154,6 @@ _mesa_feedback_vertex(GLcontext *ctx, } -#endif /* _HAVE_FULL_GL */ - - /**********************************************************************/ /** \name Selection */ /*@{*/ @@ -173,7 +171,7 @@ _mesa_feedback_vertex(GLcontext *ctx, * Verifies we're not in selection mode, flushes the vertices and initialize * the fields in __GLcontextRec::Select with the given buffer. */ -void GLAPIENTRY +static void GLAPIENTRY _mesa_SelectBuffer( GLsizei size, GLuint *buffer ) { GET_CURRENT_CONTEXT(ctx); @@ -280,7 +278,7 @@ write_hit_record(GLcontext *ctx) * the hit record data in gl_selection. Marks new render mode in * __GLcontextRec::NewState. */ -void GLAPIENTRY +static void GLAPIENTRY _mesa_InitNames( void ) { GET_CURRENT_CONTEXT(ctx); @@ -311,7 +309,7 @@ _mesa_InitNames( void ) * * sa __GLcontextRec::Select. */ -void GLAPIENTRY +static void GLAPIENTRY _mesa_LoadName( GLuint name ) { GET_CURRENT_CONTEXT(ctx); @@ -350,7 +348,7 @@ _mesa_LoadName( GLuint name ) * * sa __GLcontextRec::Select. */ -void GLAPIENTRY +static void GLAPIENTRY _mesa_PushName( GLuint name ) { GET_CURRENT_CONTEXT(ctx); @@ -381,7 +379,7 @@ _mesa_PushName( GLuint name ) * * sa __GLcontextRec::Select. */ -void GLAPIENTRY +static void GLAPIENTRY _mesa_PopName( void ) { GET_CURRENT_CONTEXT(ctx); @@ -424,7 +422,7 @@ _mesa_PopName( void ) * __GLcontextRec::RenderMode and notifies the driver via the * dd_function_table::RenderMode callback. */ -GLint GLAPIENTRY +static GLint GLAPIENTRY _mesa_RenderMode( GLenum mode ) { GET_CURRENT_CONTEXT(ctx); @@ -507,6 +505,23 @@ _mesa_RenderMode( GLenum mode ) /*@}*/ +void +_mesa_init_feedback_dispatch(struct _glapi_table *disp) +{ + SET_InitNames(disp, _mesa_InitNames); + SET_FeedbackBuffer(disp, _mesa_FeedbackBuffer); + SET_LoadName(disp, _mesa_LoadName); + SET_PassThrough(disp, _mesa_PassThrough); + SET_PopName(disp, _mesa_PopName); + SET_PushName(disp, _mesa_PushName); + SET_SelectBuffer(disp, _mesa_SelectBuffer); + SET_RenderMode(disp, _mesa_RenderMode); +} + + +#endif /* FEATURE_feedback */ + + /**********************************************************************/ /** \name Initialization */ /*@{*/ diff --git a/src/mesa/main/feedback.h b/src/mesa/main/feedback.h index 72c2acd5ed..7a648f444f 100644 --- a/src/mesa/main/feedback.h +++ b/src/mesa/main/feedback.h @@ -27,11 +27,15 @@ #define FEEDBACK_H -#include "mtypes.h" +#include "main/mtypes.h" -extern void -_mesa_init_feedback( GLcontext *ctx ); +#if FEATURE_feedback + +#define _MESA_INIT_FEEDBACK_FUNCTIONS(driver, impl) \ + do { \ + (driver)->RenderMode = impl ## RenderMode; \ + } while (0) extern void _mesa_feedback_vertex( GLcontext *ctx, @@ -55,29 +59,47 @@ extern void _mesa_update_hitflag( GLcontext *ctx, GLfloat z ); -extern void GLAPIENTRY -_mesa_PassThrough( GLfloat token ); +extern void +_mesa_init_feedback_dispatch(struct _glapi_table *disp); + +#else /* FEATURE_feedback */ -extern void GLAPIENTRY -_mesa_FeedbackBuffer( GLsizei size, GLenum type, GLfloat *buffer ); +#define _MESA_INIT_FEEDBACK_FUNCTIONS(driver, impl) do { } while (0) -extern void GLAPIENTRY -_mesa_SelectBuffer( GLsizei size, GLuint *buffer ); +static INLINE void +_mesa_feedback_vertex( GLcontext *ctx, + const GLfloat win[4], + const GLfloat color[4], + GLfloat index, + const GLfloat texcoord[4] ) +{ + /* render mode is always GL_RENDER */ + ASSERT_NO_FEATURE(); +} -extern void GLAPIENTRY -_mesa_InitNames( void ); -extern void GLAPIENTRY -_mesa_LoadName( GLuint name ); +static INLINE void +_mesa_feedback_token( GLcontext *ctx, GLfloat token ) +{ + /* render mode is always GL_RENDER */ + ASSERT_NO_FEATURE(); +} -extern void GLAPIENTRY -_mesa_PushName( GLuint name ); +static INLINE void +_mesa_update_hitflag( GLcontext *ctx, GLfloat z ) +{ + /* render mode is always GL_RENDER */ + ASSERT_NO_FEATURE(); +} -extern void GLAPIENTRY -_mesa_PopName( void ); +static INLINE void +_mesa_init_feedback_dispatch(struct _glapi_table *disp) +{ +} -extern GLint GLAPIENTRY -_mesa_RenderMode( GLenum mode ); +#endif /* FEATURE_feedback */ +extern void +_mesa_init_feedback( GLcontext *ctx ); -#endif +#endif /* FEEDBACK_H */ diff --git a/src/mesa/main/histogram.c b/src/mesa/main/histogram.c index ceb0d5a6a8..87816d3132 100644 --- a/src/mesa/main/histogram.c +++ b/src/mesa/main/histogram.c @@ -29,8 +29,11 @@ #include "context.h" #include "image.h" #include "histogram.h" +#include "glapi/dispatch.h" +#if FEATURE_histogram + /* * XXX the packed pixel formats haven't been tested. @@ -614,7 +617,11 @@ base_histogram_format( GLenum format ) */ -void GLAPIENTRY +/* this is defined below */ +static void GLAPIENTRY _mesa_ResetMinmax(GLenum target); + + +static void GLAPIENTRY _mesa_GetMinmax(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values) { GET_CURRENT_CONTEXT(ctx); @@ -677,7 +684,7 @@ _mesa_GetMinmax(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvo } -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetHistogram(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values) { GET_CURRENT_CONTEXT(ctx); @@ -737,7 +744,7 @@ _mesa_GetHistogram(GLenum target, GLboolean reset, GLenum format, GLenum type, G } -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetHistogramParameterfv(GLenum target, GLenum pname, GLfloat *params) { GET_CURRENT_CONTEXT(ctx); @@ -784,7 +791,7 @@ _mesa_GetHistogramParameterfv(GLenum target, GLenum pname, GLfloat *params) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetHistogramParameteriv(GLenum target, GLenum pname, GLint *params) { GET_CURRENT_CONTEXT(ctx); @@ -831,7 +838,7 @@ _mesa_GetHistogramParameteriv(GLenum target, GLenum pname, GLint *params) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetMinmaxParameterfv(GLenum target, GLenum pname, GLfloat *params) { GET_CURRENT_CONTEXT(ctx); @@ -857,7 +864,7 @@ _mesa_GetMinmaxParameterfv(GLenum target, GLenum pname, GLfloat *params) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetMinmaxParameteriv(GLenum target, GLenum pname, GLint *params) { GET_CURRENT_CONTEXT(ctx); @@ -883,7 +890,7 @@ _mesa_GetMinmaxParameteriv(GLenum target, GLenum pname, GLint *params) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_Histogram(GLenum target, GLsizei width, GLenum internalFormat, GLboolean sink) { GLuint i; @@ -966,7 +973,7 @@ _mesa_Histogram(GLenum target, GLsizei width, GLenum internalFormat, GLboolean s } -void GLAPIENTRY +static void GLAPIENTRY _mesa_Minmax(GLenum target, GLenum internalFormat, GLboolean sink) { GET_CURRENT_CONTEXT(ctx); @@ -994,7 +1001,7 @@ _mesa_Minmax(GLenum target, GLenum internalFormat, GLboolean sink) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_ResetHistogram(GLenum target) { GLuint i; @@ -1020,7 +1027,7 @@ _mesa_ResetHistogram(GLenum target) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_ResetMinmax(GLenum target) { GET_CURRENT_CONTEXT(ctx); @@ -1043,6 +1050,24 @@ _mesa_ResetMinmax(GLenum target) } +void +_mesa_init_histogram_dispatch(struct _glapi_table *disp) +{ + SET_GetHistogram(disp, _mesa_GetHistogram); + SET_GetHistogramParameterfv(disp, _mesa_GetHistogramParameterfv); + SET_GetHistogramParameteriv(disp, _mesa_GetHistogramParameteriv); + SET_GetMinmax(disp, _mesa_GetMinmax); + SET_GetMinmaxParameterfv(disp, _mesa_GetMinmaxParameterfv); + SET_GetMinmaxParameteriv(disp, _mesa_GetMinmaxParameteriv); + SET_Histogram(disp, _mesa_Histogram); + SET_Minmax(disp, _mesa_Minmax); + SET_ResetHistogram(disp, _mesa_ResetHistogram); + SET_ResetMinmax(disp, _mesa_ResetMinmax); +} + + +#endif /* FEATURE_histogram */ + /**********************************************************************/ /***** Initialization *****/ diff --git a/src/mesa/main/histogram.h b/src/mesa/main/histogram.h index 367e9b11ba..dbae1bbd06 100644 --- a/src/mesa/main/histogram.h +++ b/src/mesa/main/histogram.h @@ -36,48 +36,22 @@ #ifndef HISTOGRAM_H #define HISTOGRAM_H -#include "glheader.h" -#include "mtypes.h" +#include "main/mtypes.h" -#if _HAVE_FULL_GL +#if FEATURE_histogram -extern void GLAPIENTRY -_mesa_GetMinmax(GLenum target, GLboolean reset, GLenum format, GLenum types, GLvoid *values); +extern void +_mesa_init_histogram_dispatch(struct _glapi_table *disp); -extern void GLAPIENTRY -_mesa_GetHistogram(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +#else /* FEATURE_histogram */ -extern void GLAPIENTRY -_mesa_GetHistogramParameterfv(GLenum target, GLenum pname, GLfloat *params); +static INLINE void +_mesa_init_histogram_dispatch(struct _glapi_table *disp) +{ +} -extern void GLAPIENTRY -_mesa_GetHistogramParameteriv(GLenum target, GLenum pname, GLint *params); - -extern void GLAPIENTRY -_mesa_GetMinmaxParameterfv(GLenum target, GLenum pname, GLfloat *params); - -extern void GLAPIENTRY -_mesa_GetMinmaxParameteriv(GLenum target, GLenum pname, GLint *params); - -extern void GLAPIENTRY -_mesa_Histogram(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); - -extern void GLAPIENTRY -_mesa_Minmax(GLenum target, GLenum internalformat, GLboolean sink); - -extern void GLAPIENTRY -_mesa_ResetHistogram(GLenum target); - -extern void GLAPIENTRY -_mesa_ResetMinmax(GLenum target); +#endif /* FEATURE_histogram */ extern void _mesa_init_histogram( GLcontext * ctx ); -#else - -/** No-op */ -#define _mesa_init_histogram( c ) ((void) 0) - -#endif - -#endif +#endif /* HISTOGRAM_H */ diff --git a/src/mesa/main/mfeatures.h b/src/mesa/main/mfeatures.h index e23cdb1f42..c2fb8404b1 100644 --- a/src/mesa/main/mfeatures.h +++ b/src/mesa/main/mfeatures.h @@ -36,12 +36,47 @@ #define _HAVE_FULL_GL 1 #endif +/* assert that a feature is disabled and should never be used */ +#define ASSERT_NO_FEATURE() ASSERT(0) + +/** + * A feature can be anything. But most of them share certain characteristics. + * + * When a feature defines driver entries, they can be initialized by + * _MESA_INIT_<FEATURE>_FUNCTIONS + * + * When a feature defines vtxfmt entries, they can be initialized and + * installed by + * _MESA_INIT_<FEATURE>_VTXFMT + * _mesa_install_<feature>_vtxfmt + * + * When a feature defines dispatch entries, they are initialized by + * _mesa_init_<feature>_dispatch + * + * When a feature has states, they are initialized and freed by + * _mesa_init_<feature> + * _mesa_free_<feature>_data + * + * Except for states, the others compile to no-op when a feature is disabled. + * + * The GLAPIENTRYs and helper functions defined by a feature should also + * compile to no-op when it is disabled. But to save typings and to catch + * bugs, some of them may be unavailable, or compile to ASSERT_NO_FEATURE() + * when the feature is disabled. + * + * A feature following the conventions may be used without knowing if it is + * enabled or not. + */ + #define FEATURE_accum _HAVE_FULL_GL +#define FEATURE_arrayelt _HAVE_FULL_GL #define FEATURE_attrib_stack _HAVE_FULL_GL +/* this disables vtxfmt, api_loopback, and api_noop completely */ +#define FEATURE_beginend _HAVE_FULL_GL #define FEATURE_colortable _HAVE_FULL_GL #define FEATURE_convolve _HAVE_FULL_GL #define FEATURE_dispatch _HAVE_FULL_GL -#define FEATURE_dlist _HAVE_FULL_GL +#define FEATURE_dlist (_HAVE_FULL_GL && FEATURE_arrayelt && FEATURE_beginend) #define FEATURE_draw_read_buffer _HAVE_FULL_GL #define FEATURE_drawpix _HAVE_FULL_GL #define FEATURE_evaluators _HAVE_FULL_GL @@ -50,15 +85,15 @@ #define FEATURE_histogram _HAVE_FULL_GL #define FEATURE_pixel_transfer _HAVE_FULL_GL #define FEATURE_point_size_array 0 +#define FEATURE_queryobj _HAVE_FULL_GL +#define FEATURE_rastpos _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_vertex_array_byte 0 -#define FEATURE_windowpos _HAVE_FULL_GL #define FEATURE_es2_glsl 0 -#define FEATURE_ARB_occlusion_query _HAVE_FULL_GL #define FEATURE_ARB_fragment_program _HAVE_FULL_GL #define FEATURE_ARB_framebuffer_object _HAVE_FULL_GL #define FEATURE_ARB_map_buffer_range _HAVE_FULL_GL @@ -76,7 +111,6 @@ #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_NV_fence _HAVE_FULL_GL #define FEATURE_NV_fragment_program _HAVE_FULL_GL diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index ae169fb9db..d005064645 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -1834,7 +1834,6 @@ struct gl_vertex_program struct gl_program Base; /**< base class */ GLboolean IsNVProgram; /**< is this a GL_NV_vertex_program program? */ GLboolean IsPositionInvariant; - void *TnlData; /**< should probably use Base.DriverData */ }; @@ -2067,6 +2066,8 @@ struct gl_shader_program #define GLSL_OPT 0x4 /**< Force optimizations (override pragmas) */ #define GLSL_NO_OPT 0x8 /**< Force no optimizations (override pragmas) */ #define GLSL_UNIFORMS 0x10 /**< Print glUniform calls */ +#define GLSL_NOP_VERT 0x20 /**< Force no-op vertex shaders */ +#define GLSL_NOP_FRAG 0x40 /**< Force no-op fragment shaders */ /** @@ -2080,6 +2081,7 @@ struct gl_shader_state GLboolean EmitContReturn; /**< Emit CONT/RET opcodes? */ GLboolean EmitCondCodes; /**< Use condition codes? */ GLboolean EmitComments; /**< Annotated instructions */ + GLboolean EmitNVTempInitialization; /**< 0-fill NV temp registers */ void *MemPool; GLbitfield Flags; /**< Mask of GLSL_x flags */ struct gl_sl_pragmas DefaultPragmas; /**< Default #pragma settings */ @@ -2583,6 +2585,7 @@ struct gl_extensions GLboolean MESA_texture_signed_rgba; GLboolean NV_blend_square; GLboolean NV_fragment_program; + GLboolean NV_fragment_program_option; GLboolean NV_light_max_exponent; GLboolean NV_point_sprite; GLboolean NV_texgen_reflection; diff --git a/src/mesa/main/pixel.c b/src/mesa/main/pixel.c index fcef6dfd42..3820ebd889 100644 --- a/src/mesa/main/pixel.c +++ b/src/mesa/main/pixel.c @@ -36,13 +36,17 @@ #include "macros.h" #include "pixel.h" #include "mtypes.h" +#include "glapi/dispatch.h" + + +#if FEATURE_pixel_transfer /**********************************************************************/ /***** glPixelZoom *****/ /**********************************************************************/ -void GLAPIENTRY +static void GLAPIENTRY _mesa_PixelZoom( GLfloat xfactor, GLfloat yfactor ) { GET_CURRENT_CONTEXT(ctx); @@ -163,7 +167,7 @@ validate_pbo_access(GLcontext *ctx, struct gl_pixelstore_attrib *pack, } -void GLAPIENTRY +static void GLAPIENTRY _mesa_PixelMapfv( GLenum map, GLsizei mapsize, const GLfloat *values ) { GET_CURRENT_CONTEXT(ctx); @@ -205,7 +209,7 @@ _mesa_PixelMapfv( GLenum map, GLsizei mapsize, const GLfloat *values ) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_PixelMapuiv(GLenum map, GLsizei mapsize, const GLuint *values ) { GLfloat fvalues[MAX_PIXEL_MAP_TABLE]; @@ -261,7 +265,7 @@ _mesa_PixelMapuiv(GLenum map, GLsizei mapsize, const GLuint *values ) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_PixelMapusv(GLenum map, GLsizei mapsize, const GLushort *values ) { GLfloat fvalues[MAX_PIXEL_MAP_TABLE]; @@ -317,7 +321,7 @@ _mesa_PixelMapusv(GLenum map, GLsizei mapsize, const GLushort *values ) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetPixelMapfv( GLenum map, GLfloat *values ) { GET_CURRENT_CONTEXT(ctx); @@ -362,7 +366,7 @@ _mesa_GetPixelMapfv( GLenum map, GLfloat *values ) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetPixelMapuiv( GLenum map, GLuint *values ) { GET_CURRENT_CONTEXT(ctx); @@ -406,7 +410,7 @@ _mesa_GetPixelMapuiv( GLenum map, GLuint *values ) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetPixelMapusv( GLenum map, GLushort *values ) { GET_CURRENT_CONTEXT(ctx); @@ -468,7 +472,7 @@ _mesa_GetPixelMapusv( GLenum map, GLushort *values ) * Implements glPixelTransfer[fi] whether called immediately or from a * display list. */ -void GLAPIENTRY +static void GLAPIENTRY _mesa_PixelTransferf( GLenum pname, GLfloat param ) { GET_CURRENT_CONTEXT(ctx); @@ -662,7 +666,7 @@ _mesa_PixelTransferf( GLenum pname, GLfloat param ) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_PixelTransferi( GLenum pname, GLint param ) { _mesa_PixelTransferf( pname, (GLfloat) param ); @@ -756,6 +760,24 @@ void _mesa_update_pixel( GLcontext *ctx, GLuint new_state ) } +void +_mesa_init_pixel_dispatch(struct _glapi_table *disp) +{ + SET_GetPixelMapfv(disp, _mesa_GetPixelMapfv); + SET_GetPixelMapuiv(disp, _mesa_GetPixelMapuiv); + SET_GetPixelMapusv(disp, _mesa_GetPixelMapusv); + SET_PixelMapfv(disp, _mesa_PixelMapfv); + SET_PixelMapuiv(disp, _mesa_PixelMapuiv); + SET_PixelMapusv(disp, _mesa_PixelMapusv); + SET_PixelTransferf(disp, _mesa_PixelTransferf); + SET_PixelTransferi(disp, _mesa_PixelTransferi); + SET_PixelZoom(disp, _mesa_PixelZoom); +} + + +#endif /* FEATURE_pixel_transfer */ + + /**********************************************************************/ /***** Initialization *****/ /**********************************************************************/ diff --git a/src/mesa/main/pixel.h b/src/mesa/main/pixel.h index cb6c5262a3..f4d3f1efdb 100644 --- a/src/mesa/main/pixel.h +++ b/src/mesa/main/pixel.h @@ -33,48 +33,35 @@ #define PIXEL_H -#include "mtypes.h" +#include "main/mtypes.h" -/** \name API functions */ -/*@{*/ +#if FEATURE_pixel_transfer -extern void GLAPIENTRY -_mesa_GetPixelMapfv( GLenum map, GLfloat *values ); - -extern void GLAPIENTRY -_mesa_GetPixelMapuiv( GLenum map, GLuint *values ); - -extern void GLAPIENTRY -_mesa_GetPixelMapusv( GLenum map, GLushort *values ); - -extern void GLAPIENTRY -_mesa_PixelMapfv( GLenum map, GLsizei mapsize, const GLfloat *values ); - -extern void GLAPIENTRY -_mesa_PixelMapuiv(GLenum map, GLsizei mapsize, const GLuint *values ); - -extern void GLAPIENTRY -_mesa_PixelMapusv(GLenum map, GLsizei mapsize, const GLushort *values ); +extern void +_mesa_update_pixel( GLcontext *ctx, GLuint newstate ); -extern void GLAPIENTRY -_mesa_PixelTransferf( GLenum pname, GLfloat param ); +extern void +_mesa_init_pixel_dispatch( struct _glapi_table * disp ); -extern void GLAPIENTRY -_mesa_PixelTransferi( GLenum pname, GLint param ); +#else /* FEATURE_pixel_transfer */ -extern void GLAPIENTRY -_mesa_PixelZoom( GLfloat xfactor, GLfloat yfactor ); +static INLINE void +_mesa_update_pixel(GLcontext *ctx, GLuint newstate) +{ +} -/*@}*/ +static INLINE void +_mesa_init_pixel_dispatch(struct _glapi_table *disp) +{ +} +#endif /* FEATURE_pixel_transfer */ -extern void -_mesa_update_pixel( GLcontext *ctx, GLuint newstate ); extern void _mesa_init_pixel( GLcontext * ctx ); /*@}*/ -#endif +#endif /* PIXEL_H */ diff --git a/src/mesa/main/queryobj.c b/src/mesa/main/queryobj.c index a73c6e0508..f6eb4ee7e1 100644 --- a/src/mesa/main/queryobj.c +++ b/src/mesa/main/queryobj.c @@ -29,6 +29,10 @@ #include "imports.h" #include "queryobj.h" #include "mtypes.h" +#include "glapi/dispatch.h" + + +#if FEATURE_queryobj /** @@ -216,7 +220,7 @@ _mesa_IsQueryARB(GLuint id) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_BeginQueryARB(GLenum target, GLuint id) { struct gl_query_object *q; @@ -236,7 +240,6 @@ _mesa_BeginQueryARB(GLenum target, GLuint id) return; } break; -#if FEATURE_EXT_timer_query case GL_TIME_ELAPSED_EXT: if (!ctx->Extensions.EXT_timer_query) { _mesa_error(ctx, GL_INVALID_ENUM, "glBeginQueryARB(target)"); @@ -247,7 +250,6 @@ _mesa_BeginQueryARB(GLenum target, GLuint id) return; } break; -#endif default: _mesa_error(ctx, GL_INVALID_ENUM, "glBeginQueryARB(target)"); return; @@ -285,17 +287,15 @@ _mesa_BeginQueryARB(GLenum target, GLuint id) if (target == GL_SAMPLES_PASSED_ARB) { ctx->Query.CurrentOcclusionObject = q; } -#if FEATURE_EXT_timer_query else if (target == GL_TIME_ELAPSED_EXT) { ctx->Query.CurrentTimerObject = q; } -#endif ctx->Driver.BeginQuery(ctx, q); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_EndQueryARB(GLenum target) { struct gl_query_object *q; @@ -313,7 +313,6 @@ _mesa_EndQueryARB(GLenum target) q = ctx->Query.CurrentOcclusionObject; ctx->Query.CurrentOcclusionObject = NULL; break; -#if FEATURE_EXT_timer_query case GL_TIME_ELAPSED_EXT: if (!ctx->Extensions.EXT_timer_query) { _mesa_error(ctx, GL_INVALID_ENUM, "glEndQueryARB(target)"); @@ -322,7 +321,6 @@ _mesa_EndQueryARB(GLenum target) q = ctx->Query.CurrentTimerObject; ctx->Query.CurrentTimerObject = NULL; break; -#endif default: _mesa_error(ctx, GL_INVALID_ENUM, "glEndQueryARB(target)"); return; @@ -354,7 +352,6 @@ _mesa_GetQueryivARB(GLenum target, GLenum pname, GLint *params) } q = ctx->Query.CurrentOcclusionObject; break; -#if FEATURE_EXT_timer_query case GL_TIME_ELAPSED_EXT: if (!ctx->Extensions.EXT_timer_query) { _mesa_error(ctx, GL_INVALID_ENUM, "glEndQueryARB(target)"); @@ -362,7 +359,6 @@ _mesa_GetQueryivARB(GLenum target, GLenum pname, GLint *params) } q = ctx->Query.CurrentTimerObject; break; -#endif default: _mesa_error(ctx, GL_INVALID_ENUM, "glGetQueryivARB(target)"); return; @@ -462,12 +458,10 @@ _mesa_GetQueryObjectuivARB(GLuint id, GLenum pname, GLuint *params) } -#if FEATURE_EXT_timer_query - /** * New with GL_EXT_timer_query */ -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetQueryObjecti64vEXT(GLuint id, GLenum pname, GLint64EXT *params) { struct gl_query_object *q = NULL; @@ -504,7 +498,7 @@ _mesa_GetQueryObjecti64vEXT(GLuint id, GLenum pname, GLint64EXT *params) /** * New with GL_EXT_timer_query */ -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetQueryObjectui64vEXT(GLuint id, GLenum pname, GLuint64EXT *params) { struct gl_query_object *q = NULL; @@ -537,19 +531,35 @@ _mesa_GetQueryObjectui64vEXT(GLuint id, GLenum pname, GLuint64EXT *params) } } -#endif /* FEATURE_EXT_timer_query */ + +void +_mesa_init_queryobj_dispatch(struct _glapi_table *disp) +{ + SET_GenQueriesARB(disp, _mesa_GenQueriesARB); + SET_DeleteQueriesARB(disp, _mesa_DeleteQueriesARB); + SET_IsQueryARB(disp, _mesa_IsQueryARB); + SET_BeginQueryARB(disp, _mesa_BeginQueryARB); + SET_EndQueryARB(disp, _mesa_EndQueryARB); + SET_GetQueryivARB(disp, _mesa_GetQueryivARB); + SET_GetQueryObjectivARB(disp, _mesa_GetQueryObjectivARB); + SET_GetQueryObjectuivARB(disp, _mesa_GetQueryObjectuivARB); + + SET_GetQueryObjecti64vEXT(disp, _mesa_GetQueryObjecti64vEXT); + SET_GetQueryObjectui64vEXT(disp, _mesa_GetQueryObjectui64vEXT); +} + + +#endif /* FEATURE_queryobj */ /** * Allocate/init the context state related to query objects. */ void -_mesa_init_query(GLcontext *ctx) +_mesa_init_queryobj(GLcontext *ctx) { -#if FEATURE_ARB_occlusion_query ctx->Query.QueryObjects = _mesa_NewHashTable(); ctx->Query.CurrentOcclusionObject = NULL; -#endif } @@ -569,7 +579,7 @@ delete_queryobj_cb(GLuint id, void *data, void *userData) * Free the context state related to query objects. */ void -_mesa_free_query_data(GLcontext *ctx) +_mesa_free_queryobj_data(GLcontext *ctx) { _mesa_HashDeleteAll(ctx->Query.QueryObjects, delete_queryobj_cb, ctx); _mesa_DeleteHashTable(ctx->Query.QueryObjects); diff --git a/src/mesa/main/queryobj.h b/src/mesa/main/queryobj.h index ee775ef959..6cf3c76d74 100644 --- a/src/mesa/main/queryobj.h +++ b/src/mesa/main/queryobj.h @@ -23,19 +23,24 @@ */ -#ifndef OCCLUDE_H -#define OCCLUDE_H +#ifndef QUERYOBJ_H +#define QUERYOBJ_H -extern void -_mesa_init_query(GLcontext *ctx); +#include "main/mtypes.h" -extern void -_mesa_free_query_data(GLcontext *ctx); -extern void -_mesa_init_query_object_functions(struct dd_function_table *driver); +#if FEATURE_queryobj +#define _MESA_INIT_QUERYOBJ_FUNCTIONS(driver, impl) \ + do { \ + (driver)->NewQueryObject = impl ## NewQueryObject; \ + (driver)->DeleteQuery = impl ## DeleteQuery; \ + (driver)->BeginQuery = impl ## BeginQuery; \ + (driver)->EndQuery = impl ## EndQuery; \ + (driver)->WaitQuery = impl ## WaitQuery; \ + (driver)->CheckQuery = impl ## CheckQuery; \ + } while (0) extern void GLAPIENTRY _mesa_GenQueriesARB(GLsizei n, GLuint *ids); @@ -47,12 +52,6 @@ extern GLboolean GLAPIENTRY _mesa_IsQueryARB(GLuint id); extern void GLAPIENTRY -_mesa_BeginQueryARB(GLenum target, GLuint id); - -extern void GLAPIENTRY -_mesa_EndQueryARB(GLenum target); - -extern void GLAPIENTRY _mesa_GetQueryivARB(GLenum target, GLenum pname, GLint *params); extern void GLAPIENTRY @@ -61,11 +60,33 @@ _mesa_GetQueryObjectivARB(GLuint id, GLenum pname, GLint *params); extern void GLAPIENTRY _mesa_GetQueryObjectuivARB(GLuint id, GLenum pname, GLuint *params); -extern void GLAPIENTRY -_mesa_GetQueryObjecti64vEXT(GLuint id, GLenum pname, GLint64EXT *params); +extern void +_mesa_init_query_object_functions(struct dd_function_table *driver); -extern void GLAPIENTRY -_mesa_GetQueryObjectui64vEXT(GLuint id, GLenum pname, GLuint64EXT *params); +extern void +_mesa_init_queryobj_dispatch(struct _glapi_table *disp); + +#else /* FEATURE_queryobj */ + +#define _MESA_INIT_QUERYOBJ_FUNCTIONS(driver, impl) do { } while (0) + +static INLINE void +_mesa_init_query_object_functions(struct dd_function_table *driver) +{ +} + +static INLINE void +_mesa_init_queryobj_dispatch(struct _glapi_table *disp) +{ +} + +#endif /* FEATURE_queryobj */ + +extern void +_mesa_init_queryobj(GLcontext *ctx); + +extern void +_mesa_free_queryobj_data(GLcontext *ctx); -#endif /* OCCLUDE_H */ +#endif /* QUERYOBJ_H */ diff --git a/src/mesa/main/rastpos.c b/src/mesa/main/rastpos.c index 9f309d6ab8..703b47ec74 100644 --- a/src/mesa/main/rastpos.c +++ b/src/mesa/main/rastpos.c @@ -34,6 +34,10 @@ #include "macros.h" #include "rastpos.h" #include "state.h" +#include "glapi/dispatch.h" + + +#if FEATURE_rastpos /** @@ -60,147 +64,147 @@ rasterpos(GLfloat x, GLfloat y, GLfloat z, GLfloat w) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos2d(GLdouble x, GLdouble y) { rasterpos((GLfloat)x, (GLfloat)y, (GLfloat)0.0, (GLfloat)1.0); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos2f(GLfloat x, GLfloat y) { rasterpos(x, y, 0.0F, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos2i(GLint x, GLint y) { rasterpos((GLfloat) x, (GLfloat) y, 0.0F, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos2s(GLshort x, GLshort y) { rasterpos(x, y, 0.0F, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos3d(GLdouble x, GLdouble y, GLdouble z) { rasterpos((GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos3f(GLfloat x, GLfloat y, GLfloat z) { rasterpos(x, y, z, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos3i(GLint x, GLint y, GLint z) { rasterpos((GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos3s(GLshort x, GLshort y, GLshort z) { rasterpos(x, y, z, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w) { rasterpos((GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w) { rasterpos(x, y, z, w); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos4i(GLint x, GLint y, GLint z, GLint w) { rasterpos((GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos4s(GLshort x, GLshort y, GLshort z, GLshort w) { rasterpos(x, y, z, w); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos2dv(const GLdouble *v) { rasterpos((GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos2fv(const GLfloat *v) { rasterpos(v[0], v[1], 0.0F, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos2iv(const GLint *v) { rasterpos((GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos2sv(const GLshort *v) { rasterpos(v[0], v[1], 0.0F, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos3dv(const GLdouble *v) { rasterpos((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos3fv(const GLfloat *v) { rasterpos(v[0], v[1], v[2], 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos3iv(const GLint *v) { rasterpos((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos3sv(const GLshort *v) { rasterpos(v[0], v[1], v[2], 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos4dv(const GLdouble *v) { rasterpos((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat) v[3]); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos4fv(const GLfloat *v) { rasterpos(v[0], v[1], v[2], v[3]); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos4iv(const GLint *v) { rasterpos((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat) v[3]); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos4sv(const GLshort *v) { rasterpos(v[0], v[1], v[2], v[3]); @@ -211,7 +215,7 @@ _mesa_RasterPos4sv(const GLshort *v) /*** GL_ARB_window_pos / GL_MESA_window_pos ***/ /**********************************************************************/ -#if FEATURE_drawpix + /** * All glWindowPosMESA and glWindowPosARB commands call this function to * update the current raster position. @@ -290,153 +294,152 @@ window_pos4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos2dMESA(GLdouble x, GLdouble y) { window_pos4f((GLfloat) x, (GLfloat) y, 0.0F, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos2fMESA(GLfloat x, GLfloat y) { window_pos4f(x, y, 0.0F, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos2iMESA(GLint x, GLint y) { window_pos4f((GLfloat) x, (GLfloat) y, 0.0F, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos2sMESA(GLshort x, GLshort y) { window_pos4f(x, y, 0.0F, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos3dMESA(GLdouble x, GLdouble y, GLdouble z) { window_pos4f((GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos3fMESA(GLfloat x, GLfloat y, GLfloat z) { window_pos4f(x, y, z, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos3iMESA(GLint x, GLint y, GLint z) { window_pos4f((GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos3sMESA(GLshort x, GLshort y, GLshort z) { window_pos4f(x, y, z, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos4dMESA(GLdouble x, GLdouble y, GLdouble z, GLdouble w) { window_pos4f((GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos4fMESA(GLfloat x, GLfloat y, GLfloat z, GLfloat w) { window_pos4f(x, y, z, w); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos4iMESA(GLint x, GLint y, GLint z, GLint w) { window_pos4f((GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos4sMESA(GLshort x, GLshort y, GLshort z, GLshort w) { window_pos4f(x, y, z, w); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos2dvMESA(const GLdouble *v) { window_pos4f((GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos2fvMESA(const GLfloat *v) { window_pos4f(v[0], v[1], 0.0F, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos2ivMESA(const GLint *v) { window_pos4f((GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos2svMESA(const GLshort *v) { window_pos4f(v[0], v[1], 0.0F, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos3dvMESA(const GLdouble *v) { window_pos4f((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos3fvMESA(const GLfloat *v) { window_pos4f(v[0], v[1], v[2], 1.0); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos3ivMESA(const GLint *v) { window_pos4f((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos3svMESA(const GLshort *v) { window_pos4f(v[0], v[1], v[2], 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos4dvMESA(const GLdouble *v) { window_pos4f((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat) v[3]); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos4fvMESA(const GLfloat *v) { window_pos4f(v[0], v[1], v[2], v[3]); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos4ivMESA(const GLint *v) { window_pos4f((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat) v[3]); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos4svMESA(const GLshort *v) { window_pos4f(v[0], v[1], v[2], v[3]); } -#endif #if 0 @@ -477,6 +480,65 @@ void glWindowPos4fMESA( GLfloat x, GLfloat y, GLfloat z, GLfloat w ) #endif +void +_mesa_init_rastpos_dispatch(struct _glapi_table *disp) +{ + SET_RasterPos2f(disp, _mesa_RasterPos2f); + SET_RasterPos2fv(disp, _mesa_RasterPos2fv); + SET_RasterPos2i(disp, _mesa_RasterPos2i); + SET_RasterPos2iv(disp, _mesa_RasterPos2iv); + SET_RasterPos2d(disp, _mesa_RasterPos2d); + SET_RasterPos2dv(disp, _mesa_RasterPos2dv); + SET_RasterPos2s(disp, _mesa_RasterPos2s); + SET_RasterPos2sv(disp, _mesa_RasterPos2sv); + SET_RasterPos3d(disp, _mesa_RasterPos3d); + SET_RasterPos3dv(disp, _mesa_RasterPos3dv); + SET_RasterPos3f(disp, _mesa_RasterPos3f); + SET_RasterPos3fv(disp, _mesa_RasterPos3fv); + SET_RasterPos3i(disp, _mesa_RasterPos3i); + SET_RasterPos3iv(disp, _mesa_RasterPos3iv); + SET_RasterPos3s(disp, _mesa_RasterPos3s); + SET_RasterPos3sv(disp, _mesa_RasterPos3sv); + SET_RasterPos4d(disp, _mesa_RasterPos4d); + SET_RasterPos4dv(disp, _mesa_RasterPos4dv); + SET_RasterPos4f(disp, _mesa_RasterPos4f); + SET_RasterPos4fv(disp, _mesa_RasterPos4fv); + SET_RasterPos4i(disp, _mesa_RasterPos4i); + SET_RasterPos4iv(disp, _mesa_RasterPos4iv); + SET_RasterPos4s(disp, _mesa_RasterPos4s); + SET_RasterPos4sv(disp, _mesa_RasterPos4sv); + + /* 197. GL_MESA_window_pos */ + SET_WindowPos2dMESA(disp, _mesa_WindowPos2dMESA); + SET_WindowPos2dvMESA(disp, _mesa_WindowPos2dvMESA); + SET_WindowPos2fMESA(disp, _mesa_WindowPos2fMESA); + SET_WindowPos2fvMESA(disp, _mesa_WindowPos2fvMESA); + SET_WindowPos2iMESA(disp, _mesa_WindowPos2iMESA); + SET_WindowPos2ivMESA(disp, _mesa_WindowPos2ivMESA); + SET_WindowPos2sMESA(disp, _mesa_WindowPos2sMESA); + SET_WindowPos2svMESA(disp, _mesa_WindowPos2svMESA); + SET_WindowPos3dMESA(disp, _mesa_WindowPos3dMESA); + SET_WindowPos3dvMESA(disp, _mesa_WindowPos3dvMESA); + SET_WindowPos3fMESA(disp, _mesa_WindowPos3fMESA); + SET_WindowPos3fvMESA(disp, _mesa_WindowPos3fvMESA); + SET_WindowPos3iMESA(disp, _mesa_WindowPos3iMESA); + SET_WindowPos3ivMESA(disp, _mesa_WindowPos3ivMESA); + SET_WindowPos3sMESA(disp, _mesa_WindowPos3sMESA); + SET_WindowPos3svMESA(disp, _mesa_WindowPos3svMESA); + SET_WindowPos4dMESA(disp, _mesa_WindowPos4dMESA); + SET_WindowPos4dvMESA(disp, _mesa_WindowPos4dvMESA); + SET_WindowPos4fMESA(disp, _mesa_WindowPos4fMESA); + SET_WindowPos4fvMESA(disp, _mesa_WindowPos4fvMESA); + SET_WindowPos4iMESA(disp, _mesa_WindowPos4iMESA); + SET_WindowPos4ivMESA(disp, _mesa_WindowPos4ivMESA); + SET_WindowPos4sMESA(disp, _mesa_WindowPos4sMESA); + SET_WindowPos4svMESA(disp, _mesa_WindowPos4svMESA); +} + + +#endif /* FEATURE_rastpos */ + + /**********************************************************************/ /** \name Initialization */ /**********************************************************************/ diff --git a/src/mesa/main/rastpos.h b/src/mesa/main/rastpos.h index 363f86ad87..b2127225b6 100644 --- a/src/mesa/main/rastpos.h +++ b/src/mesa/main/rastpos.h @@ -32,162 +32,33 @@ #define RASTPOS_H -#include "glheader.h" +#include "main/mtypes.h" -extern void GLAPIENTRY -_mesa_RasterPos2d(GLdouble x, GLdouble y); +#if FEATURE_rastpos -extern void GLAPIENTRY -_mesa_RasterPos2f(GLfloat x, GLfloat y); +#define _MESA_INIT_RASTPOS_FUNCTIONS(driver, impl) \ + do { \ + (driver)->RasterPos = impl ## RasterPos; \ + } while (0) -extern void GLAPIENTRY -_mesa_RasterPos2i(GLint x, GLint y); +extern void +_mesa_init_rastpos_dispatch(struct _glapi_table *disp); -extern void GLAPIENTRY -_mesa_RasterPos2s(GLshort x, GLshort y); +#else /* FEATURE_rastpos */ -extern void GLAPIENTRY -_mesa_RasterPos3d(GLdouble x, GLdouble y, GLdouble z); +#define _MESA_INIT_RASTPOS_FUNCTIONS(driver, impl) do { } while (0) -extern void GLAPIENTRY -_mesa_RasterPos3f(GLfloat x, GLfloat y, GLfloat z); +static INLINE void +_mesa_init_rastpos_dispatch(struct _glapi_table *disp) +{ +} -extern void GLAPIENTRY -_mesa_RasterPos3i(GLint x, GLint y, GLint z); - -extern void GLAPIENTRY -_mesa_RasterPos3s(GLshort x, GLshort y, GLshort z); - -extern void GLAPIENTRY -_mesa_RasterPos4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w); - -extern void GLAPIENTRY -_mesa_RasterPos4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w); - -extern void GLAPIENTRY -_mesa_RasterPos4i(GLint x, GLint y, GLint z, GLint w); - -extern void GLAPIENTRY -_mesa_RasterPos4s(GLshort x, GLshort y, GLshort z, GLshort w); - -extern void GLAPIENTRY -_mesa_RasterPos2dv(const GLdouble *v); - -extern void GLAPIENTRY -_mesa_RasterPos2fv(const GLfloat *v); - -extern void GLAPIENTRY -_mesa_RasterPos2iv(const GLint *v); - -extern void GLAPIENTRY -_mesa_RasterPos2sv(const GLshort *v); - -extern void GLAPIENTRY -_mesa_RasterPos3dv(const GLdouble *v); - -extern void GLAPIENTRY -_mesa_RasterPos3fv(const GLfloat *v); - -extern void GLAPIENTRY -_mesa_RasterPos3iv(const GLint *v); - -extern void GLAPIENTRY -_mesa_RasterPos3sv(const GLshort *v); - -extern void GLAPIENTRY -_mesa_RasterPos4dv(const GLdouble *v); - -extern void GLAPIENTRY -_mesa_RasterPos4fv(const GLfloat *v); - -extern void GLAPIENTRY -_mesa_RasterPos4iv(const GLint *v); - -extern void GLAPIENTRY -_mesa_RasterPos4sv(const GLshort *v); - - -/**********************************************************************/ -/** \name GL_MESA_window_pos */ -/**********************************************************************/ -/*@{*/ - -extern void GLAPIENTRY -_mesa_WindowPos2dMESA(GLdouble x, GLdouble y); - -extern void GLAPIENTRY -_mesa_WindowPos2fMESA(GLfloat x, GLfloat y); - -extern void GLAPIENTRY -_mesa_WindowPos2iMESA(GLint x, GLint y); - -extern void GLAPIENTRY -_mesa_WindowPos2sMESA(GLshort x, GLshort y); - -extern void GLAPIENTRY -_mesa_WindowPos3dMESA(GLdouble x, GLdouble y, GLdouble z); - -extern void GLAPIENTRY -_mesa_WindowPos3fMESA(GLfloat x, GLfloat y, GLfloat z); - -extern void GLAPIENTRY -_mesa_WindowPos3iMESA(GLint x, GLint y, GLint z); - -extern void GLAPIENTRY -_mesa_WindowPos3sMESA(GLshort x, GLshort y, GLshort z); - -extern void GLAPIENTRY -_mesa_WindowPos4dMESA(GLdouble x, GLdouble y, GLdouble z, GLdouble w); - -extern void GLAPIENTRY -_mesa_WindowPos4fMESA(GLfloat x, GLfloat y, GLfloat z, GLfloat w); - -extern void GLAPIENTRY -_mesa_WindowPos4iMESA(GLint x, GLint y, GLint z, GLint w); - -extern void GLAPIENTRY -_mesa_WindowPos4sMESA(GLshort x, GLshort y, GLshort z, GLshort w); - -extern void GLAPIENTRY -_mesa_WindowPos2dvMESA(const GLdouble *v); - -extern void GLAPIENTRY -_mesa_WindowPos2fvMESA(const GLfloat *v); - -extern void GLAPIENTRY -_mesa_WindowPos2ivMESA(const GLint *v); - -extern void GLAPIENTRY -_mesa_WindowPos2svMESA(const GLshort *v); - -extern void GLAPIENTRY -_mesa_WindowPos3dvMESA(const GLdouble *v); - -extern void GLAPIENTRY -_mesa_WindowPos3fvMESA(const GLfloat *v); - -extern void GLAPIENTRY -_mesa_WindowPos3ivMESA(const GLint *v); - -extern void GLAPIENTRY -_mesa_WindowPos3svMESA(const GLshort *v); - -extern void GLAPIENTRY -_mesa_WindowPos4dvMESA(const GLdouble *v); - -extern void GLAPIENTRY -_mesa_WindowPos4fvMESA(const GLfloat *v); - -extern void GLAPIENTRY -_mesa_WindowPos4ivMESA(const GLint *v); - -extern void GLAPIENTRY -_mesa_WindowPos4svMESA(const GLshort *v); +#endif /* FEATURE_rastpos */ extern void -_mesa_init_rastpos( GLcontext * ctx ); +_mesa_init_rastpos(GLcontext *ctx); /*@}*/ -#endif +#endif /* RASTPOS_H */ diff --git a/src/mesa/main/shared.c b/src/mesa/main/shared.c index 643ad3354e..4d01e8abc6 100644 --- a/src/mesa/main/shared.c +++ b/src/mesa/main/shared.c @@ -37,9 +37,7 @@ #include "shared.h" #include "shader/program.h" #include "shader/shader_api.h" -#if FEATURE_dlist #include "dlist.h" -#endif #if FEATURE_ATI_fragment_shader #include "shader/atifragshader.h" #endif @@ -143,11 +141,9 @@ _mesa_alloc_shared_state(GLcontext *ctx) static void delete_displaylist_cb(GLuint id, void *data, void *userData) { -#if FEATURE_dlist struct gl_display_list *list = (struct gl_display_list *) data; GLcontext *ctx = (GLcontext *) userData; _mesa_delete_list(ctx, list); -#endif } diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c index 140a998df2..f10e6b04b7 100644 --- a/src/mesa/main/state.c +++ b/src/mesa/main/state.c @@ -40,9 +40,7 @@ #include "framebuffer.h" #include "light.h" #include "matrix.h" -#if FEATURE_pixel_transfer #include "pixel.h" -#endif #include "shader/program.h" #include "shader/prog_parameter.h" #include "state.h" @@ -585,10 +583,8 @@ _mesa_update_state_locked( GLcontext *ctx ) if (new_state & (_NEW_STENCIL | _NEW_BUFFERS)) _mesa_update_stencil( ctx ); -#if FEATURE_pixel_transfer if (new_state & _MESA_NEW_TRANSFER_STATE) _mesa_update_pixel( ctx, new_state ); -#endif if (new_state & _DD_NEW_SEPARATE_SPECULAR) update_separate_specular( ctx ); diff --git a/src/mesa/main/texenvprogram.c b/src/mesa/main/texenvprogram.c index 2f3e47e69e..d7e77e759e 100644 --- a/src/mesa/main/texenvprogram.c +++ b/src/mesa/main/texenvprogram.c @@ -276,6 +276,7 @@ need_saturate( GLuint mode ) return GL_TRUE; default: assert(0); + return GL_FALSE; } } diff --git a/src/mesa/main/texgen.c b/src/mesa/main/texgen.c index b3ecfc784e..733e129fcf 100644 --- a/src/mesa/main/texgen.c +++ b/src/mesa/main/texgen.c @@ -37,6 +37,10 @@ #include "main/texgen.h" #include "main/texstate.h" #include "math/m_matrix.h" +#include "glapi/dispatch.h" + + +#if FEATURE_texgen /** @@ -162,7 +166,7 @@ _mesa_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params ) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_TexGeniv(GLenum coord, GLenum pname, const GLint *params ) { GLfloat p[4]; @@ -179,7 +183,7 @@ _mesa_TexGeniv(GLenum coord, GLenum pname, const GLint *params ) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_TexGend(GLenum coord, GLenum pname, GLdouble param ) { GLfloat p = (GLfloat) param; @@ -187,7 +191,7 @@ _mesa_TexGend(GLenum coord, GLenum pname, GLdouble param ) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_TexGendv(GLenum coord, GLenum pname, const GLdouble *params ) { GLfloat p[4]; @@ -204,7 +208,7 @@ _mesa_TexGendv(GLenum coord, GLenum pname, const GLdouble *params ) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_TexGenf( GLenum coord, GLenum pname, GLfloat param ) { _mesa_TexGenfv(coord, pname, ¶m); @@ -219,7 +223,7 @@ _mesa_TexGeni( GLenum coord, GLenum pname, GLint param ) -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetTexGendv( GLenum coord, GLenum pname, GLdouble *params ) { struct gl_texture_unit *texUnit; @@ -257,7 +261,7 @@ _mesa_GetTexGendv( GLenum coord, GLenum pname, GLdouble *params ) -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetTexGenfv( GLenum coord, GLenum pname, GLfloat *params ) { struct gl_texture_unit *texUnit; @@ -295,7 +299,7 @@ _mesa_GetTexGenfv( GLenum coord, GLenum pname, GLfloat *params ) -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetTexGeniv( GLenum coord, GLenum pname, GLint *params ) { struct gl_texture_unit *texUnit; @@ -338,3 +342,19 @@ _mesa_GetTexGeniv( GLenum coord, GLenum pname, GLint *params ) } +void +_mesa_init_texgen_dispatch(struct _glapi_table *disp) +{ + SET_GetTexGendv(disp, _mesa_GetTexGendv); + SET_GetTexGenfv(disp, _mesa_GetTexGenfv); + SET_GetTexGeniv(disp, _mesa_GetTexGeniv); + SET_TexGend(disp, _mesa_TexGend); + SET_TexGendv(disp, _mesa_TexGendv); + SET_TexGenf(disp, _mesa_TexGenf); + SET_TexGenfv(disp, _mesa_TexGenfv); + SET_TexGeni(disp, _mesa_TexGeni); + SET_TexGeniv(disp, _mesa_TexGeniv); +} + + +#endif /* FEATURE_texgen */ diff --git a/src/mesa/main/texgen.h b/src/mesa/main/texgen.h index 073588efcd..f6924ef722 100644 --- a/src/mesa/main/texgen.h +++ b/src/mesa/main/texgen.h @@ -27,36 +27,45 @@ #define TEXGEN_H -#include "main/glheader.h" +#include "main/mtypes.h" -extern void GLAPIENTRY -_mesa_GetTexGendv( GLenum coord, GLenum pname, GLdouble *params ); +#if FEATURE_texgen -extern void GLAPIENTRY -_mesa_GetTexGenfv( GLenum coord, GLenum pname, GLfloat *params ); +#define _MESA_INIT_TEXGEN_FUNCTIONS(driver, impl) \ + do { \ + (driver)->TexGen = impl ## TexGen; \ + } while (0) extern void GLAPIENTRY -_mesa_GetTexGeniv( GLenum coord, GLenum pname, GLint *params ); +_mesa_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params ); extern void GLAPIENTRY -_mesa_TexGend( GLenum coord, GLenum pname, GLdouble param ); +_mesa_TexGeni( GLenum coord, GLenum pname, GLint param ); -extern void GLAPIENTRY -_mesa_TexGendv( GLenum coord, GLenum pname, const GLdouble *params ); +extern void +_mesa_init_texgen_dispatch(struct _glapi_table *disp); -extern void GLAPIENTRY -_mesa_TexGenf( GLenum coord, GLenum pname, GLfloat param ); +#else /* FEATURE_texgen */ -extern void GLAPIENTRY -_mesa_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params ); +#define _MESA_INIT_TEXGEN_FUNCTIONS(driver, impl) do { } while (0) -extern void GLAPIENTRY -_mesa_TexGeni( GLenum coord, GLenum pname, GLint param ); +static void +_mesa_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params ) +{ +} -extern void GLAPIENTRY -_mesa_TexGeniv( GLenum coord, GLenum pname, const GLint *params ); +static void INLINE +_mesa_TexGeni( GLenum coord, GLenum pname, GLint param ) +{ +} + +static INLINE void +_mesa_init_texgen_dispatch(struct _glapi_table *disp) +{ +} +#endif /* FEATURE_texgen */ #endif /* TEXGEN_H */ diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index b0aa04e9aa..465da6b046 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -33,9 +33,8 @@ #include "glheader.h" #include "bufferobj.h" #include "context.h" -#if FEATURE_convolve #include "convolve.h" -#endif +#include "enums.h" #include "fbobject.h" #include "framebuffer.h" #include "hash.h" @@ -2148,6 +2147,13 @@ _mesa_TexImage1D( GLenum target, GLint level, GLint internalFormat, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); + if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) + _mesa_debug(ctx, "glTexImage1D %s %d %s %d %d %s %s %p\n", + _mesa_lookup_enum_by_nr(target), level, + _mesa_lookup_enum_by_nr(internalFormat), width, border, + _mesa_lookup_enum_by_nr(format), + _mesa_lookup_enum_by_nr(type), pixels); + internalFormat = override_internal_format(internalFormat, width, 1); #if FEATURE_convolve @@ -2247,6 +2253,13 @@ _mesa_TexImage2D( GLenum target, GLint level, GLint internalFormat, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); + if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) + _mesa_debug(ctx, "glTexImage2D %s %d %s %d %d %d %s %s %p\n", + _mesa_lookup_enum_by_nr(target), level, + _mesa_lookup_enum_by_nr(internalFormat), width, height, + border, _mesa_lookup_enum_by_nr(format), + _mesa_lookup_enum_by_nr(type), pixels); + internalFormat = override_internal_format(internalFormat, width, height); #if FEATURE_convolve @@ -2363,6 +2376,13 @@ _mesa_TexImage3D( GLenum target, GLint level, GLint internalFormat, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); + if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) + _mesa_debug(ctx, "glTexImage3D %s %d %s %d %d %d %d %s %s %p\n", + _mesa_lookup_enum_by_nr(target), level, + _mesa_lookup_enum_by_nr(internalFormat), width, height, + depth, border, _mesa_lookup_enum_by_nr(format), + _mesa_lookup_enum_by_nr(type), pixels); + internalFormat = override_internal_format(internalFormat, width, height); if (target == GL_TEXTURE_3D || @@ -2472,6 +2492,12 @@ _mesa_TexSubImage1D( GLenum target, GLint level, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); + if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) + _mesa_debug(ctx, "glTexSubImage1D %s %d %d %d %s %s %p\n", + _mesa_lookup_enum_by_nr(target), level, + xoffset, width, _mesa_lookup_enum_by_nr(format), + _mesa_lookup_enum_by_nr(type), pixels); + if (ctx->NewState & _MESA_NEW_TRANSFER_STATE) _mesa_update_state(ctx); @@ -2533,6 +2559,13 @@ _mesa_TexSubImage2D( GLenum target, GLint level, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); + if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) + _mesa_debug(ctx, "glTexSubImage2D %s %d %d %d %d %d %s %s %p\n", + _mesa_lookup_enum_by_nr(target), level, + xoffset, yoffset, width, height, + _mesa_lookup_enum_by_nr(format), + _mesa_lookup_enum_by_nr(type), pixels); + if (ctx->NewState & _MESA_NEW_TRANSFER_STATE) _mesa_update_state(ctx); @@ -2594,6 +2627,13 @@ _mesa_TexSubImage3D( GLenum target, GLint level, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); + if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) + _mesa_debug(ctx, "glTexSubImage3D %s %d %d %d %d %d %d %d %s %s %p\n", + _mesa_lookup_enum_by_nr(target), level, + xoffset, yoffset, zoffset, width, height, depth, + _mesa_lookup_enum_by_nr(format), + _mesa_lookup_enum_by_nr(type), pixels); + if (ctx->NewState & _MESA_NEW_TRANSFER_STATE) _mesa_update_state(ctx); @@ -2652,6 +2692,12 @@ _mesa_CopyTexImage1D( GLenum target, GLint level, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); + if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) + _mesa_debug(ctx, "glCopyTexImage1D %s %d %s %d %d %d %d\n", + _mesa_lookup_enum_by_nr(target), level, + _mesa_lookup_enum_by_nr(internalFormat), + x, y, width, border); + if (ctx->NewState & NEW_COPY_TEX_STATE) _mesa_update_state(ctx); @@ -2718,6 +2764,12 @@ _mesa_CopyTexImage2D( GLenum target, GLint level, GLenum internalFormat, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); + if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) + _mesa_debug(ctx, "glCopyTexImage2D %s %d %s %d %d %d %d %d\n", + _mesa_lookup_enum_by_nr(target), level, + _mesa_lookup_enum_by_nr(internalFormat), + x, y, width, height, border); + if (ctx->NewState & NEW_COPY_TEX_STATE) _mesa_update_state(ctx); @@ -2787,6 +2839,11 @@ _mesa_CopyTexSubImage1D( GLenum target, GLint level, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); + if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) + _mesa_debug(ctx, "glCopyTexSubImage1D %s %d %d %d %d %d\n", + _mesa_lookup_enum_by_nr(target), + level, xoffset, x, y, width); + if (ctx->NewState & NEW_COPY_TEX_STATE) _mesa_update_state(ctx); @@ -2844,6 +2901,11 @@ _mesa_CopyTexSubImage2D( GLenum target, GLint level, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); + if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) + _mesa_debug(ctx, "glCopyTexSubImage2D %s %d %d %d %d %d %d %d\n", + _mesa_lookup_enum_by_nr(target), + level, xoffset, yoffset, x, y, width, height); + if (ctx->NewState & NEW_COPY_TEX_STATE) _mesa_update_state(ctx); @@ -2904,6 +2966,11 @@ _mesa_CopyTexSubImage3D( GLenum target, GLint level, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); + if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) + _mesa_debug(ctx, "glCopyTexSubImage3D %s %d %d %d %d %d %d %d %d\n", + _mesa_lookup_enum_by_nr(target), + level, xoffset, yoffset, zoffset, x, y, width, height); + if (ctx->NewState & NEW_COPY_TEX_STATE) _mesa_update_state(ctx); @@ -3155,6 +3222,12 @@ _mesa_CompressedTexImage1DARB(GLenum target, GLint level, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); + if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) + _mesa_debug(ctx, "glCompressedTexImage1DARB %s %d %s %d %d %d %p\n", + _mesa_lookup_enum_by_nr(target), level, + _mesa_lookup_enum_by_nr(internalFormat), + width, border, imageSize, data); + if (target == GL_TEXTURE_1D) { /* non-proxy target */ struct gl_texture_unit *texUnit; @@ -3250,6 +3323,12 @@ _mesa_CompressedTexImage2DARB(GLenum target, GLint level, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); + if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) + _mesa_debug(ctx, "glCompressedTexImage2DARB %s %d %s %d %d %d %d %p\n", + _mesa_lookup_enum_by_nr(target), level, + _mesa_lookup_enum_by_nr(internalFormat), + width, height, border, imageSize, data); + if (target == GL_TEXTURE_2D || (ctx->Extensions.ARB_texture_cube_map && target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB && @@ -3350,6 +3429,12 @@ _mesa_CompressedTexImage3DARB(GLenum target, GLint level, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); + if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) + _mesa_debug(ctx, "glCompressedTexImage3DARB %s %d %s %d %d %d %d %d %p\n", + _mesa_lookup_enum_by_nr(target), level, + _mesa_lookup_enum_by_nr(internalFormat), + width, height, depth, border, imageSize, data); + if (target == GL_TEXTURE_3D) { /* non-proxy target */ struct gl_texture_unit *texUnit; diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index d09c439250..f8ce811eb2 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -29,9 +29,7 @@ #include "mfeatures.h" -#if FEATURE_colortable #include "colortab.h" -#endif #include "context.h" #include "enums.h" #include "fbobject.h" @@ -194,9 +192,7 @@ _mesa_delete_texture_object( GLcontext *ctx, struct gl_texture_object *texObj ) */ texObj->Target = 0x99; -#if FEATURE_colortable _mesa_free_colortable_data(&texObj->Palette); -#endif /* free the texture images */ for (face = 0; face < 6; face++) { @@ -495,7 +491,7 @@ _mesa_test_texobj_completeness( const GLcontext *ctx, t->Image[face][baseLevel]->Width2 != w || t->Image[face][baseLevel]->Height2 != h) { t->_Complete = GL_FALSE; - incomplete(t, "Non-quare cubemap image"); + incomplete(t, "Cube face missing or mismatched size"); return; } } diff --git a/src/mesa/main/texrender.c b/src/mesa/main/texrender.c index cc74d58fbd..53be83b05c 100644 --- a/src/mesa/main/texrender.c +++ b/src/mesa/main/texrender.c @@ -398,6 +398,14 @@ texture_put_mono_values(GLcontext *ctx, struct gl_renderbuffer *rb, static void +store_nop(struct gl_texture_image *texImage, + GLint col, GLint row, GLint img, + const void *texel) +{ +} + + +static void delete_texture_wrapper(struct gl_renderbuffer *rb) { ASSERT(rb->RefCount == 0); @@ -462,7 +470,10 @@ update_wrapper(GLcontext *ctx, const struct gl_renderbuffer_attachment *att) ASSERT(trb->TexImage); trb->Store = trb->TexImage->TexFormat->StoreTexel; - ASSERT(trb->Store); + if (!trb->Store) { + /* we'll never draw into some textures (compressed formats) */ + trb->Store = store_nop; + } if (att->Texture->Target == GL_TEXTURE_1D_ARRAY_EXT) { trb->Yoffset = att->Zoffset; diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c index 861c5f37c4..43f26873e0 100644 --- a/src/mesa/main/texstate.c +++ b/src/mesa/main/texstate.c @@ -31,9 +31,7 @@ #include "glheader.h" #include "mfeatures.h" #include "colormac.h" -#if FEATURE_colortable #include "colortab.h" -#endif #include "context.h" #include "enums.h" #include "macros.h" @@ -99,16 +97,22 @@ _mesa_copy_texture_state( const GLcontext *src, GLcontext *dst ) dst->Texture.Unit[u].BumpTarget = src->Texture.Unit[u].BumpTarget; COPY_4V(dst->Texture.Unit[u].RotMatrix, src->Texture.Unit[u].RotMatrix); + /* + * XXX strictly speaking, we should compare texture names/ids and + * bind textures in the dest context according to id. For now, only + * copy bindings if the contexts share the same pool of textures to + * avoid refcounting bugs. + */ + if (dst->Shared == src->Shared) { + /* copy texture object bindings, not contents of texture objects */ + _mesa_lock_context_textures(dst); - /* copy texture object bindings, not contents of texture objects */ - _mesa_lock_context_textures(dst); - - for (tex = 0; tex < NUM_TEXTURE_TARGETS; tex++) { - _mesa_reference_texobj(&dst->Texture.Unit[u].CurrentTex[tex], - src->Texture.Unit[u].CurrentTex[tex]); + for (tex = 0; tex < NUM_TEXTURE_TARGETS; tex++) { + _mesa_reference_texobj(&dst->Texture.Unit[u].CurrentTex[tex], + src->Texture.Unit[u].CurrentTex[tex]); + } + _mesa_unlock_context_textures(dst); } - - _mesa_unlock_context_textures(dst); } } @@ -753,9 +757,7 @@ _mesa_init_texture(GLcontext *ctx) ctx->Texture.CurrentUnit = 0; /* multitexture */ ctx->Texture._EnabledUnits = 0x0; ctx->Texture.SharedPalette = GL_FALSE; -#if FEATURE_colortable _mesa_init_colortable(&ctx->Texture.Palette); -#endif for (u = 0; u < MAX_TEXTURE_UNITS; u++) init_texture_unit(ctx, u); @@ -796,10 +798,8 @@ _mesa_free_texture_data(GLcontext *ctx) for (tgt = 0; tgt < NUM_TEXTURE_TARGETS; tgt++) ctx->Driver.DeleteTexture(ctx, ctx->Texture.ProxyTex[tgt]); -#if FEATURE_colortable for (u = 0; u < MAX_TEXTURE_IMAGE_UNITS; u++) _mesa_free_colortable_data(&ctx->Texture.Unit[u].ColorTable); -#endif } diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index ab9973b810..f553a898f9 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -56,9 +56,7 @@ #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" diff --git a/src/mesa/main/vtxfmt.c b/src/mesa/main/vtxfmt.c index 91412f138a..c9eea8ab83 100644 --- a/src/mesa/main/vtxfmt.c +++ b/src/mesa/main/vtxfmt.c @@ -27,12 +27,18 @@ */ #include "glheader.h" +#include "api_arrayelt.h" #include "api_loopback.h" #include "context.h" #include "imports.h" #include "mtypes.h" #include "state.h" #include "vtxfmt.h" +#include "eval.h" +#include "dlist.h" + + +#if FEATURE_beginend /* The neutral vertex format. This wraps all tnl module functions, @@ -82,18 +88,16 @@ static void install_vtxfmt( struct _glapi_table *tab, const GLvertexformat *vfmt ) { - SET_ArrayElement(tab, vfmt->ArrayElement); + _mesa_install_arrayelt_vtxfmt(tab, vfmt); + SET_Color3f(tab, vfmt->Color3f); SET_Color3fv(tab, vfmt->Color3fv); SET_Color4f(tab, vfmt->Color4f); SET_Color4fv(tab, vfmt->Color4fv); SET_EdgeFlag(tab, vfmt->EdgeFlag); - SET_EvalCoord1f(tab, vfmt->EvalCoord1f); - SET_EvalCoord1fv(tab, vfmt->EvalCoord1fv); - SET_EvalCoord2f(tab, vfmt->EvalCoord2f); - SET_EvalCoord2fv(tab, vfmt->EvalCoord2fv); - SET_EvalPoint1(tab, vfmt->EvalPoint1); - SET_EvalPoint2(tab, vfmt->EvalPoint2); + + _mesa_install_eval_vtxfmt(tab, vfmt); + SET_FogCoordfEXT(tab, vfmt->FogCoordfEXT); SET_FogCoordfvEXT(tab, vfmt->FogCoordfvEXT); SET_Indexf(tab, vfmt->Indexf); @@ -125,8 +129,9 @@ install_vtxfmt( struct _glapi_table *tab, const GLvertexformat *vfmt ) SET_Vertex3fv(tab, vfmt->Vertex3fv); SET_Vertex4f(tab, vfmt->Vertex4f); SET_Vertex4fv(tab, vfmt->Vertex4fv); - SET_CallList(tab, vfmt->CallList); - SET_CallLists(tab, vfmt->CallLists); + + _mesa_install_dlist_vtxfmt(tab, vfmt); + SET_Begin(tab, vfmt->Begin); SET_End(tab, vfmt->End); SET_Rectf(tab, vfmt->Rectf); @@ -137,9 +142,6 @@ install_vtxfmt( struct _glapi_table *tab, const GLvertexformat *vfmt ) SET_DrawElementsBaseVertex(tab, vfmt->DrawElementsBaseVertex); SET_DrawRangeElementsBaseVertex(tab, vfmt->DrawRangeElementsBaseVertex); SET_MultiDrawElementsBaseVertex(tab, vfmt->MultiDrawElementsBaseVertex); - SET_EvalMesh1(tab, vfmt->EvalMesh1); - SET_EvalMesh2(tab, vfmt->EvalMesh2); - ASSERT(tab->EvalMesh2); /* GL_NV_vertex_program */ SET_VertexAttrib1fNV(tab, vfmt->VertexAttrib1fNV); @@ -196,3 +198,6 @@ void _mesa_restore_exec_vtxfmt( GLcontext *ctx ) tnl->SwapCount = 0; } + + +#endif /* FEATURE_beginend */ diff --git a/src/mesa/main/vtxfmt.h b/src/mesa/main/vtxfmt.h index 76f108e023..fb6c23abe9 100644 --- a/src/mesa/main/vtxfmt.h +++ b/src/mesa/main/vtxfmt.h @@ -33,6 +33,8 @@ #ifndef _VTXFMT_H_ #define _VTXFMT_H_ +#if FEATURE_beginend + extern void _mesa_init_exec_vtxfmt( GLcontext *ctx ); extern void _mesa_install_exec_vtxfmt( GLcontext *ctx, const GLvertexformat *vfmt ); @@ -40,4 +42,28 @@ extern void _mesa_install_save_vtxfmt( GLcontext *ctx, const GLvertexformat *vfm extern void _mesa_restore_exec_vtxfmt( GLcontext *ctx ); -#endif +#else /* FEATURE_beginend */ + +static INLINE void +_mesa_init_exec_vtxfmt( GLcontext *ctx ) +{ +} + +static INLINE void +_mesa_install_exec_vtxfmt( GLcontext *ctx, const GLvertexformat *vfmt ) +{ +} + +static INLINE void +_mesa_install_save_vtxfmt( GLcontext *ctx, const GLvertexformat *vfmt ) +{ +} + +static INLINE void +_mesa_restore_exec_vtxfmt( GLcontext *ctx ) +{ +} + +#endif /* FEATURE_beginend */ + +#endif /* _VTXFMT_H_ */ |