summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2013-11-15 10:25:19 -0700
committerBrian Paul <[email protected]>2013-11-15 10:27:01 -0700
commit2bc1680665473c648e8b75a98d77be7c3f07379d (patch)
tree200c7aa49cf0001a415018112e90906371ac8573 /src/gallium/drivers
parent1a36dfb21e07a1b7ce76de347421bfd0c454ee13 (diff)
svga: remove unused vars in svga_hwtnl_simple_draw_range_elements()
And simplify the code. Reviewed-by: Jose Fonseca <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/svga/svga_draw_elements.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/gallium/drivers/svga/svga_draw_elements.c b/src/gallium/drivers/svga/svga_draw_elements.c
index f6603be920a..411b8d9b9f1 100644
--- a/src/gallium/drivers/svga/svga_draw_elements.c
+++ b/src/gallium/drivers/svga/svga_draw_elements.c
@@ -100,16 +100,14 @@ svga_hwtnl_simple_draw_range_elements(struct svga_hwtnl *hwtnl,
unsigned prim, unsigned start,
unsigned count)
{
- struct pipe_resource *upload_buffer = NULL;
SVGA3dPrimitiveRange range;
unsigned hw_prim;
unsigned hw_count;
unsigned index_offset = start * index_size;
- enum pipe_error ret = PIPE_OK;
hw_prim = svga_translate_prim(prim, count, &hw_count);
if (hw_count == 0)
- goto done;
+ return PIPE_OK; /* nothing to draw */
/* We should never see user-space buffers in the driver. The vbuf
* module should have converted them into real buffers.
@@ -124,15 +122,7 @@ svga_hwtnl_simple_draw_range_elements(struct svga_hwtnl *hwtnl,
range.indexWidth = index_size;
range.indexBias = index_bias;
- ret = svga_hwtnl_prim(hwtnl, &range, min_index, max_index, index_buffer);
- if (ret != PIPE_OK)
- goto done;
-
-done:
- if (upload_buffer)
- pipe_resource_reference(&upload_buffer, NULL);
-
- return ret;
+ return svga_hwtnl_prim(hwtnl, &range, min_index, max_index, index_buffer);
}