diff options
Diffstat (limited to 'src/mesa/pipe/softpipe/sp_prim_setup.c')
-rw-r--r-- | src/mesa/pipe/softpipe/sp_prim_setup.c | 84 |
1 files changed, 0 insertions, 84 deletions
diff --git a/src/mesa/pipe/softpipe/sp_prim_setup.c b/src/mesa/pipe/softpipe/sp_prim_setup.c index 533a2fbd4d..9b2f10bbbb 100644 --- a/src/mesa/pipe/softpipe/sp_prim_setup.c +++ b/src/mesa/pipe/softpipe/sp_prim_setup.c @@ -1237,87 +1237,3 @@ struct draw_stage *sp_draw_render_stage( struct softpipe_context *softpipe ) return &setup->stage; } - - -/* Recalculate det. This is only used in the test harness below: - */ -static void calc_det( struct prim_header *header ) -{ - /* Window coords: */ - const float *v0 = header->v[0]->data[0]; - const float *v1 = header->v[1]->data[0]; - const float *v2 = header->v[2]->data[0]; - - /* edge vectors e = v0 - v2, f = v1 - v2 */ - const float ex = v0[0] - v2[0]; - const float ey = v0[1] - v2[1]; - const float fx = v1[0] - v2[0]; - const float fy = v1[1] - v2[1]; - - /* det = cross(e,f).z */ - header->det = ex * fy - ey * fx; -} - - - -/** - * Render buffer of points/lines/triangles. - * Called by vbuf code when the vertex or index buffer is filled. - * - * The big issue at this point is that reset_stipple doesn't make it - * through the interface. Probably need to split primitives at reset - * stipple, perhaps using the ~0 index marker. - */ -void sp_vbuf_render( struct pipe_context *pipe, - unsigned primitive, - const ushort *elements, - unsigned nr_elements, - const void *vertex_buffer, - unsigned nr_vertices ) -{ - struct softpipe_context *softpipe = softpipe_context( pipe ); - struct setup_stage *setup = setup_stage( softpipe->setup ); - struct prim_header prim; - unsigned vertex_size = softpipe->vertex_info.size * sizeof(float); - unsigned i, j; - - prim.det = 0; - prim.reset_line_stipple = 0; - prim.edgeflags = 0; - prim.pad = 0; - - setup->stage.begin( &setup->stage ); - - switch (primitive) { - case PIPE_PRIM_TRIANGLES: - for (i = 0; i < nr_elements; i += 3) { - for (j = 0; j < 3; j++) - prim.v[j] = (struct vertex_header *)((char *)vertex_buffer + - elements[i+j] * vertex_size); - - calc_det(&prim); - setup->stage.tri( &setup->stage, &prim ); - } - break; - - case PIPE_PRIM_LINES: - for (i = 0; i < nr_elements; i += 2) { - for (j = 0; j < 2; j++) - prim.v[j] = (struct vertex_header *)((char *)vertex_buffer + - elements[i+j] * vertex_size); - - setup->stage.line( &setup->stage, &prim ); - } - break; - - case PIPE_PRIM_POINTS: - for (i = 0; i < nr_elements; i++) { - prim.v[0] = (struct vertex_header *)((char *)vertex_buffer + - elements[i] * vertex_size); - setup->stage.point( &setup->stage, &prim ); - } - break; - } - - setup->stage.end( &setup->stage ); -} |