Mesa (main): nir/glsl: wrapper field_index()

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon May 16 04:43:32 UTC 2022


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

Author: Timothy Arceri <tarceri at itsqueeze.com>
Date:   Mon Nov  1 15:16:18 2021 +1100

nir/glsl: wrapper field_index()

Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15731>

---

 src/compiler/nir_types.cpp | 6 ++++++
 src/compiler/nir_types.h   | 2 ++
 2 files changed, 8 insertions(+)

diff --git a/src/compiler/nir_types.cpp b/src/compiler/nir_types.cpp
index 3bb989b24f6..e99b755ba9b 100644
--- a/src/compiler/nir_types.cpp
+++ b/src/compiler/nir_types.cpp
@@ -992,6 +992,12 @@ glsl_type_get_image_count(const struct glsl_type *type)
    return glsl_type_count(type, GLSL_TYPE_IMAGE);
 }
 
+int
+glsl_get_field_index(const struct glsl_type *type, const char *name)
+{
+   return type->field_index(name);
+}
+
 enum glsl_interface_packing
 glsl_get_internal_ifc_packing(const struct glsl_type *type,
                               bool std430_supported)
diff --git a/src/compiler/nir_types.h b/src/compiler/nir_types.h
index 1365cdf056a..d86f995fe10 100644
--- a/src/compiler/nir_types.h
+++ b/src/compiler/nir_types.h
@@ -260,6 +260,8 @@ unsigned glsl_type_get_sampler_count(const struct glsl_type *type);
 unsigned glsl_type_get_texture_count(const struct glsl_type *type);
 unsigned glsl_type_get_image_count(const struct glsl_type *type);
 
+int glsl_get_field_index(const struct glsl_type *type, const char *name);
+
 bool glsl_type_is_leaf(const struct glsl_type *type);
 
 #ifdef __cplusplus



More information about the mesa-commit mailing list