[OPENGL32]

- Implement storing thread data into the TEB
CORE-14024
This commit is contained in:
Jérôme Gardou 2017-11-18 13:49:37 +01:00 committed by Jérôme Gardou
parent 1bfbdb6123
commit 6aaf217b10
7 changed files with 437 additions and 357 deletions

View file

@ -7,9 +7,11 @@
/* X86 opengl API entry points, fast forward to the current thread's dispatch table */
#include <asm.inc>
#include <ks386.inc>
.code
#ifdef OPENG32_USE_TLS
EXTERN _OglTlsIndex:DWORD
EXTERN _TlsGetValue@4:PROC
@ -22,6 +24,23 @@ PUBLIC _gl&name&@&stack
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]
/* Get the GL table */
mov eax, [eax + TEB_GL_TABLE]
/* If we don't have a dispatch table, call the nop */
test eax, eax
jz _nop_&name&@&stack
/* Jump into the ICD */
jmp dword ptr [eax+4*VAL(offset)]
.ENDP
ENDM
#endif
USE_GL_FUNC Accum, 213, 8
USE_GL_FUNC AlphaFunc, 240, 8
@ -360,4 +379,4 @@ USE_GL_FUNC Vertex4sv, 149, 4
USE_GL_FUNC VertexPointer, 321, 16
USE_GL_FUNC Viewport, 305, 16
END
END