summaryrefslogtreecommitdiffstats
path: root/src/intel/compiler/brw_nir.c
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2018-06-28 22:44:43 -0700
committerJason Ekstrand <[email protected]>2018-07-02 12:09:50 -0700
commit06412bfc9869247f33b6bba8e256cf33f71f6973 (patch)
tree9ae51aa0bfb137a804f9de0df661298c308c1e3e /src/intel/compiler/brw_nir.c
parent70ce8804341479aba8115784d8dad1166315e402 (diff)
anv,intel: Enable nir_opt_large_constants for Vulkan
According to RenderDoc, this shaves 99.6% of the run time off of the ambient occlusion pass in Skyrim Special Edition when running under DXVK and shaves 92% off the runtime for a reasonably representative frame. When running the actual game, Skyrim goes from being a slide-show to a very stable and playable framerate on my SKL GT4e machine. Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/intel/compiler/brw_nir.c')
-rw-r--r--src/intel/compiler/brw_nir.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/intel/compiler/brw_nir.c b/src/intel/compiler/brw_nir.c
index dfeea73b06a..f4aee3d41ee 100644
--- a/src/intel/compiler/brw_nir.c
+++ b/src/intel/compiler/brw_nir.c
@@ -664,6 +664,13 @@ brw_preprocess_nir(const struct brw_compiler *compiler, nir_shader *nir)
nir = brw_nir_optimize(nir, compiler, is_scalar);
+ /* This needs to be run after the first optimization pass but before we
+ * lower indirect derefs away
+ */
+ if (compiler->supports_shader_constants) {
+ OPT(nir_opt_large_constants, NULL, 32);
+ }
+
nir_lower_bit_size(nir, lower_bit_size_callback, NULL);
if (is_scalar) {