VirtualBox

Changeset 39265 in vbox for trunk/src/VBox/GuestHost/OpenGL


Ignore:
Timestamp:
Nov 10, 2011 3:40:22 PM (13 years ago)
Author:
vboxsync
Message:

crOpenGL: flush on glEnd if some begin-end data was sent to host already - fix Win8+WinSAT halt

Location:
trunk/src/VBox/GuestHost/OpenGL
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/GuestHost/OpenGL/include/cr_pack.h

    r33475 r39265  
    5151typedef void (*CRPackErrorHandlerFunc)(int line, const char *file, GLenum error, const char *info);
    5252
    53 
     53typedef enum
     54{
     55    CRPackBeginEndStateNone = 0, /* not in begin end */
     56    CRPackBeginEndStateStarted,       /* begin issued */
     57    CRPackBeginEndStateFlushDone /* begin issued & buffer flash is done thus part of commands is issued to host */
     58} CRPackBeginEndState;
    5459/**
    5560 * Packer context
     
    6368    CRPackErrorHandlerFunc Error;
    6469    CRCurrentStatePointers current;
     70    CRPackBeginEndState enmBeginEndState;
    6571    GLvectorf bounds_min, bounds_max;
    6672    int updateBBOX;
     
    203209      pc->Flush( pc->flush_arg );                                   \
    204210      CRASSERT(crPackCanHoldOpcode( pc, 1, (len) ) );               \
     211      if (pc->enmBeginEndState == CRPackBeginEndStateStarted) {     \
     212        pc->enmBeginEndState = CRPackBeginEndStateFlushDone;        \
     213      }                                                             \
    205214    }                                                               \
    206215    data_ptr = pc->buffer.data_current;                             \
     
    218227    CRASSERT( pc->currentBuffer );                                  \
    219228    if ( pc->buffer.holds_BeginEnd && !pc->buffer.in_BeginEnd ) {   \
     229      CRASSERT( 0 );  /* should never be here currently */          \
    220230      pc->Flush( pc->flush_arg );                                   \
    221231      pc->buffer.holds_BeginEnd = 0;                                \
     
    231241    CRASSERT( pc->currentBuffer );                                  \
    232242    if ( pc->buffer.holds_BeginEnd && !pc->buffer.in_BeginEnd ) {   \
     243      CRASSERT( 0 );  /* should never be here currently */          \
    233244      pc->Flush( pc->flush_arg );                                   \
    234245      pc->buffer.holds_BeginEnd = 0;                                \
     
    248259      pc->Flush( pc->flush_arg );                       \
    249260      CRASSERT( crPackCanHoldOpcode( pc, 1, (len) ) );  \
     261      if (pc->enmBeginEndState == CRPackBeginEndStateStarted) {     \
     262        pc->enmBeginEndState = CRPackBeginEndStateFlushDone;        \
     263      }                                                             \
    250264    }                                                   \
    251265    data_ptr = pc->buffer.data_current;                 \
  • trunk/src/VBox/GuestHost/OpenGL/packer/pack_beginend.c

    r33475 r39265  
    2121    }
    2222    CR_GET_BUFFERED_POINTER( pc, 4 );
     23    CRASSERT(pc->enmBeginEndState == CRPackBeginEndStateNone);
     24    pc->enmBeginEndState = CRPackBeginEndStateStarted;
    2325    pc->current.begin_data = data_ptr;
    2426    pc->current.begin_op = pc->buffer.opcode_current;
     
    4244    }
    4345    CR_GET_BUFFERED_POINTER( pc, 4 );
     46    CRASSERT(pc->enmBeginEndState == CRPackBeginEndStateNone);
     47    pc->enmBeginEndState = CRPackBeginEndStateStarted;
    4448    pc->current.begin_data = data_ptr;
    4549    pc->current.begin_op = pc->buffer.opcode_current;
     
    5862    WRITE_OPCODE( pc, CR_END_OPCODE );
    5963    pc->buffer.in_BeginEnd = 0;
     64    CRASSERT(pc->enmBeginEndState == CRPackBeginEndStateStarted
     65            || pc->enmBeginEndState == CRPackBeginEndStateFlushDone);
     66    if (pc->enmBeginEndState == CRPackBeginEndStateFlushDone)
     67    {
     68        pc->Flush( pc->flush_arg );
     69    }
     70    pc->enmBeginEndState = CRPackBeginEndStateNone;
    6071    CR_UNLOCK_PACKER_CONTEXT(pc);
    6172}
     
    6980    WRITE_OPCODE( pc, CR_END_OPCODE );
    7081    pc->buffer.in_BeginEnd = 0;
     82    CRASSERT(pc->enmBeginEndState == CRPackBeginEndStateStarted
     83            || pc->enmBeginEndState == CRPackBeginEndStateFlushDone);
     84    if (pc->enmBeginEndState == CRPackBeginEndStateFlushDone)
     85    {
     86        pc->Flush( pc->flush_arg );
     87    }
    7188    CR_UNLOCK_PACKER_CONTEXT(pc);
    7289}
  • trunk/src/VBox/GuestHost/OpenGL/packer/pack_init.c

    r33475 r39265  
    2929        crMemZero( pc, sizeof(CRPackContext));
    3030#endif
     31    pc->enmBeginEndState = CRPackBeginEndStateNone;
    3132    pc->swapping = swapping;
    3233    pc->Flush = NULL;
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