rusticl, meson: Add gl/egl/glx bindings

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21305>
This commit is contained in:
Antonio Gomes 2023-04-22 18:25:21 -03:00 committed by Marge Bot
parent bcd7538d03
commit df0623e51a
3 changed files with 20 additions and 1 deletions

View file

@ -162,10 +162,18 @@ rusticl_opencl_bindings_rs = rust.bindgen(
'--raw-line', 'unsafe impl std::marker::Sync for _cl_image_desc {}',
'--allowlist-type', 'cl_.*',
'--allowlist-var', 'CL_.*',
# needed for gl_sharing extension
'--allowlist-var', 'GL_.*',
'--allowlist-var', 'MESA_GLINTEROP_.*',
'--allowlist-type', 'PFNEGLGETPROCADDRESSPROC',
'--allowlist-type', 'PFNGLXGETPROCADDRESSPROC',
'--allowlist-type', 'PFNMESAGLINTEROP.*',
# some info types need to be strongly typed so we can implement various get_infos
'--new-type-alias-deref', 'cl_(mem|image|pipe)_info',
'--new-type-alias-deref', 'cl_(mem|image|pipe|gl_texture)_info',
'--new-type-alias-deref', 'cl_kernel_(arg|work_group)_info',
'--new-type-alias-deref', 'cl_(event|profiling)_info',
# turn gl interop enums into constfields so we can compare with rust types
'--constified-enum', 'MESA_GLINTEROP_.*',
],
)
@ -233,6 +241,8 @@ rusticl_libc_bindings_rs = rust.bindgen(
],
args : [
rusticl_bindgen_args,
'--allowlist-function', 'close',
'--allowlist-function', 'dlsym',
'--allowlist-function', 'free',
'--allowlist-function', 'malloc',
]
@ -312,6 +322,9 @@ rusticl_mesa_bindings_rs = rust.bindgen(
# rusticl C functions
'--allowlist-function', 'rusticl_.*',
'--allowlist-function', 'std(err|out)_ptr',
# winsys
'--allowlist-var', 'WINSYS_HANDLE_TYPE_.*',
],
)

View file

@ -1 +1,3 @@
#include <dlfcn.h>
#include <unistd.h>
#include <stdlib.h>

View file

@ -1,4 +1,8 @@
#include <CL/cl_icd.h>
#include <EGL/egl.h>
#include <GL/gl.h>
#include <GL/glx.h>
#include "GL/mesa_glinterop.h"
#define DECL_CL_STRUCT(name) struct name { const cl_icd_dispatch *dispatch; }
DECL_CL_STRUCT(_cl_command_queue);