rusticl: make use of new `output_inline_wrapper` meson.rust.bindgen feature

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25265>
This commit is contained in:
Karol Herbst 2023-09-17 12:47:00 +02:00 committed by Marge Bot
parent 3e3eab12d8
commit 53629b0a2d
4 changed files with 8 additions and 158 deletions

View File

@ -253,9 +253,10 @@ rusticl_libc_bindings_rs = rust.bindgen(
]
)
rusticl_mesa_bindings_rs = rust.bindgen(
rusticl_mesa_bindings = rust.bindgen(
input : 'rusticl_mesa_bindings.h',
output : 'rusticl_mesa_bindings.rs',
output_inline_wrapper : 'rusticl_mesa_bindings.c',
include_directories : [
inc_gallium,
inc_gallium_aux,
@ -336,12 +337,12 @@ rusticl_mesa_bindings_rs = rust.bindgen(
rusticl_c = static_library(
'rusticl_c',
[
'rusticl_mesa_inline_bindings_wrapper.c',
'rusticl_mesa_inline_bindings_wrapper.h',
'rusticl_nir.c',
'rusticl_nir.h',
'rusticl_system_bindings.c',
'rusticl_system_bindings.h',
rusticl_mesa_bindings[1],
'rusticl_mesa_bindings.h',
sha1_h,
],
gnu_symbol_visibility : 'hidden',
@ -355,6 +356,7 @@ rusticl_c = static_library(
c_args : [
pre_args,
cl_c_args,
cc.get_supported_arguments('-Wno-missing-prototypes'),
],
dependencies: [
idep_nir_headers,
@ -370,7 +372,7 @@ idep_rusticl_gen = declare_dependency(
libmesa_rust_gen = static_library(
'mesa_rust_gen',
rusticl_mesa_bindings_rs,
rusticl_mesa_bindings[0],
gnu_symbol_visibility : 'hidden',
link_with: [
libgallium,

View File

@ -1,4 +1,3 @@
#include "rusticl_mesa_inline_bindings_wrapper.h"
#include "rusticl_system_bindings.h"
#include "compiler/clc/nir_clc_helpers.h"
@ -18,8 +17,10 @@
#include "util/blob.h"
#include "util/disk_cache.h"
#include "util/hex.h"
#include "util/os_time.h"
#include "util/sha1/sha1.h"
#include "util/u_inlines.h"
#include "util/u_upload_mgr.h"
#include "util/u_printf.h"
#include "util/u_sampler.h"

View File

@ -1,97 +0,0 @@
#include "rusticl_mesa_inline_bindings_wrapper.h"
void
blob_finish(struct blob *blob)
{
__blob_finish(blob);
}
bool
disk_cache_get_function_identifier(void *ptr, struct mesa_sha1 *ctx)
{
return __disk_cache_get_function_identifier(ptr, ctx);
}
char *
mesa_bytes_to_hex(char *buf, const uint8_t *hex_id, unsigned size)
{
return __mesa_bytes_to_hex(buf, hex_id, size);
}
nir_function_impl *
nir_shader_get_entrypoint(const nir_shader *shader)
{
return __nir_shader_get_entrypoint_wraped(shader);
}
void
pipe_resource_reference(struct pipe_resource **dst, struct pipe_resource *src)
{
__pipe_resource_reference_wraped(dst, src);
}
bool
should_skip_nir(const char *name)
{
return __should_skip_nir(name);
}
bool
should_print_nir(nir_shader *shader)
{
return __should_print_nir(shader);
}
void
util_format_pack_rgba(enum pipe_format format, void *dst, const void *src, unsigned w)
{
return __util_format_pack_rgba(format, dst, src, w);
}
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();
}
const struct glsl_type *
glsl_vector_type(enum glsl_base_type base_type, unsigned components)
{
return __glsl_vector_type(base_type, components);
}

View File

@ -1,56 +0,0 @@
#define blob_finish __blob_finish
#define disk_cache_get_function_identifier __disk_cache_get_function_identifier
#define mesa_bytes_to_hex __mesa_bytes_to_hex
#define nir_shader_get_entrypoint __nir_shader_get_entrypoint_wraped
#define pipe_resource_reference __pipe_resource_reference_wraped
#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
#define glsl_vector_type __glsl_vector_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 nir_shader_get_entrypoint
#undef pipe_resource_reference
#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
#undef glsl_vector_type
void blob_finish(struct blob *);
char *mesa_bytes_to_hex(char *buf, const uint8_t *hex_id, unsigned size);
bool disk_cache_get_function_identifier(void *ptr, struct mesa_sha1 *ctx);
nir_function_impl *nir_shader_get_entrypoint(const nir_shader *shader);
void pipe_resource_reference(struct pipe_resource **dst, struct pipe_resource *src);
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);
const struct glsl_type *glsl_vector_type(enum glsl_base_type base_type, unsigned components);