mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 02:38:04 +02:00
gallivm/flow: add counter reset for loops
This allows the counter value to be forced to a certain value Reviewed-by: Roland Scheidegger <sroland@vmware.com>
This commit is contained in:
parent
6b3c6b91a8
commit
f3f0cbf4f4
2 changed files with 20 additions and 0 deletions
|
|
@ -265,6 +265,20 @@ lp_build_loop_end_cond(struct lp_build_loop_state *state,
|
|||
state->counter = LLVMBuildLoad(builder, state->counter_var, "");
|
||||
}
|
||||
|
||||
void
|
||||
lp_build_loop_force_set_counter(struct lp_build_loop_state *state,
|
||||
LLVMValueRef end)
|
||||
{
|
||||
LLVMBuilderRef builder = state->gallivm->builder;
|
||||
LLVMBuildStore(builder, end, state->counter_var);
|
||||
}
|
||||
|
||||
void
|
||||
lp_build_loop_force_reload_counter(struct lp_build_loop_state *state)
|
||||
{
|
||||
LLVMBuilderRef builder = state->gallivm->builder;
|
||||
state->counter = LLVMBuildLoad(builder, state->counter_var, "");
|
||||
}
|
||||
|
||||
void
|
||||
lp_build_loop_end(struct lp_build_loop_state *state,
|
||||
|
|
|
|||
|
|
@ -127,6 +127,12 @@ lp_build_loop_end(struct lp_build_loop_state *state,
|
|||
LLVMValueRef end,
|
||||
LLVMValueRef step);
|
||||
|
||||
void
|
||||
lp_build_loop_force_set_counter(struct lp_build_loop_state *state,
|
||||
LLVMValueRef end);
|
||||
|
||||
void
|
||||
lp_build_loop_force_reload_counter(struct lp_build_loop_state *state);
|
||||
void
|
||||
lp_build_loop_end_cond(struct lp_build_loop_state *state,
|
||||
LLVMValueRef end,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue