diff options
author | Chia-I Wu <[email protected]> | 2010-08-25 15:11:03 +0800 |
---|---|---|
committer | Chia-I Wu <[email protected]> | 2010-08-25 16:06:45 +0800 |
commit | 22f6026324f63c142925244ff575fefc29a90389 (patch) | |
tree | 27be867272e6799cfa6d5ff153ce84e5b693a914 /src/gallium/auxiliary/draw | |
parent | 94e8d4171d9647db84cd53334a2b14fab062640d (diff) |
gallium: Use draw_set_index_buffer and others.
Update all drivers to use draw_set_index_buffer,
draw_set_mapped_index_buffer, and draw_vbo. Remove
draw_set_mapped_element_buffer and draw_set_mapped_element_buffer_range.
Diffstat (limited to 'src/gallium/auxiliary/draw')
-rw-r--r-- | src/gallium/auxiliary/draw/draw_context.c | 42 | ||||
-rw-r--r-- | src/gallium/auxiliary/draw/draw_context.h | 13 | ||||
-rw-r--r-- | src/gallium/auxiliary/draw/draw_pt.c | 8 |
3 files changed, 4 insertions, 59 deletions
diff --git a/src/gallium/auxiliary/draw/draw_context.c b/src/gallium/auxiliary/draw/draw_context.c index c2b7a441bd7..b39b835f052 100644 --- a/src/gallium/auxiliary/draw/draw_context.c +++ b/src/gallium/auxiliary/draw/draw_context.c @@ -518,48 +518,6 @@ draw_set_mapped_index_buffer(struct draw_context *draw, } -/** - * Tell the drawing context about the index/element buffer to use - * (ala glDrawElements) - * If no element buffer is to be used (i.e. glDrawArrays) then this - * should be called with eltSize=0 and elements=NULL. - * - * \param draw the drawing context - * \param eltSize size of each element (1, 2 or 4 bytes) - * \param elements the element buffer ptr - */ -void -draw_set_mapped_element_buffer_range( struct draw_context *draw, - unsigned eltSize, - int eltBias, - unsigned min_index, - unsigned max_index, - const void *elements ) -{ - struct pipe_index_buffer ib; - - memset(&ib, 0, sizeof(ib)); - ib.index_size = eltSize; - draw_set_index_buffer(draw, &ib); - - draw->pt.user.elts = elements; - draw->pt.user.eltBias = eltBias; - draw->pt.user.min_index = min_index; - draw->pt.user.max_index = max_index; -} - - -void -draw_set_mapped_element_buffer( struct draw_context *draw, - unsigned eltSize, - int eltBias, - const void *elements ) -{ - draw_set_mapped_element_buffer_range(draw, - eltSize, eltBias, 0, 0xffffffff, elements); -} - - /* Revamp me please: */ void draw_do_flush( struct draw_context *draw, unsigned flags ) diff --git a/src/gallium/auxiliary/draw/draw_context.h b/src/gallium/auxiliary/draw/draw_context.h index e9f3237dda3..ea55320c427 100644 --- a/src/gallium/auxiliary/draw/draw_context.h +++ b/src/gallium/auxiliary/draw/draw_context.h @@ -166,19 +166,6 @@ void draw_set_index_buffer(struct draw_context *draw, void draw_set_mapped_index_buffer(struct draw_context *draw, const void *elements); -void -draw_set_mapped_element_buffer_range( struct draw_context *draw, - unsigned eltSize, - int eltBias, - unsigned min_index, - unsigned max_index, - const void *elements ); - -void draw_set_mapped_element_buffer( struct draw_context *draw, - unsigned eltSize, - int eltBias, - const void *elements ); - void draw_set_mapped_vertex_buffer(struct draw_context *draw, unsigned attr, const void *buffer); diff --git a/src/gallium/auxiliary/draw/draw_pt.c b/src/gallium/auxiliary/draw/draw_pt.c index 8db0d736623..f81714d6b48 100644 --- a/src/gallium/auxiliary/draw/draw_pt.c +++ b/src/gallium/auxiliary/draw/draw_pt.c @@ -299,7 +299,6 @@ draw_arrays(struct draw_context *draw, unsigned prim, /** * Instanced drawing. - * draw_set_mapped_element_buffer must be called before calling this function. * \sa draw_vbo */ void @@ -321,9 +320,10 @@ draw_arrays_instanced(struct draw_context *draw, info.instance_count = instanceCount; info.indexed = (draw->pt.user.elts != NULL); - info.index_bias = draw->pt.user.eltBias; - info.min_index = draw->pt.user.min_index; - info.max_index = draw->pt.user.max_index; + if (!info.indexed) { + info.min_index = start; + info.max_index = start + count - 1; + } draw_vbo(draw, &info); } |