Mesa (master): softpipe: use u_reduced_prim()

Brian Paul brianp at kemper.freedesktop.org
Fri Jun 19 09:02:11 PDT 2009


Module: Mesa
Branch: master
Commit: 09da78c235cdfa736cd5ea8ee62757f58b7d9f96
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=09da78c235cdfa736cd5ea8ee62757f58b7d9f96

Author: Brian Paul <brianp at vmware.com>
Date:   Fri Jun 19 09:42:37 2009 -0600

softpipe: use u_reduced_prim()

---

 src/gallium/drivers/softpipe/sp_draw_arrays.c |   17 ++---------------
 1 files changed, 2 insertions(+), 15 deletions(-)

diff --git a/src/gallium/drivers/softpipe/sp_draw_arrays.c b/src/gallium/drivers/softpipe/sp_draw_arrays.c
index a5dd8c7..d404581 100644
--- a/src/gallium/drivers/softpipe/sp_draw_arrays.c
+++ b/src/gallium/drivers/softpipe/sp_draw_arrays.c
@@ -35,6 +35,7 @@
 #include "pipe/p_context.h"
 #include "pipe/internal/p_winsys_screen.h"
 #include "pipe/p_inlines.h"
+#include "util/u_prim.h"
 
 #include "sp_context.h"
 #include "sp_state.h"
@@ -87,20 +88,6 @@ softpipe_unmap_constant_buffers(struct softpipe_context *sp)
 }
 
 
-static unsigned reduced_prim[PIPE_PRIM_POLYGON + 1] = {
-   PIPE_PRIM_POINTS,
-   PIPE_PRIM_LINES,
-   PIPE_PRIM_LINES,
-   PIPE_PRIM_LINES,
-   PIPE_PRIM_TRIANGLES,
-   PIPE_PRIM_TRIANGLES,
-   PIPE_PRIM_TRIANGLES,
-   PIPE_PRIM_TRIANGLES,
-   PIPE_PRIM_TRIANGLES,
-   PIPE_PRIM_TRIANGLES
-};
-
-
 boolean
 softpipe_draw_arrays(struct pipe_context *pipe, unsigned mode,
                      unsigned start, unsigned count)
@@ -126,7 +113,7 @@ softpipe_draw_range_elements(struct pipe_context *pipe,
    struct draw_context *draw = sp->draw;
    unsigned i;
 
-   sp->reduced_api_prim = reduced_prim[mode];
+   sp->reduced_api_prim = u_reduced_prim(mode);
 
    if (sp->dirty)
       softpipe_update_derived( sp );



More information about the mesa-commit mailing list