From 201e36e77d6ca616f75f14d5f1c31f0062ae4366 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 13 Mar 2015 10:20:29 -0600 Subject: mapi: add new _glapi_new_nop_table() and _glapi_set_nop_handler() _glapi_new_nop_table() creates a new dispatch table populated with pointers to no-op functions. _glapi_set_nop_handler() is used to register a callback function which will be called from each of the no-op functions. Now we always generate a separate no-op function for each GL entrypoint. This allows us to do proper stack clean-up for Windows __stdcall and lets us report the actual function name in error messages. Before this change, for non-Windows release builds we used a single no-op function for all entrypoints. Reviewed-by: Jose Fonseca --- src/mapi/glapi/glapi.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/mapi/glapi/glapi.h') diff --git a/src/mapi/glapi/glapi.h b/src/mapi/glapi/glapi.h index 8d991fb..673295b 100644 --- a/src/mapi/glapi/glapi.h +++ b/src/mapi/glapi/glapi.h @@ -80,6 +80,9 @@ extern "C" { #endif typedef void (*_glapi_proc)(void); + +typedef void (*_glapi_nop_handler_proc)(const char *name); + struct _glapi_table; @@ -159,6 +162,14 @@ _GLAPI_EXPORT struct _glapi_table * _glapi_create_table_from_handle(void *handle, const char *symbol_prefix); +_GLAPI_EXPORT void +_glapi_set_nop_handler(_glapi_nop_handler_proc func); + +/** Return pointer to new dispatch table filled with no-op functions */ +_GLAPI_EXPORT struct _glapi_table * +_glapi_new_nop_table(unsigned num_entries); + + /** Deprecated function */ _GLAPI_EXPORT unsigned long _glthread_GetID(void); -- cgit v1.1