diff options
author | Brian Paul <[email protected]> | 2017-08-18 21:18:47 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2017-08-21 19:04:51 -0600 |
commit | 4d2b21a326d2e83eb8fe2b32ac39dbe776f172c8 (patch) | |
tree | 71f261905ff759c6b4fd80f5f8e6aa215bee3bb2 /src/gallium/drivers | |
parent | d50b8b91d7e6c20c7ebacf4022f15fae920fd3ca (diff) |
svga: replace gotos with conditionals in array drawing code
No Piglit regressions.
Reviewed-by: Charmaine Lee <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/svga/svga_draw_arrays.c | 36 | ||||
-rw-r--r-- | src/gallium/drivers/svga/svga_draw_elements.c | 28 |
2 files changed, 32 insertions, 32 deletions
diff --git a/src/gallium/drivers/svga/svga_draw_arrays.c b/src/gallium/drivers/svga/svga_draw_arrays.c index b968fb03044..19d5e503137 100644 --- a/src/gallium/drivers/svga/svga_draw_arrays.c +++ b/src/gallium/drivers/svga/svga_draw_arrays.c @@ -286,25 +286,25 @@ svga_hwtnl_draw_arrays(struct svga_hwtnl *hwtnl, gen_type, gen_nr, gen_size, gen_func, &gen_buf); - if (ret != PIPE_OK) - goto done; - - pipe_debug_message(&svga->debug.callback, PERF_INFO, - "generating temporary index buffer for drawing %s", - u_prim_name(prim)); - - ret = svga_hwtnl_simple_draw_range_elements(hwtnl, - gen_buf, - gen_size, - start, - 0, - count - 1, - gen_prim, 0, gen_nr, - start_instance, - instance_count); -done: - if (gen_buf) + if (ret == PIPE_OK) { + pipe_debug_message(&svga->debug.callback, PERF_INFO, + "generating temporary index buffer for drawing %s", + u_prim_name(prim)); + + ret = svga_hwtnl_simple_draw_range_elements(hwtnl, + gen_buf, + gen_size, + start, + 0, + count - 1, + gen_prim, 0, gen_nr, + start_instance, + instance_count); + } + + if (gen_buf) { pipe_resource_reference(&gen_buf, NULL); + } } SVGA_STATS_TIME_POP(svga_sws(svga)); diff --git a/src/gallium/drivers/svga/svga_draw_elements.c b/src/gallium/drivers/svga/svga_draw_elements.c index f9bb13664f5..b1db8710740 100644 --- a/src/gallium/drivers/svga/svga_draw_elements.c +++ b/src/gallium/drivers/svga/svga_draw_elements.c @@ -242,21 +242,21 @@ svga_hwtnl_draw_range_elements(struct svga_hwtnl *hwtnl, prim, gen_prim, count, gen_nr, gen_size, gen_func, &gen_buf); - if (ret != PIPE_OK) - goto done; - - ret = svga_hwtnl_simple_draw_range_elements(hwtnl, - gen_buf, - gen_size, - index_bias, - min_index, - max_index, - gen_prim, 0, gen_nr, - start_instance, - instance_count); -done: - if (gen_buf) + if (ret == PIPE_OK) { + ret = svga_hwtnl_simple_draw_range_elements(hwtnl, + gen_buf, + gen_size, + index_bias, + min_index, + max_index, + gen_prim, 0, gen_nr, + start_instance, + instance_count); + } + + if (gen_buf) { pipe_resource_reference(&gen_buf, NULL); + } } SVGA_STATS_TIME_POP(svga_sws(hwtnl->svga)); |