mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 04:58:05 +02:00
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:
parent
bcd7538d03
commit
df0623e51a
3 changed files with 20 additions and 1 deletions
|
|
@ -162,10 +162,18 @@ rusticl_opencl_bindings_rs = rust.bindgen(
|
||||||
'--raw-line', 'unsafe impl std::marker::Sync for _cl_image_desc {}',
|
'--raw-line', 'unsafe impl std::marker::Sync for _cl_image_desc {}',
|
||||||
'--allowlist-type', 'cl_.*',
|
'--allowlist-type', 'cl_.*',
|
||||||
'--allowlist-var', '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
|
# 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_kernel_(arg|work_group)_info',
|
||||||
'--new-type-alias-deref', 'cl_(event|profiling)_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 : [
|
args : [
|
||||||
rusticl_bindgen_args,
|
rusticl_bindgen_args,
|
||||||
|
'--allowlist-function', 'close',
|
||||||
|
'--allowlist-function', 'dlsym',
|
||||||
'--allowlist-function', 'free',
|
'--allowlist-function', 'free',
|
||||||
'--allowlist-function', 'malloc',
|
'--allowlist-function', 'malloc',
|
||||||
]
|
]
|
||||||
|
|
@ -312,6 +322,9 @@ rusticl_mesa_bindings_rs = rust.bindgen(
|
||||||
# rusticl C functions
|
# rusticl C functions
|
||||||
'--allowlist-function', 'rusticl_.*',
|
'--allowlist-function', 'rusticl_.*',
|
||||||
'--allowlist-function', 'std(err|out)_ptr',
|
'--allowlist-function', 'std(err|out)_ptr',
|
||||||
|
|
||||||
|
# winsys
|
||||||
|
'--allowlist-var', 'WINSYS_HANDLE_TYPE_.*',
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1 +1,3 @@
|
||||||
|
#include <dlfcn.h>
|
||||||
|
#include <unistd.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,8 @@
|
||||||
#include <CL/cl_icd.h>
|
#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; }
|
#define DECL_CL_STRUCT(name) struct name { const cl_icd_dispatch *dispatch; }
|
||||||
DECL_CL_STRUCT(_cl_command_queue);
|
DECL_CL_STRUCT(_cl_command_queue);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue