diff options
author | Francisco Jerez <currojerez@riseup.net> | 2010-11-10 20:18:33 +0100 |
---|---|---|
committer | Francisco Jerez <currojerez@riseup.net> | 2010-11-11 14:50:50 +0100 |
commit | cdb38b5d3d1b93a90a91ad06c0f03efdfde6b525 (patch) | |
tree | 1ebfc5ddf9b1b1c11e1e7e08c8204e05507195bd /src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c | |
parent | dc524adee2cfd0f115800cd4ec3f8384010f154e (diff) |
dri/nouveau: Split hardware/software TNL instantiation more cleanly.
Diffstat (limited to 'src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c')
-rw-r--r-- | src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c b/src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c index 3d8f43ffb4..7a0eb9fc23 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c @@ -456,3 +456,44 @@ TAG(vbo_render_prims)(struct gl_context *ctx, vbo_deinit_arrays(ctx, ib, arrays); } + +/* VBO rendering entry points. */ + +static void +TAG(vbo_check_render_prims)(struct gl_context *ctx, + const struct gl_client_array **arrays, + 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 nouveau_context *nctx = to_nouveau_context(ctx); + + nouveau_validate_framebuffer(ctx); + + if (nctx->fallback == HWTNL) + TAG(vbo_render_prims)(ctx, arrays, prims, nr_prims, ib, + index_bounds_valid, min_index, max_index); + + if (nctx->fallback == SWTNL) + _tnl_vbo_draw_prims(ctx, arrays, prims, nr_prims, ib, + index_bounds_valid, min_index, max_index); +} + +void +TAG(vbo_init)(struct gl_context *ctx) +{ + struct nouveau_render_state *render = to_render_state(ctx); + int i; + + for (i = 0; i < VERT_ATTRIB_MAX; i++) + render->map[i] = -1; + + vbo_set_draw_func(ctx, TAG(vbo_check_render_prims)); + vbo_use_buffer_objects(ctx); +} + +void +TAG(vbo_destroy)(struct gl_context *ctx) +{ +} |