diff options
author | Zack Rusin <zack@tungstengraphics.com> | 2008-05-03 22:32:17 -0400 |
---|---|---|
committer | Zack Rusin <zack@tungstengraphics.com> | 2008-05-08 15:26:08 -0400 |
commit | abb08e9335b5d7cb004dc9e6cec390ab6968abe5 (patch) | |
tree | 56a15f6fc8a3e663fc179df61ac789a67b4c4eef /src/gallium/auxiliary/draw/draw_pt_fetch.c | |
parent | 90a46ed277cc887d49c8d8c627174c3bd693ecf7 (diff) | |
download | external_mesa3d-abb08e9335b5d7cb004dc9e6cec390ab6968abe5.zip external_mesa3d-abb08e9335b5d7cb004dc9e6cec390ab6968abe5.tar.gz external_mesa3d-abb08e9335b5d7cb004dc9e6cec390ab6968abe5.tar.bz2 |
implement linear emition and fetching and plug it in the varray paths
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_pt_fetch.c')
-rw-r--r-- | src/gallium/auxiliary/draw/draw_pt_fetch.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/draw/draw_pt_fetch.c b/src/gallium/auxiliary/draw/draw_pt_fetch.c index 1f765b7..d7cc180 100644 --- a/src/gallium/auxiliary/draw/draw_pt_fetch.c +++ b/src/gallium/auxiliary/draw/draw_pt_fetch.c @@ -167,6 +167,42 @@ void draw_pt_fetch_run( struct pt_fetch *fetch, } +void draw_pt_fetch_run_linear( struct pt_fetch *fetch, + unsigned start, + unsigned count, + char *verts ) +{ + struct draw_context *draw = fetch->draw; + struct translate *translate = fetch->translate; + unsigned i; + + for (i = 0; i < draw->pt.nr_vertex_buffers; i++) { + translate->set_buffer(translate, + i, + ((char *)draw->pt.user.vbuffer[i] + + draw->pt.vertex_buffer[i].buffer_offset), + draw->pt.vertex_buffer[i].pitch ); + } + + translate->run( translate, + start, + count, + verts ); + + /* Edgeflags are hard to fit into a translate program, populate + * them separately if required. In the setup above they are + * defaulted to one, so only need this if there is reason to change + * that default: + */ + if (fetch->need_edgeflags) { + for (i = 0; i < count; i++) { + struct vertex_header *vh = (struct vertex_header *)(verts + i * fetch->vertex_size); + vh->edgeflag = draw_pt_get_edgeflag( draw, start + i ); + } + } +} + + struct pt_fetch *draw_pt_fetch_create( struct draw_context *draw ) { struct pt_fetch *fetch = CALLOC_STRUCT(pt_fetch); |