mesa/src/amd
Marek Olšák 13acbaecd8 radeonsi: rewrite the prefix sum computation for shader culling
Instead of storing the vertex mask per wave into LDS and then computing
the prefix sum, store 8-bit bitcounts (vertex counts) of the vertex masks
into LDS. This allows us to compute the sum using v_sad_u8, which computes
a sum of 4 i8vec4 components in one instruction.

Each i8vec4 of vertex counts is loaded in parallel threads (one dword
per thread) instead of all being loaded in thread 0, and readlane copies
them to SGPRs instead of readfirstlane.

LDS is no longer initialized before culling. Instead, the counts for
inactive waves are masked with AND later.

Incorrect old comments are also fixed.

This change removes 80 bytes from the code size, and it allows increasing
the workgroup size from 128 to 256. (which is the main motivation for this)

Now changing the workgroup size with wave64 has no effect on the code size.
Switching to wave32 with 8 waves even generates slightly smaller code than
wave64 with 4 waves.

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10813>
2021-05-25 16:15:44 +00:00
..
addrlib amd: fix incorrect addrlib comment for HTILE equations 2021-05-25 16:15:44 +00:00
ci radv/ci: Test on Stoney on CI 2021-05-24 07:44:00 +02:00
common ac/gpu_info: set has_zero_index_buffer_bug for Navi12 too 2021-05-25 16:15:44 +00:00
compiler aco: Don't eliminate exec write when it's used by a copy later. 2021-05-25 13:50:43 +00:00
llvm radeonsi: rewrite the prefix sum computation for shader culling 2021-05-25 16:15:44 +00:00
registers amd/registers: regenerate json files without 32-bit register fields 2021-05-25 16:15:44 +00:00
vulkan ac/llvm: set target features per function instead of per target machine 2021-05-25 16:15:44 +00:00
.clang-format radv: Add clang-format for AMD code. 2021-04-10 03:31:32 +02:00
Android.addrlib.mk android: amd/addrlib: define endianess to build 2021-03-27 01:54:49 +01:00
Android.common.mk android: amd/common: add nir include path 2021-04-26 23:14:56 +02:00
Android.compiler.mk android: aco/isel: Move context initialization code to a dedicated file 2020-09-14 21:26:53 +02:00
Android.mk android: aco: add support for libmesa_aco 2019-09-28 15:56:34 +02:00
Makefile.sources ac: move ac_lower_indirect_derefs() outside of the LLVM dir 2021-04-23 11:52:01 +02:00
meson.build aco: add framework for unit testing 2020-07-30 16:13:08 +00:00