diff options
author | Constantine Kharlamov <[email protected]> | 2017-03-26 18:36:20 +0300 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2017-04-03 00:36:25 +0200 |
commit | 4408e1ca53e4dbb1c26a86e9b20eef5fdc7776eb (patch) | |
tree | 4946138890d12b43d6c964f868e0d275c3904a37 /src/gallium/drivers | |
parent | cb518f2fb2bfac2535f3299f18daf9e2487aef32 (diff) |
r600g: Use separate index_bias variable
Needed to get rid of a separate struct allocation in the next patch, because
the one in argument is a constant, and don't allow changing its fields.
Signed-off-by: Constantine Kharlamov <[email protected]>
Signed-off-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/r600/r600_state_common.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/gallium/drivers/r600/r600_state_common.c b/src/gallium/drivers/r600/r600_state_common.c index cedeb74e2d7..f33647f7d9b 100644 --- a/src/gallium/drivers/r600/r600_state_common.c +++ b/src/gallium/drivers/r600/r600_state_common.c @@ -1678,6 +1678,7 @@ static void r600_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info bool render_cond_bit = rctx->b.render_cond && !rctx->b.render_cond_force_off; uint64_t mask; unsigned num_patches, dirty_tex_counter; + int index_bias; if (!info.indirect && !info.count && (info.indexed || !info.count_from_stream_output)) { return; @@ -1774,18 +1775,19 @@ static void r600_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info ib.user_buffer, &ib.offset, &ib.buffer); ib.user_buffer = NULL; } + index_bias = info.index_bias; } else { - info.index_bias = info.start; + index_bias = info.start; } /* Set the index offset and primitive restart. */ if (rctx->vgt_state.vgt_multi_prim_ib_reset_en != info.primitive_restart || rctx->vgt_state.vgt_multi_prim_ib_reset_indx != info.restart_index || - rctx->vgt_state.vgt_indx_offset != info.index_bias || + rctx->vgt_state.vgt_indx_offset != index_bias || (rctx->vgt_state.last_draw_was_indirect && !info.indirect)) { rctx->vgt_state.vgt_multi_prim_ib_reset_en = info.primitive_restart; rctx->vgt_state.vgt_multi_prim_ib_reset_indx = info.restart_index; - rctx->vgt_state.vgt_indx_offset = info.index_bias; + rctx->vgt_state.vgt_indx_offset = index_bias; r600_mark_atom_dirty(rctx, &rctx->vgt_state.atom); } |