summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/softpipe/sp_prim_vbuf.c
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2008-04-14 11:32:50 +0100
committerKeith Whitwell <keith@tungstengraphics.com>2008-04-14 11:32:50 +0100
commit8e7326832a7420154fc0d526ac682494db1be160 (patch)
tree3c080a2c490fbe18bb65b27d1844f847db50ef35 /src/gallium/drivers/softpipe/sp_prim_vbuf.c
parent0c1cb54923f3ab31caa2821e095685277174dd2f (diff)
softpipe: do our own culling, don't rely on the draw module.
May not always happen due to passthrough modes, etc.
Diffstat (limited to 'src/gallium/drivers/softpipe/sp_prim_vbuf.c')
-rw-r--r--src/gallium/drivers/softpipe/sp_prim_vbuf.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/gallium/drivers/softpipe/sp_prim_vbuf.c b/src/gallium/drivers/softpipe/sp_prim_vbuf.c
index 025a0113bf..74cd675908 100644
--- a/src/gallium/drivers/softpipe/sp_prim_vbuf.c
+++ b/src/gallium/drivers/softpipe/sp_prim_vbuf.c
@@ -120,8 +120,9 @@ sp_vbuf_set_primitive(struct vbuf_render *vbr, unsigned prim)
/**
- * Recalculate prim's determinant.
- * XXX is this needed?
+ * Recalculate prim's determinant. This is needed as we don't have
+ * get this information through the vbuf_render interface & we must
+ * calculate it here.
*/
static float
calc_det( const float (*v0)[4],
@@ -144,12 +145,21 @@ sp_vbuf_draw(struct vbuf_render *vbr, const ushort *indices, uint nr_indices)
{
struct softpipe_vbuf_render *cvbr = softpipe_vbuf_render(vbr);
struct softpipe_context *softpipe = cvbr->softpipe;
- struct draw_stage *setup = softpipe->setup;
unsigned vertex_size = softpipe->vertex_info_vbuf.size * sizeof(float);
unsigned i, j;
void *vertex_buffer = cvbr->vertex_buffer;
cptrf4 v[3];
- struct setup_context *setup_ctx = sp_draw_setup_context(setup);
+
+ /* XXX: break this dependency - make setup_context live under
+ * softpipe, rename the old "setup" draw stage to something else.
+ */
+ struct draw_stage *setup = softpipe->setup;
+ struct setup_context *setup_ctx = sp_draw_setup_context(softpipe->setup);
+
+ /* XXX: call this from allocate_vertices:
+ */
+ setup_prepare( setup_ctx );
+
switch (cvbr->prim) {
case PIPE_PRIM_TRIANGLES:
@@ -189,6 +199,9 @@ sp_vbuf_draw(struct vbuf_render *vbr, const ushort *indices, uint nr_indices)
break;
}
+ /* XXX: why are we calling this??? If we had to call something, it
+ * would be a function in sp_setup.c:
+ */
sp_draw_flush( setup );
}