r300: simplify rc_find_free_temporary
authorPavel Ondračka <pavel.ondracka@gmail.com>
Fri, 7 Oct 2022 20:02:40 +0000 (22:02 +0200)
committerMarge Bot <emma+marge@anholt.net>
Tue, 22 Nov 2022 01:45:19 +0000 (01:45 +0000)
commitb33845cf24225833d0705a8635091e855d7ddcca
treeb2e9ffb47871231e8a82b351977a6d0226a446fe
parentded82cf4bdd9a74eded2a9a95ab14e2c0d907c0a
r300: simplify rc_find_free_temporary

Back when we had a stupid register allocator we did a lot of tricks to
optimize the register usage. The old version of rc_find_free_temporary
did a full program search each time it was called to find out what
registers and channels are actually used and than used that info to give
us the first free register to use.

Now that we have a proper register allocator both for vertex and
fragment shaders, this is no longer needed. Just scan the program when
called for the first time to find the first unused temporary index and
than increment by one everytime. Regalloc can sort it out later.

No change in shader-db confirms this assumption is sound.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Tested-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19853>
src/gallium/drivers/r300/compiler/radeon_compiler.c
src/gallium/drivers/r300/compiler/radeon_compiler.h
src/gallium/drivers/r300/compiler/radeon_program.c
src/gallium/drivers/r300/compiler/radeon_rename_regs.c