summaryrefslogtreecommitdiff
path: root/src/mesa/glapi
diff options
context:
space:
mode:
authorKendall Bennett <KendallB@scitechsoft.com>2003-10-22 21:02:15 +0000
committerKendall Bennett <KendallB@scitechsoft.com>2003-10-22 21:02:15 +0000
commit15c37348a5d47ece17ffef38978aa8253363e6ee (patch)
tree9158589d812955dbb7a8c4b210e592de6cc255c9 /src/mesa/glapi
parent23f45833aa6c9b90f48ce5aa08dca6dadc49f62f (diff)
More SciTech SNAP updates. Some of these files didn't really change, but
they show up in the list (GLU stuff) for some reason. The major change here is the addition of code in the glx86asm.py file to generate assembler stub entry points with the correct name decorations for _stdcall calling conventions so this can be used on Windows boxes.
Diffstat (limited to 'src/mesa/glapi')
-rw-r--r--src/mesa/glapi/glx86asm.py35
1 files changed, 25 insertions, 10 deletions
diff --git a/src/mesa/glapi/glx86asm.py b/src/mesa/glapi/glx86asm.py
index ea0479720d..f070c23ea1 100644
--- a/src/mesa/glapi/glx86asm.py
+++ b/src/mesa/glapi/glx86asm.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
-# $Id: glx86asm.py,v 1.7 2003/10/14 23:47:21 kendallb Exp $
+# $Id: glx86asm.py,v 1.8 2003/10/22 21:02:15 kendallb Exp $
# Mesa 3-D graphics library
# Version: 4.1
@@ -43,11 +43,13 @@ def PrintHead():
print '#include "glapioffsets.h"'
print ''
print '#ifndef __WIN32__'
- print ''
- print '#if defined(USE_MGL_NAMESPACE)'
- print '#define GL_PREFIX(n) GLNAME(CONCAT(mgl,n))'
+ print ''
+ print '#if defined(STDCALL_API)'
+ print '#define GL_PREFIX(n,n2) GLNAME(CONCAT(gl,n2))'
+ print '#elif defined(USE_MGL_NAMESPACE)'
+ print '#define GL_PREFIX(n,n2) GLNAME(CONCAT(mgl,n))'
print '#else'
- print '#define GL_PREFIX(n) GLNAME(CONCAT(gl,n))'
+ print '#define GL_PREFIX(n,n2) GLNAME(CONCAT(gl,n))'
print '#endif'
print ''
print '#define GL_OFFSET(x) CODEPTR(REGOFF(4 * x, EAX))'
@@ -84,6 +86,19 @@ def FindOffset(funcName):
return -1
#enddef
+# Find the size of the arguments on the stack for _stdcall name mangling
+def FindStackSize(typeList):
+ result = 0
+ for typ in typeList:
+ if typ == 'GLdouble' or typ == 'GLclampd':
+ result += 8;
+ else:
+ result += 4;
+ #endif
+ #endfor
+ return result
+#enddef
+
def EmitFunction(name, returnType, argTypeList, argNameList, alias, offset):
argList = apiparser.MakeArgList(argTypeList, argNameList)
if alias != '':
@@ -105,18 +120,18 @@ def EmitFunction(name, returnType, argTypeList, argNameList, alias, offset):
# save this info in case we need to look up an alias later
records.append((name, dispatchName, offset))
+ # Find the argument stack size for _stdcall name mangling
+ stackSize = FindStackSize(argTypeList)
+
# print the assembly code
print 'ALIGNTEXT16'
- print "GLOBL_FN(GL_PREFIX(%s))" % (name)
- print "GL_PREFIX(%s):" % (name)
+ print "GLOBL_FN(GL_PREFIX(%s,%s@%s))" % (name, name, stackSize)
+ print "GL_PREFIX(%s,%s@%s):" % (name, name, stackSize)
print '\tMOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)'
print "\tJMP(GL_OFFSET(_gloffset_%s))" % (dispatchName)
print ''
-
#enddef
-
-
PrintHead()
apiparser.ProcessSpecFile("APIspec", EmitFunction)
PrintTail()