gallium: make vbuf_render::set_primitive() return void
authorBrian Paul <brianp@vmware.com>
Sat, 7 Jan 2012 21:16:27 +0000 (14:16 -0700)
committerBrian Paul <brianp@vmware.com>
Sat, 7 Jan 2012 21:16:27 +0000 (14:16 -0700)
All the implementations of this function always return TRUE.

src/gallium/auxiliary/draw/draw_pt_emit.c
src/gallium/auxiliary/draw/draw_pt_fetch_emit.c
src/gallium/auxiliary/draw/draw_pt_fetch_shade_emit.c
src/gallium/auxiliary/draw/draw_vbuf.h
src/gallium/drivers/i915/i915_prim_vbuf.c
src/gallium/drivers/llvmpipe/lp_setup_vbuf.c
src/gallium/drivers/r300/r300_render.c
src/gallium/drivers/softpipe/sp_prim_vbuf.c
src/gallium/drivers/svga/svga_swtnl_backend.c

index c8dfc16911e78ac409c6a329ddec8fcfd82dd281..8f483828e152fe54034724cda2358bc030c100fa 100644 (file)
@@ -54,7 +54,6 @@ void draw_pt_emit_prepare( struct pt_emit *emit,
    unsigned dst_offset;
    struct translate_key hw_key;
    unsigned i;
-   boolean ok;
    
    /* XXX: need to flush to get prim_vbuf.c to release its allocation?? 
     */
@@ -66,11 +65,7 @@ void draw_pt_emit_prepare( struct pt_emit *emit,
     */
    emit->prim = prim;
 
-   ok = draw->render->set_primitive(draw->render, emit->prim);
-   if (!ok) {
-      assert(0);
-      return;
-   }
+   draw->render->set_primitive(draw->render, emit->prim);
 
    /* Must do this after set_primitive() above:
     */
@@ -113,10 +108,10 @@ void draw_pt_emit_prepare( struct pt_emit *emit,
 
    if (!emit->translate ||
        translate_key_compare(&emit->translate->key, &hw_key) != 0)
-   {
-      translate_key_sanitize(&hw_key);
-      emit->translate = translate_cache_find(emit->cache, &hw_key);
-   }
+      {
+         translate_key_sanitize(&hw_key);
+         emit->translate = translate_cache_find(emit->cache, &hw_key);
+      }
 
    *max_vertices = (draw->render->max_vertex_buffer_bytes / 
                     (vinfo->size * 4));
@@ -147,10 +142,7 @@ void draw_pt_emit( struct pt_emit *emit,
    /* XXX: and work out some way to coordinate the render primitive
     * between vbuf.c and here...
     */
-   if (!draw->render->set_primitive(draw->render, emit->prim)) {
-      assert(0);
-      return;
-   }
+   draw->render->set_primitive(draw->render, emit->prim);
 
    render->allocate_vertices(render,
                              (ushort)translate->key.output_stride,
@@ -221,8 +213,7 @@ void draw_pt_emit_linear(struct pt_emit *emit,
    /* XXX: and work out some way to coordinate the render primitive
     * between vbuf.c and here...
     */
-   if (!draw->render->set_primitive(draw->render, emit->prim)) 
-      goto fail;
+   draw->render->set_primitive(draw->render, emit->prim);
 
    if (!render->allocate_vertices(render,
                                   (ushort)translate->key.output_stride,
index 0ab11d015c6b156290294f7be52d17da3dfb9d81..97d66e5f11dda7f93c0e46a3dbb1c4a3e4fad08b 100644 (file)
@@ -98,7 +98,6 @@ static void fetch_emit_prepare( struct draw_pt_middle_end *middle,
    struct draw_context *draw = feme->draw;
    const struct vertex_info *vinfo;
    unsigned i, dst_offset;
-   boolean ok;
    struct translate_key key;
 
    unsigned gs_out_prim = (draw->gs.geometry_shader ? 
@@ -107,12 +106,7 @@ static void fetch_emit_prepare( struct draw_pt_middle_end *middle,
 
 
 
-   ok = draw->render->set_primitive( draw->render, 
-                                     gs_out_prim );
-   if (!ok) {
-      assert(0);
-      return;
-   }
+   draw->render->set_primitive(draw->render, gs_out_prim);
    
    /* Must do this after set_primitive() above:
     */
index 0dbbfe2b73ccca3b3d7669882db3d373395a62f0..4bed256dfb03077039ce29099fd37812a489e13d 100644 (file)
@@ -83,11 +83,7 @@ static void fse_prepare( struct draw_pt_middle_end *middle,
     */
    assert(!draw->gs.geometry_shader);
 
-   if (!draw->render->set_primitive( draw->render,
-                                     prim )) {
-      assert(0);
-      return;
-   }
+   draw->render->set_primitive(draw->render, prim);
 
    /* Must do this after set_primitive() above:
     */
index e32803c0720836e319dee379ac2faa34b3b5bd4c..1f1a7b4972f95af459f39a7f118433b9f3d2131f 100644 (file)
@@ -95,7 +95,7 @@ struct vbuf_render {
     * the discretion of the driver, for the benefit of the passthrough
     * path.
     */
-   boolean (*set_primitive)( struct vbuf_render *, unsigned prim );
+   void (*set_primitive)( struct vbuf_render *, unsigned prim );
 
    /**
     * Draw indexed primitives.  Note that indices are ushort.  The driver
index 3f85466ba6e134d10869e262c8da826756c8b093..f9b2ade3fa6145fe11e4cf9b82ea1e229256ca35 100644 (file)
@@ -322,7 +322,7 @@ i915_vbuf_ensure_index_bounds(struct vbuf_render *render,
    i915_vbuf_update_vbo_state(render);
 }
 
-static boolean
+static void
 i915_vbuf_render_set_primitive(struct vbuf_render *render, 
                                unsigned prim)
 {
@@ -333,46 +333,46 @@ i915_vbuf_render_set_primitive(struct vbuf_render *render,
    case PIPE_PRIM_POINTS:
       i915_render->hwprim = PRIM3D_POINTLIST;
       i915_render->fallback = 0;
-      return TRUE;
+      break;
    case PIPE_PRIM_LINES:
       i915_render->hwprim = PRIM3D_LINELIST;
       i915_render->fallback = 0;
-      return TRUE;
+      break;
    case PIPE_PRIM_LINE_LOOP:
       i915_render->hwprim = PRIM3D_LINELIST;
       i915_render->fallback = PIPE_PRIM_LINE_LOOP;
-      return TRUE;
+      break;
    case PIPE_PRIM_LINE_STRIP:
       i915_render->hwprim = PRIM3D_LINESTRIP;
       i915_render->fallback = 0;
-      return TRUE;
+      break;
    case PIPE_PRIM_TRIANGLES:
       i915_render->hwprim = PRIM3D_TRILIST;
       i915_render->fallback = 0;
-      return TRUE;
+      break;
    case PIPE_PRIM_TRIANGLE_STRIP:
       i915_render->hwprim = PRIM3D_TRISTRIP;
       i915_render->fallback = 0;
-      return TRUE;
+      break;
    case PIPE_PRIM_TRIANGLE_FAN:
       i915_render->hwprim = PRIM3D_TRIFAN;
       i915_render->fallback = 0;
-      return TRUE;
+      break;
    case PIPE_PRIM_QUADS:
       i915_render->hwprim = PRIM3D_TRILIST;
       i915_render->fallback = PIPE_PRIM_QUADS;
-      return TRUE;
+      break;
    case PIPE_PRIM_QUAD_STRIP:
       i915_render->hwprim = PRIM3D_TRILIST;
       i915_render->fallback = PIPE_PRIM_QUAD_STRIP;
-      return TRUE;
+      break;
    case PIPE_PRIM_POLYGON:
       i915_render->hwprim = PRIM3D_POLY;
       i915_render->fallback = 0;
-      return TRUE;
+      break;
    default:
       /* FIXME: Actually, can handle a lot more just fine... */
-      return FALSE;
+      assert(0 && "unexpected prim in i915_vbuf_render_set_primitive()");
    }
 }
 
index 384242f81d708ca8c8be93c02679b44d06bed7e2..b287ef4391b996a96e2c8264ec1a3439fc1d6ba4 100644 (file)
@@ -113,11 +113,10 @@ lp_setup_unmap_vertices(struct vbuf_render *vbr,
 }
 
 
-static boolean
+static void
 lp_setup_set_primitive(struct vbuf_render *vbr, unsigned prim)
 {
    lp_setup_context(vbr)->prim = prim;
-   return TRUE;
 }
 
 typedef const float (*const_float4_ptr)[4];
index 90b8e53113ff0cde360cc2312e2c51754d9fb5b1..7f04c93e418a867037dbd8dab9514f3d3e35e2e9 100644 (file)
@@ -981,15 +981,13 @@ static void r300_render_release_vertices(struct vbuf_render* render)
     r300render->vbo_max_used = 0;
 }
 
-static boolean r300_render_set_primitive(struct vbuf_render* render,
-                                               unsigned prim)
+static void r300_render_set_primitive(struct vbuf_render* render,
+                                      unsigned prim)
 {
     struct r300_render* r300render = r300_render(render);
 
     r300render->prim = prim;
     r300render->hwprim = r300_translate_primitive(prim);
-
-    return TRUE;
 }
 
 static void r300_render_draw_arrays(struct vbuf_render* render,
index c60249dbfbcde20ef3d81e450144ce1067664794..54a6542bdcd43ce6bad8695772cf50ab57ded516 100644 (file)
@@ -132,7 +132,7 @@ sp_vbuf_unmap_vertices(struct vbuf_render *vbr,
 }
 
 
-static boolean
+static void
 sp_vbuf_set_primitive(struct vbuf_render *vbr, unsigned prim)
 {
    struct softpipe_vbuf_render *cvbr = softpipe_vbuf_render(vbr);
@@ -142,7 +142,6 @@ sp_vbuf_set_primitive(struct vbuf_render *vbr, unsigned prim)
 
    cvbr->softpipe->reduced_prim = u_reduced_prim(prim);
    cvbr->prim = prim;
-   return TRUE;
 }
 
 
index 521226c0db7d0a2caa86e443845815311945c66a..33557aa937aef707204e3953f678ab19106cd7aa 100644 (file)
@@ -161,14 +161,12 @@ svga_vbuf_render_unmap_vertices( struct vbuf_render *render,
    svga_render->vbuf_used = MAX2(svga_render->vbuf_used, used);
 }
 
-static boolean
+static void
 svga_vbuf_render_set_primitive( struct vbuf_render *render,
                                 unsigned prim )
 {
    struct svga_vbuf_render *svga_render = svga_vbuf_render(render);
    svga_render->prim = prim;
-
-   return TRUE;
 }
 
 static void