intelInitDriverFunctions(struct dd_function_table *functions)
{
_mesa_init_driver_functions(functions);
+ _tnl_init_driver_draw_function(functions);
functions->Flush = intel_glFlush;
functions->Finish = intelFinish;
_mesa_enum_to_string(ctx->RenderMode));
_swsetup_Wakeup(ctx);
_tnl_wakeup(ctx);
- _tnl_draw_prims(ctx, prims, nr_prims, ib,
- index_bounds_valid, min_index, max_index, NULL, 0, NULL);
+ _tnl_draw(ctx, prims, nr_prims, ib,
+ index_bounds_valid, min_index, max_index, NULL, 0, NULL);
return;
}
/* Initialize the function pointers. */
_mesa_init_driver_functions(&functions);
+ _tnl_init_driver_draw_function(&functions);
nouveau_driver_functions_init(&functions);
nouveau_bufferobj_functions_init(&functions);
nouveau_texture_functions_init(&functions);
tfb_vertcount, stream, indirect);
}
+static void
+TAG(vbo_draw)(struct gl_context *ctx,
+ const struct _mesa_prim *prims, GLuint nr_prims,
+ const struct _mesa_index_buffer *ib,
+ GLboolean index_bounds_valid,
+ GLuint min_index, GLuint max_index,
+ struct gl_transform_feedback_object *tfb_vertcount,
+ unsigned stream,
+ struct gl_buffer_object *indirect)
+{
+ /* Borrow and update the inputs list from the tnl context */
+ _tnl_bind_inputs(ctx);
+
+ TAG(vbo_check_render_prims)(ctx, prims, nr_prims, ib,
+ index_bounds_valid, min_index, max_index,
+ tfb_vertcount, stream, indirect);
+}
+
void
TAG(vbo_init)(struct gl_context *ctx)
{
for (i = 0; i < VERT_ATTRIB_MAX; i++)
render->map[i] = -1;
- vbo_set_draw_func(ctx, TAG(vbo_check_render_prims));
+ /* Overwrite our draw function */
+ ctx->Driver.Draw = TAG(vbo_draw);
vbo_use_buffer_objects(ctx);
}
* (the texture functions are especially important)
*/
_mesa_init_driver_functions(&functions);
+ _tnl_init_driver_draw_function(&functions);
r200InitDriverFuncs(&functions);
r200InitIoctlFuncs(&functions);
r200InitStateFuncs(&rmesa->radeon, &functions);
* (the texture functions are especially important)
*/
_mesa_init_driver_functions( &functions );
+ _tnl_init_driver_draw_function( &functions );
radeonInitTextureFuncs( &rmesa->radeon, &functions );
radeonInitQueryObjFunctions(&functions);
/* build table of device driver functions */
_mesa_init_driver_functions(&functions);
swrast_init_driver_functions(&functions);
+ _tnl_init_driver_draw_function(&functions);
if (share) {
sharedCtx = &share->Base;
/* Initialize device driver function table */
_mesa_init_driver_functions(&functions);
+ _tnl_init_driver_draw_function(&functions);
/* override with our functions */
functions.GetString = get_string;
functions.UpdateState = osmesa_update_state_wrapper;
/* initialize with default driver functions, then plug in XMesa funcs */
_mesa_init_driver_functions(&functions);
+ _tnl_init_driver_draw_function(&functions);
xmesa_init_driver_functions(v, &functions);
if (!_mesa_initialize_context(mesaCtx, API_OPENGL_COMPAT, &v->mesa_visual,
share_list ? &(share_list->mesa) : (struct gl_context *) NULL,
insert_at_tail( tnl->_ShineTabList, s );
}
- /* plug in the VBO drawing function */
- vbo_set_draw_func(ctx, _tnl_draw_prims);
-
_math_init_transformation();
_math_init_translate();
+ /* Keep our list of gl_vertex_array inputs */
+ _vbo_init_inputs(&tnl->draw_arrays);
+
return GL_TRUE;
}
struct tnl_shine_tab *_ShineTable[2]; /**< Active shine tables */
struct tnl_shine_tab *_ShineTabList; /**< MRU list of inactive shine tables */
/**@}*/
+
+ /* The list of gl_vertex_array inputs. */
+ struct vbo_inputs draw_arrays;
} TNLcontext;
#include "main/mtypes.h"
#include "main/macros.h"
#include "main/enums.h"
+#include "main/varray.h"
#include "util/half_float.h"
#include "t_context.h"
}
-/* This is the main entrypoint into the slimmed-down software tnl
- * module. In a regular swtnl driver, this can be plugged straight
- * into the vbo->Driver.DrawPrims() callback.
+/* This is the main workhorse doing all the rendering work.
*/
void _tnl_draw_prims(struct gl_context *ctx,
const struct _mesa_prim *prim,
}
}
+
+void
+_tnl_bind_inputs( struct gl_context *ctx )
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ _mesa_set_drawing_arrays(ctx, tnl->draw_arrays.inputs);
+ _vbo_update_inputs(ctx, &tnl->draw_arrays);
+}
+
+
+/* This is the main entrypoint into the slimmed-down software tnl
+ * module. In a regular swtnl driver, this can be plugged straight
+ * into the ctx->Driver.Draw() callback.
+ */
+void
+_tnl_draw(struct gl_context *ctx,
+ const struct _mesa_prim *prim, GLuint nr_prims,
+ const struct _mesa_index_buffer *ib,
+ GLboolean index_bounds_valid, GLuint min_index, GLuint max_index,
+ struct gl_transform_feedback_object *tfb_vertcount,
+ unsigned stream, struct gl_buffer_object *indirect)
+{
+ /* Update TNLcontext::draw_arrays and set that pointer
+ * into Array._DrawArrays.
+ */
+ _tnl_bind_inputs(ctx);
+
+ _tnl_draw_prims(ctx, prim, nr_prims, ib, index_bounds_valid,
+ min_index, max_index, tfb_vertcount, stream, indirect);
+}
+
+
+void
+_tnl_init_driver_draw_function(struct dd_function_table *functions)
+{
+ functions->Draw = _tnl_draw;
+}
extern void
_tnl_InvalidateState( struct gl_context *ctx, GLuint new_state );
+extern void
+_tnl_init_driver_draw_function(struct dd_function_table *functions);
+
/* Functions to revive the tnl module after being unhooked from
* dispatch and/or driver callbacks.
*/
extern void
_tnl_need_projected_coords( struct gl_context *ctx, GLboolean flag );
+extern void
+_tnl_bind_inputs( struct gl_context *ctx );
+
/* Control whether T&L does per-vertex fog
*/
unsigned stream,
struct gl_buffer_object *indirect );
+void
+_tnl_draw(struct gl_context *ctx,
+ const struct _mesa_prim *prim, GLuint nr_prims,
+ const struct _mesa_index_buffer *ib,
+ GLboolean index_bounds_valid, GLuint min_index, GLuint max_index,
+ struct gl_transform_feedback_object *tfb_vertcount, unsigned stream,
+ struct gl_buffer_object *indirect);
+
extern void
_tnl_RasterPos(struct gl_context *ctx, const GLfloat vObj[4]);