mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 01:08:03 +02:00
radv: Use constant for ray traversal exit condition.
Make the stack base ssa def dead in the loop, can save a register. Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18538>
This commit is contained in:
parent
40a235c9a8
commit
91a4cd26b3
1 changed files with 2 additions and 1 deletions
|
|
@ -1404,6 +1404,7 @@ build_traversal_shader(struct radv_device *device,
|
|||
nir_ssa_def *stack_base =
|
||||
nir_iadd_imm(&b, nir_imul_imm(&b, nir_load_local_invocation_index(&b), stack_entry_size),
|
||||
b.shader->info.shared_size);
|
||||
nir_ssa_def *stack_exit_bound = nir_imm_int(&b, stack_entry_stride + b.shader->info.shared_size);
|
||||
|
||||
b.shader->info.shared_size += stack_entry_stride * MAX_STACK_ENTRY_COUNT;
|
||||
|
||||
|
|
@ -1438,7 +1439,7 @@ build_traversal_shader(struct radv_device *device,
|
|||
|
||||
nir_push_if(&b, nir_ieq_imm(&b, nir_load_var(&b, trav_vars.current_node), -1));
|
||||
{
|
||||
nir_push_if(&b, nir_ieq(&b, nir_load_var(&b, trav_vars.stack), stack_base));
|
||||
nir_push_if(&b, nir_ilt(&b, nir_load_var(&b, trav_vars.stack), stack_exit_bound));
|
||||
nir_jump(&b, nir_jump_break);
|
||||
nir_pop_if(&b, NULL);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue