rusticl: Add Rust bindings for inline glsl_types functions
authorCaio Oliveira <caio.oliveira@intel.com>
Sat, 16 Sep 2023 17:19:22 +0000 (10:19 -0700)
committerMarge Bot <emma+marge@anholt.net>
Sat, 7 Oct 2023 00:42:55 +0000 (00:42 +0000)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25470>

src/gallium/frontends/rusticl/rusticl_mesa_inline_bindings_wrapper.c
src/gallium/frontends/rusticl/rusticl_mesa_inline_bindings_wrapper.h

index d89fb5b..56c403c 100644 (file)
@@ -54,3 +54,45 @@ mesa_version_string(void)
 {
     return PACKAGE_VERSION MESA_GIT_SHA1;
 }
+
+bool
+glsl_type_is_sampler(const struct glsl_type *t)
+{
+    return __glsl_type_is_sampler(t);
+}
+
+bool
+glsl_type_is_image(const struct glsl_type *t)
+{
+    return __glsl_type_is_image(t);
+}
+
+bool
+glsl_type_is_texture(const struct glsl_type *t)
+{
+    return __glsl_type_is_texture(t);
+}
+
+const struct glsl_type *
+glsl_uint_type(void)
+{
+    return __glsl_uint_type();
+}
+
+const struct glsl_type *
+glsl_uint8_t_type(void)
+{
+    return __glsl_uint8_t_type();
+}
+
+const struct glsl_type *
+glsl_uint64_t_type(void)
+{
+    return __glsl_uint64_t_type();
+}
+
+const struct glsl_type *
+glsl_int16_t_type(void)
+{
+    return __glsl_int16_t_type();
+}
index 8e7a458..6f4ef1b 100644 (file)
@@ -6,12 +6,20 @@
 #define should_print_nir __should_print_nir
 #define should_skip_nir __should_skip_nir
 #define util_format_pack_rgba __util_format_pack_rgba
+#define glsl_type_is_sampler __glsl_type_is_sampler
+#define glsl_type_is_image __glsl_type_is_image
+#define glsl_type_is_texture __glsl_type_is_texture
+#define glsl_uint_type __glsl_uint_type
+#define glsl_uint8_t_type __glsl_uint8_t_type
+#define glsl_uint64_t_type __glsl_uint64_t_type
+#define glsl_int16_t_type __glsl_int16_t_type
 #include "nir.h"
 #include "util/blob.h"
 #include "util/disk_cache.h"
 #include "util/hex.h"
 #include "util/u_inlines.h"
 #include "util/format/u_format.h"
+#include "compiler/glsl_types.h"
 #undef blob_finish
 #undef mesa_bytes_to_hex
 #undef disk_cache_get_function_identifier
 #undef should_print_nir
 #undef should_skip_nir
 #undef util_format_pack_rgba
+#undef glsl_type_is_sampler
+#undef glsl_type_is_image
+#undef glsl_type_is_texture
+#undef glsl_uint_type
+#undef glsl_uint8_t_type
+#undef glsl_uint64_t_type
+#undef glsl_int16_t_type
 
 void blob_finish(struct blob *);
 char *mesa_bytes_to_hex(char *buf, const uint8_t *hex_id, unsigned size);
@@ -30,3 +45,10 @@ void pipe_resource_reference(struct pipe_resource **dst, struct pipe_resource *s
 bool should_skip_nir(const char *);
 bool should_print_nir(nir_shader *);
 void util_format_pack_rgba(enum pipe_format format, void *dst, const void *src, unsigned w);
+bool glsl_type_is_sampler(const struct glsl_type *t);
+bool glsl_type_is_image(const struct glsl_type *t);
+bool glsl_type_is_texture(const struct glsl_type *t);
+const struct glsl_type *glsl_uint_type(void);
+const struct glsl_type *glsl_uint8_t_type(void);
+const struct glsl_type *glsl_uint64_t_type(void);
+const struct glsl_type *glsl_int16_t_type(void);