softpipe: call setup_prepare earlier so that vertex info is correct when queried
authorKeith Whitwell <keith@tungstengraphics.com>
Wed, 16 Apr 2008 11:20:39 +0000 (12:20 +0100)
committerKeith Whitwell <keith@tungstengraphics.com>
Wed, 16 Apr 2008 11:22:20 +0000 (12:22 +0100)
src/gallium/drivers/softpipe/sp_prim_vbuf.c

index 4fed19ecb6d03e7d9d9a6f802278b783b32ae048..e063fe82efcc66479032e3622d8c08f0b79265a1 100644 (file)
@@ -106,6 +106,16 @@ static boolean
 sp_vbuf_set_primitive(struct vbuf_render *vbr, unsigned prim)
 {
    struct softpipe_vbuf_render *cvbr = softpipe_vbuf_render(vbr);
+
+   /* XXX: break this dependency - make setup_context live under
+    * softpipe, rename the old "setup" draw stage to something else.
+    */
+   struct setup_context *setup_ctx = sp_draw_setup_context(cvbr->softpipe->setup);
+   
+   setup_prepare( setup_ctx );
+
+
+
    if (prim == PIPE_PRIM_TRIANGLES ||
        prim == PIPE_PRIM_LINES ||
        prim == PIPE_PRIM_POINTS) {
@@ -136,10 +146,6 @@ sp_vbuf_draw(struct vbuf_render *vbr, const ushort *indices, uint nr_indices)
     */
    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) {