Get rid of 5 remaining references to glapitable.h

Closes: #13003
Fixes: 0cebfb15 ("glapi: remove duplicated generated header glapitable.h")

Co-authored-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Yurii Kolesnykov <root@yurikoles.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34682>
(cherry picked from commit 9822fa3ef311a98b3ce79c111201a84782a91b3e)
This commit is contained in:
Yurii Kolesnykov
2025-04-23 18:54:26 +01:00
committed by Eric Engestrom
parent a7dae0fec8
commit c3c65d8b25
6 changed files with 22 additions and 18 deletions

View File

@@ -674,7 +674,7 @@
"description": "Get rid of 5 remaining references to glapitable.h",
"nominated": true,
"nomination_type": 2,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "0cebfb15b568c79bfc7c3298954dff7302407722",
"notes": null

View File

@@ -39,7 +39,7 @@
#include <GL/gl.h>
#include "glapi.h"
#include "glapitable.h"
#include "dispatch.h"
#include "apple_glx.h"
#include "apple_xgl_api.h"
@@ -55,9 +55,10 @@ static void _apple_glapi_create_table(void) {
__ogl_framework_api = _glapi_create_table_from_handle(apple_cgl_get_dl_handle(), "gl");
assert(__ogl_framework_api);
__applegl_api = malloc(sizeof(struct _glapi_table));
size_t glapi_table_size = _gloffset_COUNT * sizeof(_glapi_proc*);
__applegl_api = malloc(glapi_table_size);
assert(__applegl_api);
memcpy(__applegl_api, __ogl_framework_api, sizeof(struct _glapi_table));
memcpy(__applegl_api, __ogl_framework_api, glapi_table_size);
_glapi_table_patch(__applegl_api, "ReadPixels", __applegl_glReadPixels);
_glapi_table_patch(__applegl_api, "CopyPixels", __applegl_glCopyPixels);
@@ -72,6 +73,7 @@ void apple_mesa_glapi_set_dispatch(void) {
void apple_glapi_oglfw_viewport_scissor(GLint x, GLint y, GLsizei width, GLsizei height) {
_apple_glapi_create_table();
__ogl_framework_api->Viewport(x, y, width, height);
__ogl_framework_api->Scissor(x, y, width, height);
CALL_Viewport(__ogl_framework_api, (x, y, width, height));
CALL_Scissor(__ogl_framework_api, (x, y, width, height));
}

View File

@@ -37,7 +37,8 @@
#include "glxclient.h"
#include "apple_glx_context.h"
#include "apple_xgl_api.h"
#include "glapitable.h"
#include "glapi.h"
#include "dispatch.h"
extern struct _glapi_table * __ogl_framework_api;
@@ -102,8 +103,7 @@ __applegl_glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height,
struct apple_xgl_saved_state saved;
SetRead(&saved);
__ogl_framework_api->ReadPixels(x, y, width, height, format, type, pixels);
CALL_ReadPixels(__ogl_framework_api, (x, y, width, height, format, type, pixels));
UnsetRead(&saved);
}
@@ -115,7 +115,7 @@ __applegl_glCopyPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum t
SetRead(&saved);
__ogl_framework_api->CopyPixels(x, y, width, height, type);
CALL_CopyPixels(__ogl_framework_api, (x, y, width, height, type));
UnsetRead(&saved);
}

View File

@@ -40,7 +40,8 @@
#include "glxclient.h"
#include "apple_glx_context.h"
#include "apple_xgl_api.h"
#include "glapitable.h"
#include "glapi.h"
#include "dispatch.h"
extern struct _glapi_table * __ogl_framework_api;
@@ -75,10 +76,10 @@ __applegl_glDrawBuffer(GLenum mode)
break;
}
__ogl_framework_api->DrawBuffers(n, buf);
CALL_DrawBuffers(__ogl_framework_api, (n, buf));
}
else {
__ogl_framework_api->DrawBuffer(mode);
CALL_DrawBuffer(__ogl_framework_api, (mode));
}
}
@@ -116,9 +117,9 @@ __applegl_glDrawBuffers(GLsizei n, const GLenum * bufs)
newbuf[outi++] = GL_FRONT_RIGHT;
}
__ogl_framework_api->DrawBuffers(outi, newbuf);
CALL_DrawBuffers(__ogl_framework_api, (outi, newbuf));
}
else {
__ogl_framework_api->DrawBuffers(n, bufs);
CALL_DrawBuffers(__ogl_framework_api, (n, bufs));
}
}

View File

@@ -30,7 +30,8 @@
#include "glxclient.h"
#include "apple_glx_context.h"
#include "apple_xgl_api.h"
#include "glapitable.h"
#include "glapi.h"
#include "dispatch.h"
extern struct _glapi_table * __ogl_framework_api;
@@ -43,5 +44,5 @@ __applegl_glViewport(GLint x, GLint y, GLsizei width, GLsizei height)
if (gc != &dummyContext && gc->driContext)
apple_glx_context_update(dpy, gc->driContext);
__ogl_framework_api->Viewport(x, y, width, height);
CALL_Viewport(__ogl_framework_api, (x, y, width, height));
}

View File

@@ -50,7 +50,7 @@ header = """/* GLXEXT is the define used in the xserver when the GLX extension i
#include <string.h>
#include "glapi.h"
#include "glapitable.h"
#include "dispatch.h"
#ifdef GLXEXT
#include "os.h"