glapi: remove dead code

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33634>
This commit is contained in:
Marek Olšák
2025-01-23 05:00:35 -05:00
committed by Marge Bot
parent a22e50e6fe
commit 142202cd00
12 changed files with 7 additions and 207 deletions

View File

@@ -29,7 +29,7 @@
#include <stdint.h>
#include "entry.h"
#include "u_current.h"
#include "glapi/glapi.h"
#include "util/u_endian.h"
#include "util/u_thread.h"

View File

@@ -1,39 +0,0 @@
/*
* Mesa 3-D graphics library
*
* Copyright (C) 2010 LunarG Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
* Authors:
* Chia-I Wu <olv@lunarg.com>
*/
#include "glapi/glapi.h"
#include "u_current.h"
/*
* _mesa_glapi_Dispatch, _glapi_Context
* _mesa_glapi_tls_Dispatch, _mesa_glapi_tls_Context,
* _mesa_glapi_set_context, _mesa_glapi_get_context,
* _glapi_destroy_multithread, _glapi_check_multithread
* _mesa_glapi_set_dispatch, and _mesa_glapi_get_dispatch
* are defined in u_current.c.
*/

View File

@@ -86,7 +86,6 @@ _GLAPI_EXPORT extern __THREAD_INITIAL_EXEC void * _mesa_glapi_tls_Context;
#endif
_GLAPI_EXPORT extern const struct _glapi_table *_mesa_glapi_Dispatch;
_GLAPI_EXPORT extern const void *_glapi_Context;
#if DETECT_OS_WINDOWS && !defined(MAPI_MODE_UTIL) && !defined(MAPI_MODE_GLAPI)
# define GET_DISPATCH() _mesa_glapi_get_dispatch()
@@ -96,13 +95,6 @@ _GLAPI_EXPORT extern const void *_glapi_Context;
# define GET_CURRENT_CONTEXT(C) struct gl_context *C = (struct gl_context *) _mesa_glapi_tls_Context
#endif
_GLAPI_EXPORT void
_glapi_destroy_multithread(void);
_GLAPI_EXPORT void
_glapi_check_multithread(void);
_GLAPI_EXPORT void
_mesa_glapi_set_context(void *context);
@@ -124,9 +116,6 @@ _GLAPI_EXPORT unsigned int
_mesa_glapi_get_dispatch_table_size(void);
_GLAPI_EXPORT int
_glapi_add_dispatch( const char * function_name );
_GLAPI_EXPORT int
_mesa_glapi_get_proc_offset(const char *funcName);
@@ -156,22 +145,6 @@ _GLAPI_EXPORT struct _glapi_table *
_glapi_new_nop_table(unsigned num_entries);
/** Deprecated function */
_GLAPI_EXPORT unsigned long
_glthread_GetID(void);
/*
* These stubs are kept so that the old DRI drivers still load.
*/
_GLAPI_EXPORT void
_glapi_noop_enable_warnings(unsigned char enable);
_GLAPI_EXPORT void
_glapi_set_warning_func(_glapi_proc func);
#ifdef __cplusplus
}
#endif

View File

@@ -87,18 +87,6 @@ get_static_proc_offset(const char *funcName)
* Extension function management.
*/
/**
* Initializes the glapi relocs table, and returns the offset of the given
* function in the dispatch table.
*/
int
_glapi_add_dispatch(const char *funcName)
{
init_glapi_relocs_once();
return get_static_proc_offset(funcName);
}
/**
* Return offset of entrypoint for named function within dispatch table.
*/

View File

@@ -49,17 +49,6 @@
#include "glapi/glapi_priv.h"
void
_glapi_noop_enable_warnings(unsigned char enable)
{
}
void
_glapi_set_warning_func(_glapi_proc func)
{
}
/**
* We'll jump though this function pointer whenever a no-op function
* is called.

View File

@@ -39,12 +39,10 @@ if with_platform_windows
endif
static_glapi_files += files(
'../u_current.c',
'../u_current.h',
'glapi_dispatch.c',
'glapi_entrypoint.c',
'glapi_getproc.c',
'glapi_nop.c',
'glapi.c',
'glapi.h',
'glapi_priv.h',
)

View File

@@ -29,15 +29,13 @@
#include <string.h>
#include <stdlib.h>
#include "glapi/glapi.h"
#include "u_current.h"
#include "table.h" /* for MAPI_TABLE_NUM_SLOTS */
#include "stub.h"
/*
* _mesa_glapi_Dispatch, _glapi_Context
* _mesa_glapi_Dispatch,
* _mesa_glapi_tls_Dispatch, _mesa_glapi_tls_Context,
* _mesa_glapi_set_context, _mesa_glapi_get_context,
* _glapi_destroy_multithread, _glapi_check_multithread
* _mesa_glapi_set_dispatch, and _mesa_glapi_get_dispatch
* are defined in u_current.c.
*/
@@ -52,22 +50,6 @@ _mesa_glapi_get_dispatch_table_size(void)
return MAPI_TABLE_NUM_SLOTS;
}
/**
* Initializes the glapi relocs table (no-op for shared-glapi), and returns the
* offset of the given function in the dispatch table.
*/
int
_glapi_add_dispatch( const char * function_name )
{
assert(function_name[0] == 'g' && function_name[1] == 'l');
const struct mapi_stub *stub = stub_find_public(function_name + 2);
if (!stub)
return -1;
return stub_get_slot(stub);
}
static const struct mapi_stub *
_glapi_get_stub(const char *name)
{
@@ -132,23 +114,3 @@ _glapi_set_nop_handler(_glapi_nop_handler_proc func)
{
table_set_noop_handler(func);
}
/**
* This is a deprecated function which should not be used anymore.
* It's only present to satisfy linking with older versions of libGL.
*/
unsigned long
_glthread_GetID(void)
{
return 0;
}
void
_glapi_noop_enable_warnings(unsigned char enable)
{
}
void
_glapi_set_warning_func(_glapi_proc func)
{
}

View File

@@ -4,7 +4,6 @@
files_shared_glapi = files(
'../entry.c',
'../u_current.c',
'../u_current.h',
'glapi.c',
'stub.c',
'stub.h',

View File

@@ -32,7 +32,7 @@
#include "util/macros.h"
#include "util/simple_mtx.h"
#include "u_current.h"
#include "glapi/glapi.h"
#include "entry.h"
#include "stub.h"
#include "table.h"

View File

@@ -34,47 +34,14 @@
#include "mapi_tmp.h"
#define MAPI_TABLE_NUM_SLOTS (MAPI_TABLE_NUM_STATIC + MAPI_TABLE_NUM_DYNAMIC)
#define MAPI_TABLE_SIZE (MAPI_TABLE_NUM_SLOTS * sizeof(mapi_func))
struct _glapi_table;
extern const mapi_func table_noop_array[];
typedef void (*nop_handler_proc)(const char *name);
void
table_set_noop_handler(nop_handler_proc func);
/**
* Get the no-op dispatch table.
*/
static inline const struct _glapi_table *
table_get_noop(void)
{
return (const struct _glapi_table *) table_noop_array;
}
/**
* Set the function of a slot.
*/
static inline void
table_set_func(struct _glapi_table *tbl, int slot, mapi_func func)
{
mapi_func *funcs = (mapi_func *) tbl;
funcs[slot] = func;
}
/**
* Return the function of a slot.
*/
static inline mapi_func
table_get_func(const struct _glapi_table *tbl, int slot)
{
const mapi_func *funcs = (const mapi_func *) tbl;
return funcs[slot];
}
#endif /* _TABLE_H_ */

View File

@@ -28,29 +28,12 @@
* The dispatch table (struct _glapi_table) is basically just a list
* of function pointers.
* There are functions to set/get the current dispatch table for the
* current thread and to manage registration/dispatch of dynamically
* added extension functions.
*
* It's intended that this file and the other glapi*.[ch] files are
* flexible enough to be reused in several places: XFree86, DRI-
* based libGL.so, and perhaps the SGI SI.
*
* NOTE: There are no dependencies on Mesa in this code.
*
* Versions (API changes):
* 2000/02/23 - original version for Mesa 3.3 and XFree86 4.0
* 2001/01/16 - added dispatch override feature for Mesa 3.5
* 2002/06/28 - added _glapi_set_warning_func(), Mesa 4.1.
* 2002/10/01 - _mesa_glapi_get_proc_address() will now generate new entrypoints
* itself (using offset ~0). _glapi_add_entrypoint() can be
* called afterward and it'll fill in the correct dispatch
* offset. This allows DRI libGL to avoid probing for DRI
* drivers! No changes to the public glapi interface.
* current thread.
*/
#include "c11/threads.h"
#include "util/u_thread.h"
#include "u_current.h"
#include "glapi/glapi.h"
#ifndef MAPI_MODE_UTIL
@@ -77,9 +60,9 @@ extern void (*__glapi_noop_table[])(void);
* purpose.
*
* In multi threaded case, The TLS variables \c _mesa_glapi_tls_Dispatch and
* \c _mesa_glapi_tls_Context are used. Having \c _mesa_glapi_Dispatch and \c _glapi_Context
* \c _mesa_glapi_tls_Context are used. Having \c _mesa_glapi_Dispatch
* be hardcoded to \c NULL maintains binary compatability between TLS enabled
* loaders and non-TLS DRI drivers. When \c _mesa_glapi_Dispatch and \c _glapi_Context
* loaders and non-TLS DRI drivers. When \c _mesa_glapi_Dispatch
* are \c NULL, the thread state data \c ContextTSD are used. Drivers and the
* static dispatch functions access these variables via \c _mesa_glapi_get_dispatch
* and \c _mesa_glapi_get_context.
@@ -91,24 +74,10 @@ __THREAD_INITIAL_EXEC struct _glapi_table *_mesa_glapi_tls_Dispatch
__THREAD_INITIAL_EXEC void *_mesa_glapi_tls_Context;
/* not used, but defined for compatibility */
const struct _glapi_table *_mesa_glapi_Dispatch;
const void *_glapi_Context;
/*@}*/
/* not used, but defined for compatibility */
void
_glapi_destroy_multithread(void)
{
}
/* not used, but defined for compatibility */
void
_glapi_check_multithread(void)
{
}
/**
* Set the current context pointer for this thread.
* The context pointer is an opaque type which should be cast to

View File

@@ -1,6 +0,0 @@
#ifndef _U_CURRENT_H_
#define _U_CURRENT_H_
#include "glapi/glapi.h"
#endif /* _U_CURRENT_H_ */