mesa/main: New feature FEATURE_arrayelt.
This allows the removal of AEcontext.
This commit is contained in:
@@ -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 */
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -992,7 +992,8 @@ _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;
|
||||
|
||||
@@ -9291,7 +9291,8 @@ 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;
|
||||
|
||||
@@ -69,11 +69,12 @@
|
||||
*/
|
||||
|
||||
#define FEATURE_accum _HAVE_FULL_GL
|
||||
#define FEATURE_arrayelt _HAVE_FULL_GL
|
||||
#define FEATURE_attrib_stack _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)
|
||||
#define FEATURE_draw_read_buffer _HAVE_FULL_GL
|
||||
#define FEATURE_drawpix _HAVE_FULL_GL
|
||||
#define FEATURE_evaluators _HAVE_FULL_GL
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
*/
|
||||
|
||||
#include "glheader.h"
|
||||
#include "api_arrayelt.h"
|
||||
#include "api_loopback.h"
|
||||
#include "context.h"
|
||||
#include "imports.h"
|
||||
@@ -82,7 +83,8 @@
|
||||
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);
|
||||
|
||||
@@ -557,7 +557,8 @@ static void vbo_exec_vtxfmt_init( struct vbo_exec_context *exec )
|
||||
{
|
||||
GLvertexformat *vfmt = &exec->vtxfmt;
|
||||
|
||||
vfmt->ArrayElement = _ae_loopback_array_elt; /* generic helper */
|
||||
_MESA_INIT_ARRAYELT_VTXFMT(vfmt, _ae_);
|
||||
|
||||
vfmt->Begin = vbo_exec_Begin;
|
||||
#if FEATURE_dlist
|
||||
vfmt->CallList = _mesa_CallList;
|
||||
|
||||
@@ -988,7 +988,8 @@ static void _save_vtxfmt_init( GLcontext *ctx )
|
||||
struct vbo_save_context *save = &vbo_context(ctx)->save;
|
||||
GLvertexformat *vfmt = &save->vtxfmt;
|
||||
|
||||
vfmt->ArrayElement = _ae_loopback_array_elt; /* generic helper */
|
||||
_MESA_INIT_ARRAYELT_VTXFMT(vfmt, _ae_);
|
||||
|
||||
vfmt->Begin = _save_Begin;
|
||||
vfmt->Color3f = _save_Color3f;
|
||||
vfmt->Color3fv = _save_Color3fv;
|
||||
|
||||
Reference in New Issue
Block a user