Mesa (master): nir: Rename nir_lower_cl_images_to_tex, replace 'cl' with 'readonly'

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Apr 24 01:11:09 UTC 2021


Module: Mesa
Branch: master
Commit: 29c973140065f05f56aab254c70013d11e969c45
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=29c973140065f05f56aab254c70013d11e969c45

Author: Jesse Natalie <jenatali at microsoft.com>
Date:   Tue Apr 20 07:43:18 2021 -0700

nir: Rename nir_lower_cl_images_to_tex, replace 'cl' with 'readonly'

Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10356>

---

 src/compiler/Makefile.sources                                     | 2 +-
 src/compiler/nir/meson.build                                      | 2 +-
 src/compiler/nir/nir.h                                            | 2 +-
 ...ower_cl_images_to_tex.c => nir_lower_readonly_images_to_tex.c} | 8 ++++----
 src/gallium/frontends/clover/nir/invocation.cpp                   | 2 +-
 src/microsoft/clc/clc_compiler.c                                  | 2 +-
 6 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/compiler/Makefile.sources b/src/compiler/Makefile.sources
index a3a04f88c23..73ae56eb686 100644
--- a/src/compiler/Makefile.sources
+++ b/src/compiler/Makefile.sources
@@ -246,7 +246,6 @@ NIR_FILES = \
 	nir/nir_lower_bool_to_bitsize.c \
 	nir/nir_lower_bool_to_float.c \
 	nir/nir_lower_bool_to_int32.c \
-	nir/nir_lower_cl_images_to_tex.c \
 	nir/nir_lower_clamp_color_outputs.c \
 	nir/nir_lower_clip.c \
 	nir/nir_lower_clip_cull_distance_arrays.c \
@@ -293,6 +292,7 @@ NIR_FILES = \
 	nir/nir_lower_point_size_mov.c \
 	nir/nir_lower_printf.c \
 	nir/nir_lower_regs_to_ssa.c \
+	nir/nir_lower_readonly_images_to_tex.c \
 	nir/nir_lower_returns.c \
 	nir/nir_lower_samplers.c \
 	nir/nir_lower_scratch.c \
diff --git a/src/compiler/nir/meson.build b/src/compiler/nir/meson.build
index 1fcd4fc6a22..847142de0d2 100644
--- a/src/compiler/nir/meson.build
+++ b/src/compiler/nir/meson.build
@@ -133,7 +133,6 @@ files_libnir = files(
   'nir_lower_bool_to_bitsize.c',
   'nir_lower_bool_to_float.c',
   'nir_lower_bool_to_int32.c',
-  'nir_lower_cl_images_to_tex.c',
   'nir_lower_clamp_color_outputs.c',
   'nir_lower_clip.c',
   'nir_lower_clip_cull_distance_arrays.c',
@@ -182,6 +181,7 @@ files_libnir = files(
   'nir_lower_point_size_mov.c',
   'nir_lower_printf.c',
   'nir_lower_regs_to_ssa.c',
+  'nir_lower_readonly_images_to_tex.c',
   'nir_lower_returns.c',
   'nir_lower_samplers.c',
   'nir_lower_scratch.c',
diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h
index d71dc4d72c3..49d0e457610 100644
--- a/src/compiler/nir/nir.h
+++ b/src/compiler/nir/nir.h
@@ -4847,7 +4847,7 @@ typedef struct nir_lower_tex_options {
 bool nir_lower_tex(nir_shader *shader,
                    const nir_lower_tex_options *options);
 
-bool nir_lower_cl_images_to_tex(nir_shader *shader);
+bool nir_lower_readonly_images_to_tex(nir_shader *shader);
 
 enum nir_lower_non_uniform_access_type {
    nir_lower_non_uniform_ubo_access     = (1 << 0),
diff --git a/src/compiler/nir/nir_lower_cl_images_to_tex.c b/src/compiler/nir/nir_lower_readonly_images_to_tex.c
similarity index 95%
rename from src/compiler/nir/nir_lower_cl_images_to_tex.c
rename to src/compiler/nir/nir_lower_readonly_images_to_tex.c
index 3cd224bcf91..5232f9417f0 100644
--- a/src/compiler/nir/nir_lower_cl_images_to_tex.c
+++ b/src/compiler/nir/nir_lower_readonly_images_to_tex.c
@@ -25,7 +25,7 @@
 #include "nir_builder.h"
 
 static bool
-lower_cl_images_to_tex_impl(nir_function_impl *impl)
+lower_readonly_images_to_tex_impl(nir_function_impl *impl)
 {
    bool progress = false;
 
@@ -147,14 +147,14 @@ lower_cl_images_to_tex_impl(nir_function_impl *impl)
    return progress;
 }
 
-/** Lowers OpenCL image ops to texture ops for read-only images */
+/** Lowers image ops to texture ops for read-only images */
 bool
-nir_lower_cl_images_to_tex(nir_shader *shader)
+nir_lower_readonly_images_to_tex(nir_shader *shader)
 {
    bool progress = false;
 
    nir_foreach_function(function, shader) {
-      if (function->impl && lower_cl_images_to_tex_impl(function->impl))
+      if (function->impl && lower_readonly_images_to_tex_impl(function->impl))
          progress = true;
    }
 
diff --git a/src/gallium/frontends/clover/nir/invocation.cpp b/src/gallium/frontends/clover/nir/invocation.cpp
index 197eda8b976..0c24a553f4b 100644
--- a/src/gallium/frontends/clover/nir/invocation.cpp
+++ b/src/gallium/frontends/clover/nir/invocation.cpp
@@ -504,7 +504,7 @@ module clover::nir::spirv_to_nir(const module &mod, const device &dev,
                  glsl_get_cl_type_size_align);
 
       NIR_PASS_V(nir, nir_opt_deref);
-      NIR_PASS_V(nir, nir_lower_cl_images_to_tex);
+      NIR_PASS_V(nir, nir_lower_readonly_images_to_tex);
       NIR_PASS_V(nir, clover_nir_lower_images);
       NIR_PASS_V(nir, nir_lower_memcpy);
 
diff --git a/src/microsoft/clc/clc_compiler.c b/src/microsoft/clc/clc_compiler.c
index 427415e6057..de1449abe0e 100644
--- a/src/microsoft/clc/clc_compiler.c
+++ b/src/microsoft/clc/clc_compiler.c
@@ -1284,7 +1284,7 @@ clc_to_dxil(struct clc_context *ctx,
    }
 
    // Needs to come before lower_explicit_io
-   NIR_PASS_V(nir, nir_lower_cl_images_to_tex);
+   NIR_PASS_V(nir, nir_lower_readonly_images_to_tex);
    struct clc_image_lower_context image_lower_context = { metadata, &srv_id, &uav_id };
    NIR_PASS_V(nir, clc_lower_images, &image_lower_context);
    NIR_PASS_V(nir, clc_lower_nonnormalized_samplers, int_sampler_states);



More information about the mesa-commit mailing list