Changeset 16381 in vbox
- Timestamp:
- Jan 29, 2009 5:15:36 PM (16 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics/crOpenGL
- Files:
-
- 6 edited
-
Linux_i386_exports.py (modified) (1 diff)
-
Makefile.kmk (modified) (2 diffs)
-
NULLfuncs.py (modified) (1 diff)
-
context.c (modified) (2 diffs)
-
load.c (modified) (1 diff)
-
stub.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/crOpenGL/Linux_i386_exports.py
r15532 r16381 12 12 def GenerateEntrypoints(): 13 13 14 apiutil.CopyrightC()14 #apiutil.CopyrightC() 15 15 16 # Get sorted list of dispatched functions. 17 # The order is very important - it must match cr_opcodes.h 18 # and spu_dispatch_table.h 19 keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt") 16 # Get sorted list of dispatched functions. 17 # The order is very important - it must match cr_opcodes.h 18 # and spu_dispatch_table.h 19 print '%include "iprt/asmdefs.mac"' 20 print "" 21 print "%ifdef RT_ARCH_AMD64" 22 print "extern glim" 23 print "%else ; X86" 24 print "extern glim" 25 print "%endif" 26 print "" 20 27 21 for index in range(len(keys)): 22 func_name = keys[index] 23 if apiutil.Category(func_name) == "Chromium": 24 continue 28 keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt") 25 29 26 print "\t.align 4" 27 print ".globl gl%s" % func_name 28 print "\t.type gl%s,@function" % func_name 29 print "gl%s:" % func_name 30 print "\tmovl glim+%d, %%eax" % (4*index) 31 print "\tjmp *%eax" 32 print "" 30 for index in range(len(keys)): 31 func_name = keys[index] 32 if apiutil.Category(func_name) == "Chromium": 33 continue 34 35 print "BEGINPROC_EXPORTED gl%s" % func_name 36 print "%ifdef RT_ARCH_AMD64" 37 print "\tmov \trax, qword glim+%d" % (8*index) 38 print "\tjmp \t[rax]" 39 print "%else ; X86" 40 print "\tmov \teax, dword glim+%d" % (4*index) 41 print "\tjmp \t[eax]" 42 print "%endif" 43 print "ENDPROC gl%s" % func_name 44 print "" 33 45 34 46 35 print '/*'36 print '*Aliases'37 print '*/'47 print ';' 48 print '; Aliases' 49 print ';' 38 50 39 # Now loop over all the functions and take care of any aliases40 allkeys = apiutil.GetAllFunctions(sys.argv[1]+"/APIspec.txt")41 for func_name in allkeys:42 if "omit" in apiutil.ChromiumProps(func_name):43 continue51 # Now loop over all the functions and take care of any aliases 52 allkeys = apiutil.GetAllFunctions(sys.argv[1]+"/APIspec.txt") 53 for func_name in allkeys: 54 if "omit" in apiutil.ChromiumProps(func_name): 55 continue 44 56 45 if func_name in keys:46 # we already processed this function earlier47 continue57 if func_name in keys: 58 # we already processed this function earlier 59 continue 48 60 49 # alias is the function we're aliasing 50 alias = apiutil.Alias(func_name) 51 if alias: 52 # this dict lookup should never fail (raise an exception)! 53 index = keys.index(alias) 54 print "\t.align 4" 55 print ".globl gl%s" % func_name 56 print "\t.type gl%s,@function" % func_name 57 print "gl%s:" % func_name 58 print "\tmovl glim+%d, %%eax" % (4*index) 59 print "\tjmp *%eax" 60 print "" 61 # alias is the function we're aliasing 62 alias = apiutil.Alias(func_name) 63 if alias: 64 # this dict lookup should never fail (raise an exception)! 65 index = keys.index(alias) 66 print "BEGINPROC_EXPORTED gl%s" % func_name 67 print "%ifdef RT_ARCH_AMD64" 68 print "\tmov \trax, qword glim+%d" % (8*index) 69 print "\tjmp \t[rax]" 70 print "%else ; X86" 71 print "\tmov \teax, dword glim+%d" % (4*index) 72 print "\tjmp \t[eax]" 73 print "%endif" 74 print "ENDPROC gl%s" % func_name 75 print "" 61 76 62 77 63 print '/*'64 print '*No-op stubs'65 print '*/'78 print ';' 79 print '; No-op stubs' 80 print ';' 66 81 67 # Now generate no-op stub functions 68 for func_name in allkeys: 69 if "stub" in apiutil.ChromiumProps(func_name): 70 print "\t.align 4" 71 print ".globl gl%s" % func_name 72 print "\t.type gl%s,@function" % func_name 73 print "gl%s:" % func_name 74 print "\tleave" 75 print "\tret" 76 print "" 82 # Now generate no-op stub functions 83 for func_name in allkeys: 84 if "stub" in apiutil.ChromiumProps(func_name): 85 print "BEGINPROC_EXPORTED gl%s" % func_name 86 print "\tleave" 87 print "\tret" 88 print "ENDPROC gl%s" % func_name 89 print "" 77 90 78 91 -
trunk/src/VBox/Additions/WINNT/Graphics/crOpenGL/Makefile.kmk
r16241 r16381 75 75 endif 76 76 77 ifeq ($(KBUILD_TARGET),linux) 78 $$(PATH_VBoxOGL)/linux_exports.asm: \ 79 $(PATH_SUB_CURRENT)/Linux_i386_exports.py \ 80 $(APIFILES) $(PATH_SUB_CURRENT)/entrypoints.py \ 81 | $$(dir $$@) 82 $(VBOX_BLD_PYTHON) $< $(GLAPI_PATH) > $@ 83 endif 84 77 85 $$(PATH_VBoxOGL)/NULLfuncs.c: $(PATH_SUB_CURRENT)/NULLfuncs.py $(APIFILES) | $$(dir $$@) 78 86 $(VBOX_BLD_PYTHON) $< $(GLAPI_PATH) > $@ … … 114 122 $(GEN_C_FILES) 115 123 VBoxOGL_SOURCES.win := wgl.c icd_drv.c ogl_hgcm.c VBoxCROGL.rc $(GEN_ASM_FILES.win) $(GEN_C_FILES.win) 124 VBoxOGL_SOURCES.linux := $(PATH_TARGET)/VBoxOGL/linux_exports.asm glx.c xfont.c 116 125 VBoxOGL_DEPS.win := $(GEN_H_FILES.win) 117 126 VBoxOGL_CLEAN := $(GEN_C_FILES) -
trunk/src/VBox/Additions/WINNT/Graphics/crOpenGL/NULLfuncs.py
r15532 r16381 36 36 37 37 38 print " SPUDispatchTablestubNULLDispatch = {"38 print "DECLEXPORT(SPUDispatchTable) stubNULLDispatch = {" 39 39 for func_name in keys: 40 40 print "\tNULL_%s," % (func_name) -
trunk/src/VBox/Additions/WINNT/Graphics/crOpenGL/context.c
r15532 r16381 557 557 Window root, child; 558 558 unsigned int border, depth; 559 560 //@todo: Performing those checks is expensive operation, especially for simple apps with high FPS. 561 // Disabling those tripples glxgears fps, thus using xevens instead of per frame polling is much more preffered. 562 //@todo: Check similiar on windows guests, though doubtfull as there're no XSync like calls on windows. 559 563 if (!window 560 || !window->dpy 561 || !window->drawable 562 || !XGetGeometry(window->dpy, window->drawable, &root, 563 x, y, w, h, &border, &depth) 564 || !XTranslateCoordinates(window->dpy, window->drawable, root, 565 *x, *y, x, y, &child)) { 564 || !window->dpy 565 || !window->drawable 566 || !XGetGeometry(window->dpy, window->drawable, &root, 567 x, y, w, h, &border, &depth) 568 || !XTranslateCoordinates(window->dpy, window->drawable, root, 569 0, 0, x, y, &child)) 570 { 571 crWarning("Failed to get windows geometry for %x, try xwininfo", (int) window); 566 572 *x = *y = 0; 567 573 *w = *h = 0; … … 981 987 could be destroyed. 982 988 */ 989 #ifdef WINDOWS 983 990 crWindowDestroy((GLint)context->pOwnWindow->hWnd); 991 #else 992 crWindowDestroy((GLint)context->pOwnWindow->drawable); 993 #endif 984 994 } 985 995 } -
trunk/src/VBox/Additions/WINNT/Graphics/crOpenGL/load.c
r15532 r16381 523 523 stubInitNativeDispatch(); 524 524 525 526 /*crDebug("stub init"); 527 raise(SIGINT);*/ 528 525 529 #ifdef WINDOWS 526 530 stubInstallWindowMessageHook(); -
trunk/src/VBox/Additions/WINNT/Graphics/crOpenGL/stub.h
r15532 r16381 179 179 180 180 extern Stub stub; 181 extern SPUDispatchTableglim;181 extern DECLEXPORT(SPUDispatchTable) glim; 182 182 extern SPUDispatchTable stubThreadsafeDispatch; 183 183 extern SPUDispatchTable stubNULLDispatch;
Note:
See TracChangeset
for help on using the changeset viewer.

