VirtualBox

Changeset 20084 in vbox


Ignore:
Timestamp:
May 27, 2009 1:26:41 PM (16 years ago)
Author:
vboxsync
Message:

crOpenGL: reduce amount of sync calls to speed up d3d

Location:
trunk/src/VBox/Additions/common/crOpenGL
Files:
1 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/crOpenGL/Makefile.kmk

    r19099 r20084  
    351351        pack/packspu_swapbuf.c \
    352352        pack/packspu_pixel.c \
     353        pack/packspu_texture.c \
    353354        $(VBOX_PATH_CROGL_GENFILES)/packspu.c \
    354355        $(VBOX_PATH_CROGL_GENFILES)/packspu_get.c \
  • trunk/src/VBox/Additions/common/crOpenGL/load.c

    r20029 r20084  
    544544    if (stub_initialized)
    545545        return true;
    546    
     546
    547547    stubInitVars();
    548548
  • trunk/src/VBox/Additions/common/crOpenGL/pack/packspu.h

    r15532 r20084  
    8383extern void packspuHuge( CROpcode opcode, void *buf );
    8484
     85extern GLboolean packspuSyncOnFlushes();
     86
    8587extern ThreadInfo *packspuNewThread( unsigned long id );
    8688
  • trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_flush_special

    r15532 r20084  
    33#
    44# See the file LICENSE.txt for information on redistributing this software.
    5 Flush
    65BarrierCreateCR
    76BarrierExecCR
  • trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_get.py

    r20083 r20084  
    8686            print '\t\tpname == GL_PACK_IMAGE_HEIGHT ||'
    8787            print '#endif'
    88             print '\t\tpname == GL_PACK_SKIP_ROWS) {'
     88            print '\t\tpname == GL_PACK_SKIP_ROWS'
     89            print '\t\t|| pname == GL_DRAW_BUFFER'
     90            print '#ifdef CR_OPENGL_VERSION_1_3'
     91            print '\t\t|| pname == GL_ACTIVE_TEXTURE'
     92            print '#endif'
     93            print '#ifdef CR_ARB_multitexture'
     94            print '\t\t|| pname == GL_ACTIVE_TEXTURE_ARB'
     95            print '#endif'
     96            print ') {'
    8997            print '\t\t\tcrState%s( pname, params );' % func_name
    9098            print '\t\t\treturn;'
  • trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_misc.c

    r20083 r20084  
    4141}
    4242
     43GLboolean packspuSyncOnFlushes()
     44{
     45    GLint buffer;
     46    crStateGetIntegerv(GL_DRAW_BUFFER, &buffer);
     47    /*Usually buffer==GL_BACK, so put this extra check to simplify boolean eval on runtime*/
     48    return  (buffer != GL_BACK)
     49            && (buffer == GL_FRONT_LEFT
     50                || buffer == GL_FRONT_RIGHT
     51                || buffer == GL_FRONT
     52                || buffer == GL_FRONT_AND_BACK
     53                || buffer == GL_LEFT
     54                || buffer == GL_RIGHT);
     55}
     56
     57void PACKSPU_APIENTRY packspu_DrawBuffer(GLenum mode)
     58{
     59    crStateDrawBuffer(mode);
     60    crPackDrawBuffer(mode);
     61}
     62
    4363void PACKSPU_APIENTRY packspu_Finish( void )
    4464{
    4565    GET_THREAD(thread);
    4666    GLint writeback = pack_spu.thread[0].netServer.conn->actual_network;
    47     if (pack_spu.swap)
    48     {
    49         crPackFinishSWAP(  );
     67
     68    if (pack_spu.swap)
     69    {
     70        crPackFinishSWAP();
     71    }
     72    else
     73    {
     74        crPackFinish();
     75    }
     76
     77    if (packspuSyncOnFlushes())
     78    {
     79        packspuFlush( (void *) thread );
     80
    5081        if (writeback)
    51             crPackWritebackSWAP( &writeback );
    52     }
    53     else
    54     {
    55         crPackFinish(  );
    56         if (writeback)
    57             crPackWriteback( &writeback );
    58     }
    59     packspuFlush( (void *) thread );
    60     while (writeback)
    61         crNetRecv();
    62 }
    63 
     82            if (pack_spu.swap)
     83                crPackWritebackSWAP(&writeback);
     84            else
     85                crPackWriteback(&writeback);
     86
     87        while (writeback)
     88            crNetRecv();
     89    }
     90}
     91
     92void PACKSPU_APIENTRY packspu_Flush( void )
     93{
     94    GET_THREAD(thread);
     95    if (pack_spu.swap)
     96    {
     97        crPackFlushSWAP();
     98    }
     99    else
     100    {
     101        crPackFlush();
     102    }
     103
     104    if (packspuSyncOnFlushes())
     105    {
     106        packspuFlush( (void *) thread );
     107    }
     108}
    64109
    65110GLint PACKSPU_APIENTRY packspu_WindowCreate( const char *dpyName, GLint visBits )
  • trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_net.c

    r15532 r20084  
    151151
    152152    if ( buf->holds_BeginEnd )
     153    {
     154        /*crDebug("crNetBarf %d, (%d)", len, buf->size);*/
    153155        crNetBarf( thread->netServer.conn, &(buf->pack), hdr, len );
     156    }
    154157    else
     158    {
     159        /*crDebug("crNetSend %d, (%d)", len, buf->size);*/
    155160        crNetSend( thread->netServer.conn, &(buf->pack), hdr, len );
     161    }
    156162
    157163    buf->pack = crNetAlloc( thread->netServer.conn );
  • trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_special

    r15532 r20084  
    6161BufferDataARB
    6262ZPixCR
     63ActiveTextureARB
     64DrawBuffer
     65Flush
  • trunk/src/VBox/Additions/common/crOpenGL/stub.c

    r16748 r20084  
    1414#include <X11/extensions/Xfixes.h>
    1515#endif
     16
     17static void crForcedFlush()
     18{
     19    GLint buffer;
     20    stub.spu->dispatch_table.GetIntegerv(GL_DRAW_BUFFER, &buffer);
     21    stub.spu->dispatch_table.DrawBuffer(GL_FRONT);
     22    stub.spu->dispatch_table.Flush();
     23    stub.spu->dispatch_table.DrawBuffer(buffer);
     24}
    1625
    1726/**
     
    100109        }
    101110#endif
    102         stub.spu->dispatch_table.Flush();
     111        crForcedFlush();
    103112
    104113        crHashtableDelete(stub.windowTable, window, crFree);
     
    303312                if (stubUpdateWindowGeometry(winInfo, GL_FALSE) || changed)
    304313                {
    305                     stub.spuDispatch.Flush();
     314                    crForcedFlush();
    306315                }
    307316                break;
     
    317326                if (stub.trackWindowVisibleRgn && stubUpdateWindowVisibileRegions(winInfo))
    318327                {
    319                     stub.spuDispatch.Flush();
     328                    crForcedFlush();
    320329                }
    321330                break;
     
    327336                {
    328337                    crDebug("Visibility info updated due to unknown hooked message (%d)", pMsgInfo->message);
    329                     stub.spuDispatch.Flush();
     338                    crForcedFlush();
    330339                }
    331340                break;
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