radv: use nir_opt_find_array_copies()
authorTimothy Arceri <tarceri@itsqueeze.com>
Wed, 17 Oct 2018 22:42:17 +0000 (09:42 +1100)
committerTimothy Arceri <tarceri@itsqueeze.com>
Thu, 18 Oct 2018 04:04:09 +0000 (15:04 +1100)
commit06675711e713e7ccd66aa076a6ba116286130474
tree6fdb82d52cb0060e484d359244d4ec0ecd9a599e
parent9d5b106b2efbd5a4bbbe54a5a00c8cebd642d960
radv: use nir_opt_find_array_copies()

Totals from affected shaders:
SGPRS: 1112 -> 1112 (0.00 %)
VGPRS: 1492 -> 1196 (-19.84 %)
Spilled SGPRs: 0 -> 0 (0.00 %)
Spilled VGPRs: 0 -> 0 (0.00 %)
Private memory VGPRs: 0 -> 0 (0.00 %)
Scratch size: 0 -> 0 (0.00 %) dwords per thread
Code Size: 112172 -> 101316 (-9.68 %) bytes
LDS: 0 -> 0 (0.00 %) blocks
Max Waves: 93 -> 98 (5.38 %)
Wait states: 0 -> 0 (0.00 %)

All affected shaders are from "Batman: Arkham City" over DXVK.

The pass detects that the temporary array created by DXVK for
storing TCS inputs is a copy of the input arrays and allows
us to avoid copying all of the input data and then indirecting
on it with if-ladders, instead we just do indirect indexing.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_pipeline.c
src/amd/vulkan/radv_shader.c
src/amd/vulkan/radv_shader.h