diff options
author | Brian <brian.paul@tungstengraphics.com> | 2007-11-08 17:07:12 -0700 |
---|---|---|
committer | Brian <brian.paul@tungstengraphics.com> | 2007-11-08 17:07:12 -0700 |
commit | 64469863212dcc41995c473032856096c4af12b3 (patch) | |
tree | 9b8ff1218b90fbeb3f056cf1713537dddb731c94 /src/mesa/pipe/draw/draw_vertex_cache.c | |
parent | 990fe4c0bf735206c3cc7346d84adc782595bc3a (diff) |
Reorganize user-space vertex fields in draw_context into 'user' group.
This sub-struct collects the incoming user-provided data/pointers in one place.
Ex: draw->mapped_vbuffer becomes draw->user.vbuffer, etc.
Diffstat (limited to 'src/mesa/pipe/draw/draw_vertex_cache.c')
-rw-r--r-- | src/mesa/pipe/draw/draw_vertex_cache.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/mesa/pipe/draw/draw_vertex_cache.c b/src/mesa/pipe/draw/draw_vertex_cache.c index 6689907ddf..29993f14d2 100644 --- a/src/mesa/pipe/draw/draw_vertex_cache.c +++ b/src/mesa/pipe/draw/draw_vertex_cache.c @@ -51,8 +51,15 @@ void draw_vertex_cache_invalidate( struct draw_context *draw ) } -/* Check if vertex is in cache, otherwise add it. It won't go through +/** + * Check if vertex is in cache, otherwise add it. It won't go through * VS yet, not until there is a flush operation or the VS queue fills up. + * + * Note that cache entries are basically just two pointers: the first + * an index into the user's vertex arrays, the second a location in + * the vertex shader cache for the post-transformed vertex. + * + * \return pointer to location of (post-transformed) vertex header in the cache */ static struct vertex_header *get_vertex( struct draw_context *draw, unsigned i ) @@ -104,7 +111,7 @@ static struct vertex_header *get_vertex( struct draw_context *draw, static struct vertex_header *get_uint_elt_vertex( struct draw_context *draw, unsigned i ) { - const unsigned *elts = (const unsigned *) draw->mapped_elts; + const unsigned *elts = (const unsigned *) draw->user.elts; return get_vertex( draw, elts[i] ); } @@ -112,7 +119,7 @@ static struct vertex_header *get_uint_elt_vertex( struct draw_context *draw, static struct vertex_header *get_ushort_elt_vertex( struct draw_context *draw, unsigned i ) { - const ushort *elts = (const ushort *) draw->mapped_elts; + const ushort *elts = (const ushort *) draw->user.elts; return get_vertex( draw, elts[i] ); } @@ -120,7 +127,7 @@ static struct vertex_header *get_ushort_elt_vertex( struct draw_context *draw, static struct vertex_header *get_ubyte_elt_vertex( struct draw_context *draw, unsigned i ) { - const ubyte *elts = (const ubyte *) draw->mapped_elts; + const ubyte *elts = (const ubyte *) draw->user.elts; return get_vertex( draw, elts[i] ); } @@ -189,7 +196,7 @@ draw_set_mapped_element_buffer( struct draw_context *draw, default: assert(0); } - draw->mapped_elts = elements; - draw->eltSize = eltSize; + draw->user.elts = elements; + draw->user.eltSize = eltSize; } |