X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fgallium%2Fauxiliary%2Fdraw%2Fdraw_vbuf.h;h=6e737ae5b7527359fb2fdc7844b8ff1c7f69e434;hb=8aacaeca685c4e705a3237c2187f2f9bcef23339;hp=e90f37872a11cc61bcb44ca512129a342ebc2adf;hpb=62767cf2dd1006621ecd6023b15d65b5cff41dfa;p=mesa.git diff --git a/src/gallium/auxiliary/draw/draw_vbuf.h b/src/gallium/auxiliary/draw/draw_vbuf.h index e90f37872a1..6e737ae5b75 100644 --- a/src/gallium/auxiliary/draw/draw_vbuf.h +++ b/src/gallium/auxiliary/draw/draw_vbuf.h @@ -1,6 +1,6 @@ /************************************************************************** * - * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. + * Copyright 2007 VMware, Inc. * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a @@ -18,7 +18,7 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. - * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR + * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. @@ -29,19 +29,22 @@ * \file * Vertex buffer drawing stage. * - * \author Keith Whitwell - * \author José Fonseca + * \author Keith Whitwell + * \author Jose Fonseca */ #ifndef DRAW_VBUF_H_ #define DRAW_VBUF_H_ -#include "pipe/p_util.h" +#include "pipe/p_compiler.h" +#include "pipe/p_defines.h" +struct pipe_rasterizer_state; struct draw_context; struct vertex_info; +struct pipe_query_data_pipeline_statistics; /** @@ -56,6 +59,17 @@ struct vbuf_render { unsigned max_indices; unsigned max_vertex_buffer_bytes; + /** + * Query if the hardware driver needs assistance for a particular + * combination of rasterizer state and primitive. + * + * Currently optional. + */ + boolean (*need_pipeline)(const struct vbuf_render *render, + const struct pipe_rasterizer_state *rasterizer, + unsigned int prim ); + + /** * Get the hardware vertex format. * @@ -68,9 +82,14 @@ struct vbuf_render { * Hardware renderers will use ttm memory, others will just malloc * something. */ - void *(*allocate_vertices)( struct vbuf_render *, - ushort vertex_size, - ushort nr_vertices ); + boolean (*allocate_vertices)( struct vbuf_render *, + ushort vertex_size, + ushort nr_vertices ); + + void *(*map_vertices)( struct vbuf_render * ); + void (*unmap_vertices)( struct vbuf_render *, + ushort min_index, + ushort max_index ); /** * Notify the renderer of the current primitive when it changes. @@ -78,16 +97,17 @@ struct vbuf_render { * the discretion of the driver, for the benefit of the passthrough * path. */ - boolean (*set_primitive)( struct vbuf_render *, unsigned prim ); + void (*set_primitive)( struct vbuf_render *, enum pipe_prim_type prim ); /** - * DrawElements, note indices are ushort: + * Draw indexed primitives. Note that indices are ushort. The driver + * must complete this call, if necessary splitting the index list itself. */ - void (*draw)( struct vbuf_render *, - const ushort *indices, - uint nr_indices ); + void (*draw_elements)( struct vbuf_render *, + const ushort *indices, + uint nr_indices ); - /* Draw Arrays path too. + /* Draw non-indexed primitives. */ void (*draw_arrays)( struct vbuf_render *, unsigned start, @@ -96,12 +116,25 @@ struct vbuf_render { /** * Called when vbuf is done with this set of vertices: */ - void (*release_vertices)( struct vbuf_render *, - void *vertices, - unsigned vertex_size, - unsigned vertices_used ); + void (*release_vertices)( struct vbuf_render * ); void (*destroy)( struct vbuf_render * ); + + + /** + * Called after writing data to the stream out buffers + */ + void (*set_stream_output_info)( struct vbuf_render *vbufr, + unsigned stream, + unsigned primitive_count, + unsigned primitive_generated ); + + /** + * Called after all relevant statistics have been accumulated. + */ + void (*pipeline_statistics)( + struct vbuf_render *vbufr, + const struct pipe_query_data_pipeline_statistics *stats ); };