VirtualBox

Changeset 16381 in vbox


Ignore:
Timestamp:
Jan 29, 2009 5:15:36 PM (16 years ago)
Author:
vboxsync
Message:

crOpenGL: some initial functionality on linux

Location:
trunk/src/VBox/Additions/WINNT/Graphics/crOpenGL
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/Graphics/crOpenGL/Linux_i386_exports.py

    r15532 r16381  
    1212def GenerateEntrypoints():
    1313
    14         apiutil.CopyrightC()
     14    #apiutil.CopyrightC()
    1515
    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 ""
    2027
    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")
    2529
    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 ""
    3345
    3446
    35         print '/*'
    36         print '* Aliases'
    37         print '*/'
     47    print ';'
     48    print '; Aliases'
     49    print ';'
    3850
    39         # Now loop over all the functions and take care of any aliases
    40         allkeys = apiutil.GetAllFunctions(sys.argv[1]+"/APIspec.txt")
    41         for func_name in allkeys:
    42                 if "omit" in apiutil.ChromiumProps(func_name):
    43                         continue
     51    # 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
    4456
    45                 if func_name in keys:
    46                         # we already processed this function earlier
    47                         continue
     57        if func_name in keys:
     58            # we already processed this function earlier
     59            continue
    4860
    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 ""
    6176
    6277
    63         print '/*'
    64         print '* No-op stubs'
    65         print '*/'
     78    print ';'
     79    print '; No-op stubs'
     80    print ';'
    6681
    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 ""
    7790
    7891
  • trunk/src/VBox/Additions/WINNT/Graphics/crOpenGL/Makefile.kmk

    r16241 r16381  
    7575endif
    7676
     77ifeq ($(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) > $@
     83endif
     84
    7785$$(PATH_VBoxOGL)/NULLfuncs.c: $(PATH_SUB_CURRENT)/NULLfuncs.py $(APIFILES) | $$(dir $$@)
    7886        $(VBOX_BLD_PYTHON) $< $(GLAPI_PATH) > $@
     
    114122        $(GEN_C_FILES)
    115123VBoxOGL_SOURCES.win := wgl.c icd_drv.c ogl_hgcm.c VBoxCROGL.rc $(GEN_ASM_FILES.win) $(GEN_C_FILES.win)
     124VBoxOGL_SOURCES.linux := $(PATH_TARGET)/VBoxOGL/linux_exports.asm glx.c xfont.c
    116125VBoxOGL_DEPS.win   := $(GEN_H_FILES.win)
    117126VBoxOGL_CLEAN      := $(GEN_C_FILES)
  • trunk/src/VBox/Additions/WINNT/Graphics/crOpenGL/NULLfuncs.py

    r15532 r16381  
    3636
    3737
    38 print "SPUDispatchTable stubNULLDispatch = {"
     38print "DECLEXPORT(SPUDispatchTable) stubNULLDispatch = {"
    3939for func_name in keys:
    4040        print "\tNULL_%s," % (func_name)
  • trunk/src/VBox/Additions/WINNT/Graphics/crOpenGL/context.c

    r15532 r16381  
    557557    Window root, child;
    558558    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.
    559563    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);
    566572        *x = *y = 0;
    567573        *w = *h = 0;
     
    981987               could be destroyed.
    982988             */
     989#ifdef WINDOWS
    983990            crWindowDestroy((GLint)context->pOwnWindow->hWnd);
     991#else
     992            crWindowDestroy((GLint)context->pOwnWindow->drawable);
     993#endif
    984994        }
    985995    }
  • trunk/src/VBox/Additions/WINNT/Graphics/crOpenGL/load.c

    r15532 r16381  
    523523    stubInitNativeDispatch();
    524524
     525
     526/*crDebug("stub init");
     527raise(SIGINT);*/
     528
    525529#ifdef WINDOWS
    526530    stubInstallWindowMessageHook();
  • trunk/src/VBox/Additions/WINNT/Graphics/crOpenGL/stub.h

    r15532 r16381  
    179179
    180180extern Stub stub;
    181 extern SPUDispatchTable glim;
     181extern DECLEXPORT(SPUDispatchTable) glim;
    182182extern SPUDispatchTable stubThreadsafeDispatch;
    183183extern SPUDispatchTable stubNULLDispatch;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette