VirtualBox

Ignore:
Timestamp:
May 27, 2009 1:26:41 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
47826
Message:

crOpenGL: reduce amount of sync calls to speed up d3d

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

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.

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