Mesa (main): nir: Add filter callback for lower_to_scalar to the options

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri May 7 12:33:33 UTC 2021


Module: Mesa
Branch: main
Commit: b4600d9352026358a16a6c0c71e7e03f6fcbcb23
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b4600d9352026358a16a6c0c71e7e03f6fcbcb23

Author: Gert Wollny <gert.wollny at collabora.com>
Date:   Wed Mar 31 10:54:47 2021 +0200

nir: Add filter callback for lower_to_scalar to the options

Signed-off-by: Gert Wollny <gert.wollny at collabora.com>
Reviewed-by: Timothy Arceri <tarceri at itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9943>

---

 src/compiler/nir/nir.h | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h
index d154d41fbaa..1a1f3dbb381 100644
--- a/src/compiler/nir/nir.h
+++ b/src/compiler/nir/nir.h
@@ -3129,6 +3129,12 @@ typedef enum {
    nir_divergence_multiple_workgroup_per_compute_subgroup = (1 << 5),
 } nir_divergence_options;
 
+/** An instruction filtering callback
+ *
+ * Returns true if the instruction should be processed and false otherwise.
+ */
+typedef bool (*nir_instr_filter_cb)(const nir_instr *, const void *);
+
 typedef struct nir_shader_compiler_options {
    bool lower_fdiv;
    bool lower_ffma16;
@@ -3342,6 +3348,7 @@ typedef struct nir_shader_compiler_options {
     */
    bool vectorize_io;
    bool lower_to_scalar;
+   nir_instr_filter_cb lower_to_scalar_filter;
 
    /**
     * Whether nir_opt_vectorize should only create 16-bit 2D vectors.
@@ -4184,12 +4191,6 @@ static inline bool should_print_nir(nir_shader *shader) { return false; }
 
 #define NIR_SKIP(name) should_skip_nir(#name)
 
-/** An instruction filtering callback
- *
- * Returns true if the instruction should be processed and false otherwise.
- */
-typedef bool (*nir_instr_filter_cb)(const nir_instr *, const void *);
-
 /** An instruction filtering callback with writemask
  *
  * Returns true if the instruction should be processed with the associated



More information about the mesa-commit mailing list