Mesa (main): nir/nir_opt_move: allow to move uniform loads
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Thu Feb 24 12:04:39 UTC 2022
Module: Mesa
Branch: main
Commit: 0a0446870404c5d4b259f51cdfffac903fd80dc1
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=0a0446870404c5d4b259f51cdfffac903fd80dc1
Author: Iago Toral Quiroga <itoral at igalia.com>
Date: Thu Feb 17 10:14:45 2022 +0100
nir/nir_opt_move: allow to move uniform loads
Reviewed-by: Jason Ekstrand <jason.ekstrand at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15056>
---
src/compiler/nir/nir.h | 13 +++++++------
src/compiler/nir/nir_opt_sink.c | 2 ++
2 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h
index 865b5ba454d..a86c1af6e7f 100644
--- a/src/compiler/nir/nir.h
+++ b/src/compiler/nir/nir.h
@@ -5256,12 +5256,13 @@ bool nir_opt_large_constants(nir_shader *shader,
bool nir_opt_loop_unroll(nir_shader *shader);
typedef enum {
- nir_move_const_undef = (1 << 0),
- nir_move_load_ubo = (1 << 1),
- nir_move_load_input = (1 << 2),
- nir_move_comparisons = (1 << 3),
- nir_move_copies = (1 << 4),
- nir_move_load_ssbo = (1 << 5),
+ nir_move_const_undef = (1 << 0),
+ nir_move_load_ubo = (1 << 1),
+ nir_move_load_input = (1 << 2),
+ nir_move_comparisons = (1 << 3),
+ nir_move_copies = (1 << 4),
+ nir_move_load_ssbo = (1 << 5),
+ nir_move_load_uniform = (1 << 6),
} nir_move_options;
bool nir_can_move_instr(nir_instr *instr, nir_move_options options);
diff --git a/src/compiler/nir/nir_opt_sink.c b/src/compiler/nir/nir_opt_sink.c
index 13eeb9ea54d..73607655fa9 100644
--- a/src/compiler/nir/nir_opt_sink.c
+++ b/src/compiler/nir/nir_opt_sink.c
@@ -64,6 +64,8 @@ nir_can_move_instr(nir_instr *instr, nir_move_options options)
case nir_intrinsic_load_interpolated_input:
case nir_intrinsic_load_per_vertex_input:
return options & nir_move_load_input;
+ case nir_intrinsic_load_uniform:
+ return options & nir_move_load_uniform;
default:
return false;
}
More information about the mesa-commit
mailing list