OSDN Git Service

965: fix for non-indexed draw path
authorKeith Whitwell <keith@tungstengraphics.com>
Fri, 14 Dec 2007 20:14:58 +0000 (20:14 +0000)
committerKeith Whitwell <keith@tungstengraphics.com>
Mon, 17 Dec 2007 10:30:38 +0000 (10:30 +0000)
src/mesa/pipe/i965simple/brw_draw.c

index 01c8ddb..498bf6b 100644 (file)
@@ -158,7 +158,8 @@ static boolean brw_try_draw_elements( struct pipe_context *pipe,
 
    /* Upload index, vertex data:
     */
-   if (!brw_upload_indices( brw, index_buffer, index_size, start, count ))
+   if (index_buffer && 
+       !brw_upload_indices( brw, index_buffer, index_size, start, count ))
       return FALSE;
 
    if (!brw_upload_vertex_elements( brw ))
@@ -169,7 +170,9 @@ static boolean brw_try_draw_elements( struct pipe_context *pipe,
    if (brw->state.dirty.brw)
       brw_validate_state( brw );
 
-   if (brw_emit_prim(brw, TRUE, start, count))
+   if (brw_emit_prim(brw, 
+                    index_buffer != NULL, 
+                    start, count))
       return FALSE;
 
    return TRUE;