From 6dbe075f92b2b30c2e8b0537156317c1dfc55e48 Mon Sep 17 00:00:00 2001 From: Timothy Arceri Date: Mon, 1 Nov 2021 15:16:18 +1100 Subject: [PATCH] nir/glsl: wrapper field_index() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Marek Olšák Part-of: --- 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