From 32b361089c59d0677aa8cca39c2398f74fbb61d2 Mon Sep 17 00:00:00 2001 From: Caio Oliveira Date: Sat, 16 Sep 2023 10:19:22 -0700 Subject: [PATCH] rusticl: Add Rust bindings for inline glsl_types functions Reviewed-by: Kenneth Graunke Part-of: --- .../rusticl/rusticl_mesa_inline_bindings_wrapper.c | 42 ++++++++++++++++++++++ .../rusticl/rusticl_mesa_inline_bindings_wrapper.h | 22 ++++++++++++ 2 files changed, 64 insertions(+) diff --git a/src/gallium/frontends/rusticl/rusticl_mesa_inline_bindings_wrapper.c b/src/gallium/frontends/rusticl/rusticl_mesa_inline_bindings_wrapper.c index d89fb5b..56c403c 100644 --- a/src/gallium/frontends/rusticl/rusticl_mesa_inline_bindings_wrapper.c +++ b/src/gallium/frontends/rusticl/rusticl_mesa_inline_bindings_wrapper.c @@ -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(); +} diff --git a/src/gallium/frontends/rusticl/rusticl_mesa_inline_bindings_wrapper.h b/src/gallium/frontends/rusticl/rusticl_mesa_inline_bindings_wrapper.h index 8e7a458..6f4ef1b 100644 --- a/src/gallium/frontends/rusticl/rusticl_mesa_inline_bindings_wrapper.h +++ b/src/gallium/frontends/rusticl/rusticl_mesa_inline_bindings_wrapper.h @@ -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 @@ -20,6 +28,13 @@ #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); -- 2.7.4