mesa/main: New feature FEATURE_beginend.

This feature corresponds to the Begin/End paradigm.  Disabling this
feature also eliminates the use of GLvertexformat completely.
This commit is contained in:
Chia-I Wu
2009-09-12 18:59:13 +08:00
committed by Brian Paul
parent a73ba2d31b
commit cef97267d6
10 changed files with 184 additions and 10 deletions
+7
View File
@@ -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 */
+12 -4
View File
@@ -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 */
+6
View File
@@ -43,6 +43,9 @@
*/
#if FEATURE_beginend
static void GLAPIENTRY _mesa_noop_EdgeFlag( GLboolean b )
{
GET_CURRENT_CONTEXT(ctx);
@@ -1064,3 +1067,6 @@ _mesa_noop_vtxfmt_init( GLvertexformat *vfmt )
vfmt->DrawRangeElementsBaseVertex = _mesa_noop_DrawRangeElementsBaseVertex;
vfmt->MultiDrawElementsBaseVertex = _mesa_noop_MultiDrawElementsBaseVertex;
}
#endif /* FEATURE_beginend */
+6 -3
View File
@@ -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 */
+3 -1
View File
@@ -71,10 +71,12 @@
#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 && FEATURE_arrayelt)
#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
+6
View File
@@ -38,6 +38,9 @@
#include "dlist.h"
#if FEATURE_beginend
/* The neutral vertex format. This wraps all tnl module functions,
* verifying that the currently-installed module is valid and then
* installing the function pointers in a lazy fashion. It records the
@@ -195,3 +198,6 @@ void _mesa_restore_exec_vtxfmt( GLcontext *ctx )
tnl->SwapCount = 0;
}
#endif /* FEATURE_beginend */
+27 -1
View File
@@ -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_ */
+18
View File
@@ -161,8 +161,26 @@ void vbo_exec_array_destroy( struct vbo_exec_context *exec );
void vbo_exec_vtx_init( struct vbo_exec_context *exec );
void vbo_exec_vtx_destroy( struct vbo_exec_context *exec );
#if FEATURE_beginend
void vbo_exec_vtx_flush( struct vbo_exec_context *exec, GLboolean unmap );
void vbo_exec_vtx_map( struct vbo_exec_context *exec );
#else /* FEATURE_beginend */
static INLINE void
vbo_exec_vtx_flush( struct vbo_exec_context *exec, GLboolean unmap )
{
}
static INLINE void
vbo_exec_vtx_map( struct vbo_exec_context *exec )
{
}
#endif /* FEATURE_beginend */
void vbo_exec_vtx_wrap( struct vbo_exec_context *exec );
void vbo_exec_eval_update( struct vbo_exec_context *exec );
+93 -1
View File
@@ -348,7 +348,7 @@ static void vbo_exec_fixup_vertex( GLcontext *ctx,
}
#if FEATURE_beginend
/*
*/
@@ -635,6 +635,98 @@ static void vbo_exec_vtxfmt_init( struct vbo_exec_context *exec )
}
#else /* FEATURE_beginend */
#define ATTR( A, N, V0, V1, V2, V3 ) \
do { \
struct vbo_exec_context *exec = &vbo_context(ctx)->exec; \
\
/* FLUSH_UPDATE_CURRENT needs to be set manually */ \
exec->ctx->Driver.NeedFlush |= FLUSH_UPDATE_CURRENT; \
\
if (exec->vtx.active_sz[A] != N) \
vbo_exec_fixup_vertex(ctx, A, N); \
\
{ \
GLfloat *dest = exec->vtx.attrptr[A]; \
if (N>0) dest[0] = V0; \
if (N>1) dest[1] = V1; \
if (N>2) dest[2] = V2; \
if (N>3) dest[3] = V3; \
} \
} while (0)
#define ERROR() _mesa_error( ctx, GL_INVALID_ENUM, __FUNCTION__ )
#define TAG(x) vbo_##x
#include "vbo_attrib_tmp.h"
static void vbo_exec_vtxfmt_init( struct vbo_exec_context *exec )
{
/* silence warnings */
(void) vbo_Color3f;
(void) vbo_Color3fv;
(void) vbo_Color4f;
(void) vbo_Color4fv;
(void) vbo_FogCoordfEXT;
(void) vbo_FogCoordfvEXT;
(void) vbo_MultiTexCoord1f;
(void) vbo_MultiTexCoord1fv;
(void) vbo_MultiTexCoord2f;
(void) vbo_MultiTexCoord2fv;
(void) vbo_MultiTexCoord3f;
(void) vbo_MultiTexCoord3fv;
(void) vbo_MultiTexCoord4f;
(void) vbo_MultiTexCoord4fv;
(void) vbo_Normal3f;
(void) vbo_Normal3fv;
(void) vbo_SecondaryColor3fEXT;
(void) vbo_SecondaryColor3fvEXT;
(void) vbo_TexCoord1f;
(void) vbo_TexCoord1fv;
(void) vbo_TexCoord2f;
(void) vbo_TexCoord2fv;
(void) vbo_TexCoord3f;
(void) vbo_TexCoord3fv;
(void) vbo_TexCoord4f;
(void) vbo_TexCoord4fv;
(void) vbo_Vertex2f;
(void) vbo_Vertex2fv;
(void) vbo_Vertex3f;
(void) vbo_Vertex3fv;
(void) vbo_Vertex4f;
(void) vbo_Vertex4fv;
(void) vbo_VertexAttrib1fARB;
(void) vbo_VertexAttrib1fvARB;
(void) vbo_VertexAttrib2fARB;
(void) vbo_VertexAttrib2fvARB;
(void) vbo_VertexAttrib3fARB;
(void) vbo_VertexAttrib3fvARB;
(void) vbo_VertexAttrib4fARB;
(void) vbo_VertexAttrib4fvARB;
(void) vbo_VertexAttrib1fNV;
(void) vbo_VertexAttrib1fvNV;
(void) vbo_VertexAttrib2fNV;
(void) vbo_VertexAttrib2fvNV;
(void) vbo_VertexAttrib3fNV;
(void) vbo_VertexAttrib3fvNV;
(void) vbo_VertexAttrib4fNV;
(void) vbo_VertexAttrib4fvNV;
(void) vbo_Materialfv;
(void) vbo_EdgeFlag;
(void) vbo_Indexf;
(void) vbo_Indexfv;
}
#endif /* FEATURE_beginend */
/**
* Tell the VBO module to use a real OpenGL vertex buffer object to
* store accumulated immediate-mode vertex data.
+6
View File
@@ -35,6 +35,9 @@
#include "vbo_context.h"
#if FEATURE_beginend
static void
vbo_exec_debug_verts( struct vbo_exec_context *exec )
{
@@ -411,3 +414,6 @@ vbo_exec_vtx_flush( struct vbo_exec_context *exec, GLboolean unmap )
exec->vtx.prim_count = 0;
exec->vtx.vert_count = 0;
}
#endif /* FEATURE_beginend */