mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 09:34:43 +00:00
[OPENGL32]
- Get rid of the default stub table, use NULL instead - Simplify stub code by using the appropriate macros CORE-14024
This commit is contained in:
parent
b060a81d5d
commit
31acac46a1
5 changed files with 38 additions and 3710 deletions
File diff suppressed because it is too large
Load diff
|
@ -49,7 +49,6 @@ DllMain(HINSTANCE hInstance, DWORD Reason, LPVOID Reserved)
|
|||
if (!init_tls_data())
|
||||
return FALSE;
|
||||
#endif // defined(OPENGL32_USE_TLS)
|
||||
IntSetCurrentDispatchTable(&StubTable.glDispatchTable);
|
||||
break;
|
||||
|
||||
case DLL_THREAD_DETACH:
|
||||
|
|
|
@ -9,38 +9,48 @@
|
|||
#include <asm.inc>
|
||||
#include <ks386.inc>
|
||||
|
||||
.data
|
||||
ASSUME nothing
|
||||
|
||||
.align 16
|
||||
|
||||
.code
|
||||
|
||||
#ifdef OPENG32_USE_TLS
|
||||
EXTERN _OglTlsIndex:DWORD
|
||||
EXTERN _TlsGetValue@4:PROC
|
||||
#endif
|
||||
|
||||
MACRO(USE_GL_FUNC, name, offset, stack)
|
||||
PUBLIC _gl&name&@&stack
|
||||
.PROC _gl&name&@&stack
|
||||
|
||||
FPO 0, 0, 0, 0, 0, FRAME_FPO
|
||||
|
||||
#ifdef OPENG32_USE_TLS
|
||||
push _OglTlsIndex
|
||||
call _TlsGetValue@4
|
||||
/* If we don't have a thread data, this is a nop */
|
||||
test eax, eax
|
||||
jz name&_fast_ret
|
||||
/* Get the GL table */
|
||||
mov eax, [eax]
|
||||
jmp dword ptr [eax+4*VAL(offset)]
|
||||
.ENDP
|
||||
ENDM
|
||||
#else
|
||||
MACRO(USE_GL_FUNC, name, offset, stack)
|
||||
EXTERN _nop_&name@&stack:PROC
|
||||
PUBLIC _gl&name&@&stack
|
||||
.PROC _gl&name&@&stack
|
||||
/* Get the TEB */
|
||||
mov eax, fs:[TEB_SELF]
|
||||
mov eax, fs:[TEB_SELF]
|
||||
/* Get the GL table */
|
||||
mov eax, [eax + TEB_GL_TABLE]
|
||||
/* If we don't have a dispatch table, call the nop */
|
||||
#endif
|
||||
|
||||
/* If we don't have a dispatch table, this is a nop */
|
||||
test eax, eax
|
||||
jz _nop_&name&@&stack
|
||||
jz name&_fast_ret
|
||||
/* Jump into the ICD */
|
||||
jmp dword ptr [eax+4*VAL(offset)]
|
||||
name&_fast_ret:
|
||||
ret VAL(stack)
|
||||
.ENDP
|
||||
ENDM
|
||||
#endif
|
||||
|
||||
USE_GL_FUNC Accum, 213, 8
|
||||
USE_GL_FUNC AlphaFunc, 240, 8
|
||||
|
|
|
@ -359,9 +359,6 @@ typedef struct _GLCLTPROCTABLE
|
|||
|
||||
typedef VOID (APIENTRY * PFN_SETPROCTABLE)(const GLCLTPROCTABLE*);
|
||||
|
||||
/* Those functions are there in case GL calls are made without a context */
|
||||
extern const GLCLTPROCTABLE StubTable;
|
||||
|
||||
/* This doesn't seem to be anywhere in ddk or psdk */
|
||||
DECLARE_HANDLE(DHGLRC);
|
||||
|
||||
|
|
|
@ -696,7 +696,7 @@ BOOL WINAPI wglMakeCurrent(HDC hdc, HGLRC hglrc)
|
|||
ERR("DrvSetContext failed!\n");
|
||||
/* revert */
|
||||
InterlockedExchange(&ctx->thread_id, 0);
|
||||
IntSetCurrentDispatchTable(&StubTable.glDispatchTable);
|
||||
IntSetCurrentDispatchTable(NULL);
|
||||
SetLastError(ERROR_INVALID_PARAMETER);
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -728,8 +728,7 @@ BOOL WINAPI wglMakeCurrent(HDC hdc, HGLRC hglrc)
|
|||
InterlockedExchange(&old_ctx->thread_id, 0);
|
||||
/* Unset it */
|
||||
IntMakeCurrent(NULL, NULL, NULL);
|
||||
/* Reset the no-op table */
|
||||
set_api_table(&StubTable);
|
||||
IntSetCurrentDispatchTable(NULL);
|
||||
/* Test conformance (extreme cases) */
|
||||
return hglrc == NULL;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue