/[packages]/cauldron/mesa/current/SOURCES/0024-intel-nir-Lower-array-deref-of-vector-UBO-and-SSBO-l.patch
ViewVC logotype

Contents of /cauldron/mesa/current/SOURCES/0024-intel-nir-Lower-array-deref-of-vector-UBO-and-SSBO-l.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1379265 - (show annotations) (download)
Wed Mar 20 17:08:42 2019 UTC (2 months ago) by tmb
File size: 3185 byte(s)
more fixes from staging/19.0 branch
1 From d3941aa8e7d5f79801a82bc51ed96956097fcd41 Mon Sep 17 00:00:00 2001
2 From: Jason Ekstrand <jason.ekstrand@intel.com>
3 Date: Thu, 14 Mar 2019 12:58:16 -0500
4 Subject: [PATCH 24/24] intel/nir: Lower array-deref-of-vector UBO and SSBO
5 loads
6
7 This fixes a serious performance issue with DXVK:
8
9 https://github.com/doitsujin/dxvk/issues/937
10
11 This was caused by a recent change that to improve performance on RADV
12 which back-fired on ANV and killed performance for some apps:
13
14 https://github.com/doitsujin/dxvk/commit/e5a06d3f4a103a54cd4eb51970fedee405d1d698
15
16 Throwing in this bit of lowering lets us come along and CSE those UBO
17 loads (or copy-prop for SSBO load) and get one load where we previously
18 would have gotten several.
19
20 VkPipeline-db results on Kaby Lake:
21
22 total instructions in shared programs: 5115361 -> 5073185 (-0.82%)
23 instructions in affected programs: 1754333 -> 1712157 (-2.40%)
24 helped: 5331
25 HURT: 63
26
27 total cycles in shared programs: 2544501169 -> 2481144545 (-2.49%)
28 cycles in affected programs: 2531058653 -> 2467702029 (-2.50%)
29 helped: 9202
30 HURT: 4323
31
32 total loops in shared programs: 3340 -> 3331 (-0.27%)
33 loops in affected programs: 9 -> 0
34 helped: 9
35 HURT: 0
36
37 total spills in shared programs: 3246 -> 3053 (-5.95%)
38 spills in affected programs: 384 -> 191 (-50.26%)
39 helped: 10
40 HURT: 5
41
42 total fills in shared programs: 4626 -> 4452 (-3.76%)
43 fills in affected programs: 439 -> 265 (-39.64%)
44 helped: 10
45 HURT: 5
46
47 All of the shaders with hurt spilling were in Rise of the Tomb Raider
48 which also had shaders solidly helped in the spilling department. Not
49 shown in those results (because I've not had success dumping the
50 shaders) is Witcher 3 where this reduces spilling and improves over-all
51 perf by around 20-25%. There were no shader-db changes. Apparently,
52 this just isn't a pattern that happens in OpenGL.
53
54 Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
55 Cc: "19.0" mesa-stable@lists.freedesktop.org
56 (cherry picked from commit d3386e73c5976ecec84821d17f05c2fd4b823880)
57 Conflicts resolved by Dylan
58 ---
59 src/intel/compiler/brw_nir.c | 11 +++++++++++
60 1 file changed, 11 insertions(+)
61
62 diff --git a/src/intel/compiler/brw_nir.c b/src/intel/compiler/brw_nir.c
63 index bc3abef709a..ca3d038b5b3 100644
64 --- a/src/intel/compiler/brw_nir.c
65 +++ b/src/intel/compiler/brw_nir.c
66 @@ -781,6 +781,17 @@ brw_preprocess_nir(const struct brw_compiler *compiler, nir_shader *nir)
67
68 OPT(brw_nir_lower_mem_access_bit_sizes);
69
70 + /* Lower array derefs of vectors for SSBO and UBO loads. For both UBOs and
71 + * SSBOs, our back-end is capable of loading an entire vec4 at a time and
72 + * we would like to take advantage of that whenever possible regardless of
73 + * whether or not the app gives us full loads. This should allow the
74 + * optimizer to combine UBO and SSBO load operations and save us some send
75 + * messages.
76 + */
77 + OPT(nir_lower_array_deref_of_vec,
78 + nir_var_mem_ubo | nir_var_mem_ssbo,
79 + nir_lower_direct_array_deref_of_vec_load);
80 +
81 /* Get rid of split copies */
82 nir = brw_nir_optimize(nir, compiler, is_scalar, false);
83
84 --
85 2.21.0
86

  ViewVC Help
Powered by ViewVC 1.1.26