From 488dd2c1912132fe7ee5e81b05fb64ba62a46098 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 7 Jan 2012 14:16:27 -0700 Subject: gallium: make vbuf_render::set_primitive() return void All the implementations of this function always return TRUE. --- src/gallium/auxiliary/draw/draw_pt_emit.c | 23 +++++++--------------- src/gallium/auxiliary/draw/draw_pt_fetch_emit.c | 8 +------- .../auxiliary/draw/draw_pt_fetch_shade_emit.c | 6 +----- src/gallium/auxiliary/draw/draw_vbuf.h | 2 +- 4 files changed, 10 insertions(+), 29 deletions(-) (limited to 'src/gallium/auxiliary') diff --git a/src/gallium/auxiliary/draw/draw_pt_emit.c b/src/gallium/auxiliary/draw/draw_pt_emit.c index c8dfc16911e..8f483828e15 100644 --- a/src/gallium/auxiliary/draw/draw_pt_emit.c +++ b/src/gallium/auxiliary/draw/draw_pt_emit.c @@ -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, diff --git a/src/gallium/auxiliary/draw/draw_pt_fetch_emit.c b/src/gallium/auxiliary/draw/draw_pt_fetch_emit.c index 0ab11d015c6..97d66e5f11d 100644 --- a/src/gallium/auxiliary/draw/draw_pt_fetch_emit.c +++ b/src/gallium/auxiliary/draw/draw_pt_fetch_emit.c @@ -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: */ diff --git a/src/gallium/auxiliary/draw/draw_pt_fetch_shade_emit.c b/src/gallium/auxiliary/draw/draw_pt_fetch_shade_emit.c index 0dbbfe2b73c..4bed256dfb0 100644 --- a/src/gallium/auxiliary/draw/draw_pt_fetch_shade_emit.c +++ b/src/gallium/auxiliary/draw/draw_pt_fetch_shade_emit.c @@ -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: */ diff --git a/src/gallium/auxiliary/draw/draw_vbuf.h b/src/gallium/auxiliary/draw/draw_vbuf.h index e32803c0720..1f1a7b4972f 100644 --- a/src/gallium/auxiliary/draw/draw_vbuf.h +++ b/src/gallium/auxiliary/draw/draw_vbuf.h @@ -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 -- cgit v1.2.3