amd: massively simplify how info->spi_cu_en is applied
authorMarek Olšák <marek.olsak@amd.com>
Tue, 21 Feb 2023 17:22:38 +0000 (12:22 -0500)
committerMarge Bot <emma+marge@anholt.net>
Fri, 3 Mar 2023 00:41:48 +0000 (00:41 +0000)
commitccaaf8fe04c956d9f16f98b7f7fa69a2526283bc
treec9e8106aee09ff3cf9d03ac5b7cc863b49c8f96b
parent2b3f551ed8038bae0215b54ac0c8989601d094ce
amd: massively simplify how info->spi_cu_en is applied

Instead of having ac_set_reg_cu_en that sets the register, replace it with
ac_apply_cu_en that only returns the modified register value,
which allows a large simplification in both drivers because a lot of code
becomes duplicated after it's switched to ac_apply_cu_en.

RADV also didn't apply it to a few registers. Fixed.

This removes 82 lines of code in total.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21641>
src/amd/common/ac_shader_util.c
src/amd/common/ac_shader_util.h
src/amd/vulkan/radv_cs.h
src/amd/vulkan/radv_pipeline.c
src/amd/vulkan/si_cmd_buffer.c
src/gallium/drivers/radeonsi/si_build_pm4.h
src/gallium/drivers/radeonsi/si_pm4.c
src/gallium/drivers/radeonsi/si_pm4.h
src/gallium/drivers/radeonsi/si_state.c
src/gallium/drivers/radeonsi/si_state_shaders.cpp