From: Michal Krol Date: Thu, 14 Jan 2010 17:11:41 +0000 (+0100) Subject: Merge branch 'instanced-arrays' X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5184b02b0793136a15b7edf309d79a1efe1bc73d;p=mesa.git Merge branch 'instanced-arrays' Conflicts: src/gallium/drivers/softpipe/sp_draw_arrays.c --- 5184b02b0793136a15b7edf309d79a1efe1bc73d diff --cc src/gallium/drivers/softpipe/sp_draw_arrays.c index 03d35fb3cb5,b3ece9d8ed3..2a27e5ce64d --- a/src/gallium/drivers/softpipe/sp_draw_arrays.c +++ b/src/gallium/drivers/softpipe/sp_draw_arrays.c @@@ -98,26 -98,133 +98,133 @@@ softpipe_unmap_constant_buffers(struct } + /** + * Draw vertex arrays, with optional indexing. + * Basically, map the vertex buffers (and drawing surfaces), then hand off + * the drawing to the 'draw' module. + */ -static boolean ++static void + softpipe_draw_range_elements_instanced(struct pipe_context *pipe, + struct pipe_buffer *indexBuffer, + unsigned indexSize, + unsigned minIndex, + unsigned maxIndex, + unsigned mode, + unsigned start, + unsigned count, + unsigned startInstance, + unsigned instanceCount); + + -boolean +void softpipe_draw_arrays(struct pipe_context *pipe, unsigned mode, unsigned start, unsigned count) { - softpipe_draw_elements(pipe, NULL, 0, mode, start, count); - return softpipe_draw_range_elements_instanced(pipe, - NULL, - 0, - 0, - 0xffffffff, - mode, - start, - count, - 0, - 1); ++ softpipe_draw_range_elements_instanced(pipe, ++ NULL, ++ 0, ++ 0, ++ 0xffffffff, ++ mode, ++ start, ++ count, ++ 0, ++ 1); } - /** - * Draw vertex arrays, with optional indexing. - * Basically, map the vertex buffers (and drawing surfaces), then hand off - * the drawing to the 'draw' module. - */ -boolean +void softpipe_draw_range_elements(struct pipe_context *pipe, struct pipe_buffer *indexBuffer, unsigned indexSize, unsigned min_index, unsigned max_index, unsigned mode, unsigned start, unsigned count) + { - return softpipe_draw_range_elements_instanced(pipe, - indexBuffer, - indexSize, - min_index, - max_index, - mode, - start, - count, - 0, - 1); ++ softpipe_draw_range_elements_instanced(pipe, ++ indexBuffer, ++ indexSize, ++ min_index, ++ max_index, ++ mode, ++ start, ++ count, ++ 0, ++ 1); + } + + -boolean ++void + softpipe_draw_elements(struct pipe_context *pipe, + struct pipe_buffer *indexBuffer, + unsigned indexSize, + unsigned mode, unsigned start, unsigned count) + { - return softpipe_draw_range_elements_instanced(pipe, - indexBuffer, - indexSize, - 0, - 0xffffffff, - mode, - start, - count, - 0, - 1); ++ softpipe_draw_range_elements_instanced(pipe, ++ indexBuffer, ++ indexSize, ++ 0, ++ 0xffffffff, ++ mode, ++ start, ++ count, ++ 0, ++ 1); + } + + void + softpipe_draw_arrays_instanced(struct pipe_context *pipe, + unsigned mode, + unsigned start, + unsigned count, + unsigned startInstance, + unsigned instanceCount) + { + softpipe_draw_range_elements_instanced(pipe, + NULL, + 0, + 0, + 0xffffffff, + mode, + start, + count, + startInstance, + instanceCount); + } + + void + softpipe_draw_elements_instanced(struct pipe_context *pipe, + struct pipe_buffer *indexBuffer, + unsigned indexSize, + unsigned mode, + unsigned start, + unsigned count, + unsigned startInstance, + unsigned instanceCount) + { + softpipe_draw_range_elements_instanced(pipe, + indexBuffer, + indexSize, + 0, + 0xffffffff, + mode, + start, + count, + startInstance, + instanceCount); + } + -static boolean ++static void + softpipe_draw_range_elements_instanced(struct pipe_context *pipe, + struct pipe_buffer *indexBuffer, + unsigned indexSize, + unsigned minIndex, + unsigned maxIndex, + unsigned mode, + unsigned start, + unsigned count, + unsigned startInstance, + unsigned instanceCount) { struct softpipe_context *sp = softpipe_context(pipe); struct draw_context *draw = sp->draw; @@@ -181,17 -290,6 +290,4 @@@ softpipe_unmap_constant_buffers(sp); sp->dirty_render_cache = TRUE; - - return TRUE; } - - - void - softpipe_draw_elements(struct pipe_context *pipe, - struct pipe_buffer *indexBuffer, - unsigned indexSize, - unsigned mode, unsigned start, unsigned count) - { - softpipe_draw_range_elements( pipe, indexBuffer, - indexSize, - 0, 0xffffffff, - mode, start, count ); - } diff --cc src/gallium/include/pipe/p_context.h index d2f8085b421,f2242d20694..497b35a6807 --- a/src/gallium/include/pipe/p_context.h +++ b/src/gallium/include/pipe/p_context.h @@@ -61,14 -61,30 +61,30 @@@ struct pipe_context * VBO drawing (return false on fallbacks (temporary??)) */ /*@{*/ - boolean (*draw_arrays)( struct pipe_context *pipe, - unsigned mode, unsigned start, unsigned count); + void (*draw_arrays)( struct pipe_context *pipe, + unsigned mode, unsigned start, unsigned count); - boolean (*draw_elements)( struct pipe_context *pipe, - struct pipe_buffer *indexBuffer, - unsigned indexSize, - unsigned mode, unsigned start, unsigned count); + void (*draw_elements)( struct pipe_context *pipe, + struct pipe_buffer *indexBuffer, + unsigned indexSize, + unsigned mode, unsigned start, unsigned count); + void (*draw_arrays_instanced)(struct pipe_context *pipe, + unsigned mode, + unsigned start, + unsigned count, + unsigned startInstance, + unsigned instanceCount); + + void (*draw_elements_instanced)(struct pipe_context *pipe, + struct pipe_buffer *indexBuffer, + unsigned indexSize, + unsigned mode, + unsigned start, + unsigned count, + unsigned startInstance, + unsigned instanceCount); + /* XXX: this is (probably) a temporary entrypoint, as the range * information should be available from the vertex_buffer state. * Using this to quickly evaluate a specialized path in the draw