VirtualBox

Changeset 33475 in vbox for trunk/src


Ignore:
Timestamp:
Oct 26, 2010 5:23:54 PM (14 years ago)
Author:
vboxsync
Message:

crOpenGL/wddm: multithreading fix

Location:
trunk/src/VBox
Files:
31 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_init.c

    r20083 r33475  
    7070packSPUCleanup(void)
    7171{
     72    int i;
     73#ifdef CHROMIUM_THREADSAFE
     74    crLockMutex(&_PackMutex);
     75#endif
     76    for (i=0; i<pack_spu.numThreads; ++i)
     77    {
     78        if (pack_spu.thread[i].packer)
     79        {
     80            crPackDeleteContext(pack_spu.thread[i].packer);
     81        }
     82    }
     83
     84    crFreeTSD(&_PackerTSD);
     85    crFreeTSD(&_PackTSD);
     86   
     87#ifdef CHROMIUM_THREADSAFE
     88    crUnlockMutex(&_PackMutex);
     89    crFreeMutex(&_PackMutex);
     90#endif
    7291    return 1;
    7392}
  • trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_net.c

    r32499 r33475  
    120120    CRPackBuffer *buf;
    121121
     122#ifdef CHROMIUM_THREADSAFE
    122123    crLockMutex(&_PackMutex);
     124#endif
    123125
    124126    /* we should _always_ pass a valid <arg> value */
    125127    CRASSERT(thread);
     128#ifdef CHROMIUM_THREADSAFE
     129    CR_LOCK_PACKER_CONTEXT(thread->packer);
     130#endif
    126131    ctx = thread->currentContext;
    127132    buf = &(thread->buffer);
     
    145150           crPackSetBuffer( thread->packer, buf );
    146151           crPackResetPointers(thread->packer);
     152#ifdef CHROMIUM_THREADSAFE
     153           CR_UNLOCK_PACKER_CONTEXT(thread->packer);
    147154           crUnlockMutex(&_PackMutex);
     155#endif
    148156           return;
    149157    }
     
    173181    crPackResetPointers(thread->packer);
    174182
     183#ifdef CHROMIUM_THREADSAFE
     184    CR_UNLOCK_PACKER_CONTEXT(thread->packer);
    175185    crUnlockMutex(&_PackMutex);
     186#endif
    176187}
    177188
  • trunk/src/VBox/GuestHost/OpenGL/include/cr_pack.h

    r20183 r33475  
    6767    int swapping;
    6868    CRPackBuffer *currentBuffer;
     69    CRmutex mutex;
    6970    char *file;  /**< for debugging only */
    7071    int line;    /**< for debugging only */
     
    7374
    7475extern DECLEXPORT(CRPackContext *) crPackNewContext(int swapping);
     76extern DECLEXPORT(void) crPackDeleteContext(CRPackContext *pc);
    7577extern DECLEXPORT(void) crPackSetContext( CRPackContext *pc );
    7678extern DECLEXPORT(CRPackContext *) crPackGetContext( void );
     
    138140#ifdef CHROMIUM_THREADSAFE
    139141extern CRtsd _PackerTSD;
    140 #define GET_PACKER_CONTEXT(C) CRPackContext *C = (CRPackContext *) crGetTSD(&_PackerTSD)
     142#define CR_GET_PACKER_CONTEXT(C) CRPackContext *C = (CRPackContext *) crGetTSD(&_PackerTSD)
     143#define CR_LOCK_PACKER_CONTEXT(PC) crLockMutex(&((PC)->mutex))
     144#define CR_UNLOCK_PACKER_CONTEXT(PC) crUnlockMutex(&((PC)->mutex))
    141145#else
    142146extern DLLDATA(CRPackContext) cr_packer_globals;
    143 #define GET_PACKER_CONTEXT(C) CRPackContext *C = &cr_packer_globals
     147#define CR_GET_PACKER_CONTEXT(C) CRPackContext *C = &cr_packer_globals
     148#define CR_LOCK_PACKER_CONTEXT(PC)
     149#define CR_UNLOCK_PACKER_CONTEXT(PC)
    144150#endif
    145151
     
    189195 * Only flush if buffer is full.
    190196 */
    191 #define GET_BUFFERED_POINTER_NO_BEGINEND_FLUSH( pc, len )   \
    192   do {                              \
    193     THREADASSERT( pc );                     \
    194     CRASSERT( pc->currentBuffer );              \
    195     if ( !crPackCanHoldOpcode( pc, 1, (len) ) ) {       \
    196       pc->Flush( pc->flush_arg );               \
    197       CRASSERT(crPackCanHoldOpcode( pc, 1, (len) ) );       \
    198     }                               \
    199     data_ptr = pc->buffer.data_current;             \
    200     pc->buffer.data_current += (len);               \
     197#define CR_GET_BUFFERED_POINTER_NO_BEGINEND_FLUSH(pc, len, lock)    \
     198  do {                                                              \
     199    THREADASSERT( pc );                                             \
     200    if (lock) CR_LOCK_PACKER_CONTEXT(pc);                           \
     201    CRASSERT( pc->currentBuffer );                                  \
     202    if ( !crPackCanHoldOpcode( pc, 1, (len) ) ) {                   \
     203      pc->Flush( pc->flush_arg );                                   \
     204      CRASSERT(crPackCanHoldOpcode( pc, 1, (len) ) );               \
     205    }                                                               \
     206    data_ptr = pc->buffer.data_current;                             \
     207    pc->buffer.data_current += (len);                               \
    201208  } while (0)
    202209
     
    206213 * no longer inside glBegin/glEnd.
    207214 */
    208 #define GET_BUFFERED_POINTER( pc, len )                 \
    209   do {                                  \
    210     CRASSERT( pc->currentBuffer );                  \
     215#define CR_GET_BUFFERED_POINTER( pc, len )                          \
     216  do {                                                              \
     217    CR_LOCK_PACKER_CONTEXT(pc);                                     \
     218    CRASSERT( pc->currentBuffer );                                  \
    211219    if ( pc->buffer.holds_BeginEnd && !pc->buffer.in_BeginEnd ) {   \
    212       pc->Flush( pc->flush_arg );                   \
    213       pc->buffer.holds_BeginEnd = 0;                    \
    214     }                                   \
    215     GET_BUFFERED_POINTER_NO_BEGINEND_FLUSH( pc, len );          \
     220      pc->Flush( pc->flush_arg );                                   \
     221      pc->buffer.holds_BeginEnd = 0;                                \
     222    }                                                               \
     223    CR_GET_BUFFERED_POINTER_NO_BEGINEND_FLUSH( pc, len, GL_FALSE ); \
     224  } while (0)
     225
     226/**
     227 * As above, but without lock.
     228 */
     229#define CR_GET_BUFFERED_POINTER_NOLOCK( pc, len )                   \
     230  do {                                                              \
     231    CRASSERT( pc->currentBuffer );                                  \
     232    if ( pc->buffer.holds_BeginEnd && !pc->buffer.in_BeginEnd ) {   \
     233      pc->Flush( pc->flush_arg );                                   \
     234      pc->buffer.holds_BeginEnd = 0;                                \
     235    }                                                               \
     236    CR_GET_BUFFERED_POINTER_NO_BEGINEND_FLUSH( pc, len, GL_FALSE ); \
    216237  } while (0)
    217238
     
    220241 * As above, but for vertex data between glBegin/End (counts vertices).
    221242 */
    222 #define GET_BUFFERED_COUNT_POINTER( pc, len )       \
    223   do {                          \
    224     CRASSERT( pc->currentBuffer );          \
    225     if ( !crPackCanHoldOpcode( pc, 1, (len) ) ) {   \
    226       pc->Flush( pc->flush_arg );           \
     243#define CR_GET_BUFFERED_COUNT_POINTER( pc, len )        \
     244  do {                                                  \
     245    CR_LOCK_PACKER_CONTEXT(pc);                         \
     246    CRASSERT( pc->currentBuffer );                      \
     247    if ( !crPackCanHoldOpcode( pc, 1, (len) ) ) {       \
     248      pc->Flush( pc->flush_arg );                       \
    227249      CRASSERT( crPackCanHoldOpcode( pc, 1, (len) ) );  \
    228     }                           \
    229     data_ptr = pc->buffer.data_current;         \
    230     pc->current.vtx_count++;                \
    231     pc->buffer.data_current += (len);           \
     250    }                                                   \
     251    data_ptr = pc->buffer.data_current;                 \
     252    pc->current.vtx_count++;                            \
     253    pc->buffer.data_current += (len);                   \
    232254  } while (0)
    233255
     
    237259 * as glFinish().
    238260 */
    239 #define GET_BUFFERED_POINTER_NO_ARGS( pc ) \
    240   GET_BUFFERED_POINTER( pc, 4 );  \
     261#define CR_GET_BUFFERED_POINTER_NO_ARGS( pc ) \
     262  CR_GET_BUFFERED_POINTER( pc, 4 );            \
    241263  WRITE_DATA( 0, GLuint, 0xdeadbeef )
    242264
  • trunk/src/VBox/GuestHost/OpenGL/packer/pack_arrays.c

    r22514 r33475  
    3030     * Look at glgets regarding max vertices in arrays.
    3131         */
    32         GET_PACKER_CONTEXT(pc);
    33         unsigned char *data_ptr;
    34         int packet_length = 24;
    35         GET_BUFFERED_POINTER( pc, packet_length );
     32        CR_GET_PACKER_CONTEXT(pc);
     33        unsigned char *data_ptr;
     34        int packet_length = 24;
     35        CR_GET_BUFFERED_POINTER( pc, packet_length );
    3636        WRITE_DATA( 0, GLint, packet_length );
    3737        WRITE_DATA( 4, GLenum, CR_VERTEXPOINTER_EXTEND_OPCODE );
     
    4141        WRITE_DATA( 20, GLuint, (GLuint) ((uintptr_t) pointer) );
    4242        WRITE_OPCODE( pc, CR_EXTEND_OPCODE );
     43    CR_UNLOCK_PACKER_CONTEXT(pc);
    4344}
    4445
    4546void PACK_APIENTRY crPackColorPointer( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer )
    4647{
    47         GET_PACKER_CONTEXT(pc);
    48         unsigned char *data_ptr;
    49         int packet_length = 24;
    50         GET_BUFFERED_POINTER( pc, packet_length );
     48        CR_GET_PACKER_CONTEXT(pc);
     49        unsigned char *data_ptr;
     50        int packet_length = 24;
     51        CR_GET_BUFFERED_POINTER( pc, packet_length );
    5152        WRITE_DATA( 0, GLint, packet_length );
    5253        WRITE_DATA( 4, GLenum, CR_COLORPOINTER_EXTEND_OPCODE );
     
    5657        WRITE_DATA( 20, GLuint, (GLuint) ((uintptr_t) pointer) );
    5758        WRITE_OPCODE( pc, CR_EXTEND_OPCODE );
     59    CR_UNLOCK_PACKER_CONTEXT(pc);
    5860}
    5961
    6062void PACK_APIENTRY crPackNormalPointer( GLenum type, GLsizei stride, const GLvoid *pointer )
    6163{
    62         GET_PACKER_CONTEXT(pc);
    63         unsigned char *data_ptr;
    64         int packet_length = 20;
    65         GET_BUFFERED_POINTER( pc, packet_length );
     64        CR_GET_PACKER_CONTEXT(pc);
     65        unsigned char *data_ptr;
     66        int packet_length = 20;
     67        CR_GET_BUFFERED_POINTER( pc, packet_length );
    6668        WRITE_DATA( 0, GLint, packet_length );
    6769        WRITE_DATA( 4, GLenum, CR_NORMALPOINTER_EXTEND_OPCODE );
     
    7072        WRITE_DATA( 16, GLuint, (GLuint) ((uintptr_t) pointer) );
    7173        WRITE_OPCODE( pc, CR_EXTEND_OPCODE );
     74    CR_UNLOCK_PACKER_CONTEXT(pc);
    7275}
    7376
    7477void PACK_APIENTRY crPackTexCoordPointer( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer )
    7578{
    76         GET_PACKER_CONTEXT(pc);
    77         unsigned char *data_ptr;
    78         int packet_length = 24;
    79         GET_BUFFERED_POINTER( pc, packet_length );
     79        CR_GET_PACKER_CONTEXT(pc);
     80        unsigned char *data_ptr;
     81        int packet_length = 24;
     82        CR_GET_BUFFERED_POINTER( pc, packet_length );
    8083        WRITE_DATA( 0, GLint, packet_length );
    8184        WRITE_DATA( 4, GLenum, CR_TEXCOORDPOINTER_EXTEND_OPCODE );
     
    8588        WRITE_DATA( 20, GLuint, (GLuint) ((uintptr_t) pointer) );
    8689        WRITE_OPCODE( pc, CR_EXTEND_OPCODE );
     90    CR_UNLOCK_PACKER_CONTEXT(pc);
    8791}
    8892
    8993void PACK_APIENTRY crPackEdgeFlagPointer( GLsizei stride, const GLvoid *pointer )
    9094{
    91         GET_PACKER_CONTEXT(pc);
     95        CR_GET_PACKER_CONTEXT(pc);
    9296        unsigned char *data_ptr;
    9397        int packet_length = 16;
    94         GET_BUFFERED_POINTER( pc, packet_length );
     98        CR_GET_BUFFERED_POINTER( pc, packet_length );
    9599        WRITE_DATA( 0, GLint, packet_length );
    96100        WRITE_DATA( 4, GLenum, CR_EDGEFLAGPOINTER_EXTEND_OPCODE );
     
    98102        WRITE_DATA( 12, GLuint, (GLuint) ((uintptr_t) pointer) );
    99103        WRITE_OPCODE( pc, CR_EXTEND_OPCODE );
     104    CR_UNLOCK_PACKER_CONTEXT(pc);
    100105}
    101106
    102107void PACK_APIENTRY crPackIndexPointer( GLenum type, GLsizei stride, const GLvoid *pointer )
    103108{
    104         GET_PACKER_CONTEXT(pc);
    105         unsigned char *data_ptr;
    106         int packet_length = 20;
    107         GET_BUFFERED_POINTER( pc, packet_length );
     109        CR_GET_PACKER_CONTEXT(pc);
     110        unsigned char *data_ptr;
     111        int packet_length = 20;
     112        CR_GET_BUFFERED_POINTER( pc, packet_length );
    108113        WRITE_DATA( 0, GLint, packet_length );
    109114        WRITE_DATA( 4, GLenum, CR_INDEXPOINTER_EXTEND_OPCODE );
     
    112117        WRITE_DATA( 16, GLuint, (GLuint) ((uintptr_t) pointer) );
    113118        WRITE_OPCODE( pc, CR_EXTEND_OPCODE );
     119    CR_UNLOCK_PACKER_CONTEXT(pc);
    114120}
    115121
    116122void PACK_APIENTRY crPackSecondaryColorPointerEXT( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer )
    117123{
    118         GET_PACKER_CONTEXT(pc);
    119         unsigned char *data_ptr;
    120         int packet_length = 24;
    121         GET_BUFFERED_POINTER( pc, packet_length );
     124        CR_GET_PACKER_CONTEXT(pc);
     125        unsigned char *data_ptr;
     126        int packet_length = 24;
     127        CR_GET_BUFFERED_POINTER( pc, packet_length );
    122128        WRITE_DATA( 0, GLint, packet_length );
    123129        WRITE_DATA( 4, GLenum, CR_SECONDARYCOLORPOINTEREXT_EXTEND_OPCODE );
     
    127133        WRITE_DATA( 20, GLuint, (GLuint) ((uintptr_t) pointer) );
    128134        WRITE_OPCODE( pc, CR_EXTEND_OPCODE );
     135    CR_UNLOCK_PACKER_CONTEXT(pc);
    129136}
    130137
    131138void PACK_APIENTRY crPackFogCoordPointerEXT( GLenum type, GLsizei stride, const GLvoid * pointer )
    132139{
    133         GET_PACKER_CONTEXT(pc);
    134         unsigned char *data_ptr;
    135         int packet_length = 20;
    136         GET_BUFFERED_POINTER( pc, packet_length );
     140        CR_GET_PACKER_CONTEXT(pc);
     141        unsigned char *data_ptr;
     142        int packet_length = 20;
     143        CR_GET_BUFFERED_POINTER( pc, packet_length );
    137144        WRITE_DATA( 0, GLint, packet_length );
    138145        WRITE_DATA( 4, GLenum, CR_FOGCOORDPOINTEREXT_EXTEND_OPCODE );
     
    141148        WRITE_DATA( 16, GLuint, (GLuint) ((uintptr_t) pointer) );
    142149        WRITE_OPCODE( pc, CR_EXTEND_OPCODE );
     150    CR_UNLOCK_PACKER_CONTEXT(pc);
    143151}
    144152
    145153void PACK_APIENTRY crPackVertexAttribPointerARB( GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer )
    146154{
    147         GET_PACKER_CONTEXT(pc);
     155        CR_GET_PACKER_CONTEXT(pc);
    148156        unsigned char *data_ptr;
    149157        int packet_length = 32;
    150         GET_BUFFERED_POINTER( pc, packet_length );
     158        CR_GET_BUFFERED_POINTER( pc, packet_length );
    151159        WRITE_DATA( 0, GLint, packet_length );
    152160        WRITE_DATA( 4, GLenum, CR_VERTEXATTRIBPOINTERARB_EXTEND_OPCODE );
     
    158166        WRITE_DATA( 28, GLuint, (GLuint) ((uintptr_t) pointer) );
    159167        WRITE_OPCODE( pc, CR_EXTEND_OPCODE );
     168    CR_UNLOCK_PACKER_CONTEXT(pc);
    160169}
    161170
    162171void PACK_APIENTRY crPackVertexAttribPointerNV( GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer )
    163172{
    164         GET_PACKER_CONTEXT(pc);
     173        CR_GET_PACKER_CONTEXT(pc);
    165174        unsigned char *data_ptr;
    166175        int packet_length = 28;
    167         GET_BUFFERED_POINTER( pc, packet_length );
     176        CR_GET_BUFFERED_POINTER( pc, packet_length );
    168177        WRITE_DATA( 0, GLint, packet_length );
    169178        WRITE_DATA( 4, GLenum, CR_VERTEXATTRIBPOINTERNV_EXTEND_OPCODE );
     
    174183        WRITE_DATA( 24, GLuint, (GLuint) ((uintptr_t) pointer) );
    175184        WRITE_OPCODE( pc, CR_EXTEND_OPCODE );
     185    CR_UNLOCK_PACKER_CONTEXT(pc);
    176186}
    177187
    178188void PACK_APIENTRY crPackInterleavedArrays( GLenum format, GLsizei stride, const GLvoid *pointer )
    179189{
    180         GET_PACKER_CONTEXT(pc);
    181         unsigned char *data_ptr;
    182         int packet_length = 20;
    183         GET_BUFFERED_POINTER( pc, packet_length );
     190        CR_GET_PACKER_CONTEXT(pc);
     191        unsigned char *data_ptr;
     192        int packet_length = 20;
     193        CR_GET_BUFFERED_POINTER( pc, packet_length );
    184194        WRITE_DATA( 0, GLint, packet_length );
    185195        WRITE_DATA( 4, GLenum, CR_INTERLEAVEDARRAYS_EXTEND_OPCODE );
     
    188198        WRITE_DATA( 16, GLuint, (GLuint) ((uintptr_t) pointer) );
    189199        WRITE_OPCODE( pc, CR_EXTEND_OPCODE );
     200    CR_UNLOCK_PACKER_CONTEXT(pc);
    190201}
    191202
  • trunk/src/VBox/GuestHost/OpenGL/packer/pack_beginend.c

    r33457 r33475  
    1010void PACK_APIENTRY crPackBegin( GLenum mode )
    1111{
    12     GET_PACKER_CONTEXT(pc);
     12    CR_GET_PACKER_CONTEXT(pc);
    1313    unsigned char *data_ptr;
    1414    (void) pc;
     
    2020        pc->buffer.holds_BeginEnd = 1;
    2121    }
    22     GET_BUFFERED_POINTER( pc, 4 );
     22    CR_GET_BUFFERED_POINTER( pc, 4 );
    2323    pc->current.begin_data = data_ptr;
    2424    pc->current.begin_op = pc->buffer.opcode_current;
     
    2626    WRITE_DATA( 0, GLenum, mode );
    2727    WRITE_OPCODE( pc, CR_BEGIN_OPCODE );
     28    CR_UNLOCK_PACKER_CONTEXT(pc);
    2829}
    2930
    3031void PACK_APIENTRY crPackBeginSWAP( GLenum mode )
    3132{
    32     GET_PACKER_CONTEXT(pc);
     33    CR_GET_PACKER_CONTEXT(pc);
    3334    unsigned char *data_ptr;
    3435    (void) pc;
     
    4041        pc->buffer.holds_BeginEnd = 1;
    4142    }
    42     GET_BUFFERED_POINTER( pc, 4 );
     43    CR_GET_BUFFERED_POINTER( pc, 4 );
    4344    pc->current.begin_data = data_ptr;
    4445    pc->current.begin_op = pc->buffer.opcode_current;
     
    4647    WRITE_DATA( 0, GLenum, SWAP32(mode) );
    4748    WRITE_OPCODE( pc, CR_BEGIN_OPCODE );
     49    CR_UNLOCK_PACKER_CONTEXT(pc);
    4850}
    4951
    5052void PACK_APIENTRY crPackEnd( void )
    5153{
    52     GET_PACKER_CONTEXT(pc);
     54    CR_GET_PACKER_CONTEXT(pc);
    5355    unsigned char *data_ptr;
    5456    (void) pc;
    55     GET_BUFFERED_POINTER_NO_ARGS( pc );
     57    CR_GET_BUFFERED_POINTER_NO_ARGS( pc );
    5658    WRITE_OPCODE( pc, CR_END_OPCODE );
    5759    pc->buffer.in_BeginEnd = 0;
     60    CR_UNLOCK_PACKER_CONTEXT(pc);
    5861}
    5962
    6063void PACK_APIENTRY crPackEndSWAP( void )
    6164{
    62     GET_PACKER_CONTEXT(pc);
     65    CR_GET_PACKER_CONTEXT(pc);
    6366    unsigned char *data_ptr;
    6467    (void) pc;
    65     GET_BUFFERED_POINTER_NO_ARGS( pc );
     68    CR_GET_BUFFERED_POINTER_NO_ARGS( pc );
    6669    WRITE_OPCODE( pc, CR_END_OPCODE );
    6770    pc->buffer.in_BeginEnd = 0;
     71    CR_UNLOCK_PACKER_CONTEXT(pc);
    6872}
    6973
  • trunk/src/VBox/GuestHost/OpenGL/packer/pack_bounds.c

    r33457 r33475  
    1111void PACK_APIENTRY crPackBoundsInfoCR( const CRrecti *bounds, const GLbyte *payload, GLint len, GLint num_opcodes )
    1212{
    13     GET_PACKER_CONTEXT(pc);
     13    CR_GET_PACKER_CONTEXT(pc);
    1414    /* Don't get the buffered_ptr here because we've already
    1515     * verified that there's enough space for everything. */
    1616
    17     unsigned char *data_ptr = pc->buffer.data_current;
    18     int len_aligned     = ( len + 0x3 ) & ~0x3;
    19     int total_len = 24 + len_aligned;
     17    unsigned char *data_ptr;
     18    int len_aligned, total_len;
     19
     20    CR_LOCK_PACKER_CONTEXT(pc);
     21
     22    data_ptr = pc->buffer.data_current;
     23    len_aligned     = ( len + 0x3 ) & ~0x3;
     24    total_len = 24 + len_aligned;
    2025
    2126    WRITE_DATA( 0, int, total_len );
     
    4247    WRITE_OPCODE( pc, CR_BOUNDSINFOCR_OPCODE );
    4348    pc->buffer.data_current += 24 + len_aligned;
     49    CR_UNLOCK_PACKER_CONTEXT(pc);
    4450}
  • trunk/src/VBox/GuestHost/OpenGL/packer/pack_buffer.c

    r15532 r33475  
    259259        const int num_data = crPackNumData(src);
    260260        const int num_opcode = crPackNumOpcodes(src);
    261         GET_PACKER_CONTEXT(pc);
    262         return crPackCanHoldOpcode( pc, num_opcode, num_data );
     261    int res;
     262        CR_GET_PACKER_CONTEXT(pc);
     263    CR_LOCK_PACKER_CONTEXT(pc);
     264        res = crPackCanHoldOpcode( pc, num_opcode, num_data );
     265    CR_UNLOCK_PACKER_CONTEXT(pc);
     266    return res;
    263267}
    264268
     
    267271{
    268272        const int len_aligned = (src->data_current - src->opcode_current - 1 + 3) & ~3;
    269         GET_PACKER_CONTEXT(pc);
     273        CR_GET_PACKER_CONTEXT(pc);
    270274        /* 24 is the size of the bounds-info packet... */
    271275        return crPackCanHoldOpcode( pc, 1, len_aligned + 24 );
     
    274278void crPackAppendBuffer( const CRPackBuffer *src )
    275279{
    276         GET_PACKER_CONTEXT(pc);
     280        CR_GET_PACKER_CONTEXT(pc);
    277281        const int num_data = crPackNumData(src);
    278282        const int num_opcode = crPackNumOpcodes(src);
     
    280284        CRASSERT(num_data >= 0);
    281285        CRASSERT(num_opcode >= 0);
     286
     287    CR_LOCK_PACKER_CONTEXT(pc);
    282288
    283289        /* don't append onto ourself! */
     
    290296                {
    291297                        crWarning( "crPackAppendBuffer: overflowed the destination!" );
     298            CR_UNLOCK_PACKER_CONTEXT(pc);
    292299                        return;
    293300                }
    294301                else
     302        {
    295303                        crError( "crPackAppendBuffer: overflowed the destination!" );
     304            CR_UNLOCK_PACKER_CONTEXT(pc);
     305        }
    296306        }
    297307
     
    308318        pc->buffer.in_BeginEnd = src->in_BeginEnd;
    309319        pc->buffer.holds_List |= src->holds_List;
     320    CR_UNLOCK_PACKER_CONTEXT(pc);
    310321}
    311322
     
    314325crPackAppendBoundedBuffer( const CRPackBuffer *src, const CRrecti *bounds )
    315326{
    316         GET_PACKER_CONTEXT(pc);
     327        CR_GET_PACKER_CONTEXT(pc);
    317328        const GLbyte *payload = (const GLbyte *) src->opcode_current + 1;
    318329        const int num_opcodes = crPackNumOpcodes(src);
     
    320331
    321332        CRASSERT(pc);
     333    CR_LOCK_PACKER_CONTEXT(pc);
    322334        CRASSERT(pc->currentBuffer);
    323335        CRASSERT(pc->currentBuffer != src);
     
    332344                {
    333345                        crWarning( "crPackAppendBoundedBuffer: overflowed the destination!" );
     346            CR_UNLOCK_PACKER_CONTEXT(pc);
    334347                        return;
    335348                }
    336349                else
     350        {
    337351                        crError( "crPackAppendBoundedBuffer: overflowed the destination!" );
     352            CR_UNLOCK_PACKER_CONTEXT(pc);
     353        }
    338354        }
    339355
     
    346362        pc->buffer.in_BeginEnd = src->in_BeginEnd;
    347363        pc->buffer.holds_List |= src->holds_List;
     364    CR_UNLOCK_PACKER_CONTEXT(pc);
    348365}
    349366
     
    361378void *crPackAlloc( unsigned int size )
    362379{
    363         GET_PACKER_CONTEXT(pc);
     380        CR_GET_PACKER_CONTEXT(pc);
    364381        unsigned char *data_ptr;
    365382
    366383        /* include space for the length and make the payload word-aligned */
    367384        size = ( size + sizeof(unsigned int) + 0x3 ) & ~0x3;
     385
     386    CR_LOCK_PACKER_CONTEXT(pc);
    368387
    369388        if ( crPackCanHoldOpcode( pc, 1, size ) )
    370389        {
    371390                /* we can just put it in the current buffer */
    372                 GET_BUFFERED_POINTER(pc, size );  /* NOTE: this sets data_ptr */
     391                CR_GET_BUFFERED_POINTER_NOLOCK(pc, size );  /* NOTE: this sets data_ptr */
    373392        }
    374393        else
     
    378397                if ( crPackCanHoldOpcode( pc, 1, size ) )
    379398                {
    380                         GET_BUFFERED_POINTER(pc, size );  /* NOTE: this sets data_ptr */
     399                        CR_GET_BUFFERED_POINTER_NOLOCK(pc, size );  /* NOTE: this sets data_ptr */
    381400                }
    382401                else
     
    445464void crHugePacket( CROpcode opcode, void *packet )
    446465{
    447         GET_PACKER_CONTEXT(pc);
     466        CR_GET_PACKER_CONTEXT(pc);
    448467#ifndef CHROMIUM_THREADSAFE
    449468        CRASSERT(sanityCheckPointer == packet);
     
    459478void crPackFree( void *packet )
    460479{
    461         GET_PACKER_CONTEXT(pc);
     480        CR_GET_PACKER_CONTEXT(pc);
     481   
    462482        if ( IS_BUFFERED( packet ) )
     483    {
     484        CR_UNLOCK_PACKER_CONTEXT(pc);
    463485                return;
     486    }
     487
     488    CR_UNLOCK_PACKER_CONTEXT(pc);
    464489       
    465490        /* the pointer passed in doesn't include the space for the single
  • trunk/src/VBox/GuestHost/OpenGL/packer/pack_bufferobject.c

    r21423 r33475  
    8888crPackGetBufferSubDataARB( GLenum target, GLintptrARB offset, GLsizeiptrARB size, void * data, int * writeback )
    8989{
    90         GET_PACKER_CONTEXT(pc);
     90        CR_GET_PACKER_CONTEXT(pc);
    9191        unsigned char *data_ptr;
    9292        (void) pc;
    93         GET_BUFFERED_POINTER( pc, 36 );
     93        CR_GET_BUFFERED_POINTER( pc, 36 );
    9494        WRITE_DATA( 0, GLint, 36 );
    9595        WRITE_DATA( 4, GLenum, CR_GETBUFFERSUBDATAARB_EXTEND_OPCODE );
     
    100100        WRITE_NETWORK_POINTER( 28, (void *) writeback );
    101101        WRITE_OPCODE( pc, CR_EXTEND_OPCODE );
     102    CR_UNLOCK_PACKER_CONTEXT(pc);
    102103}
    103104
  • trunk/src/VBox/GuestHost/OpenGL/packer/pack_clipplane.c

    r33457 r33475  
    1010void PACK_APIENTRY crPackClipPlane( GLenum plane, const GLdouble *equation )
    1111{
    12     GET_PACKER_CONTEXT(pc);
     12    CR_GET_PACKER_CONTEXT(pc);
    1313    unsigned char *data_ptr;
    1414    int packet_length = sizeof( plane ) + 4*sizeof(*equation);
    15     GET_BUFFERED_POINTER(pc, packet_length );
     15    CR_GET_BUFFERED_POINTER(pc, packet_length );
    1616    WRITE_DATA( 0, GLenum, plane );
    1717    WRITE_DOUBLE( 4, equation[0] );
     
    2020    WRITE_DOUBLE( 28, equation[3] );
    2121    WRITE_OPCODE( pc, CR_CLIPPLANE_OPCODE );
     22    CR_UNLOCK_PACKER_CONTEXT(pc);
    2223}
  • trunk/src/VBox/GuestHost/OpenGL/packer/pack_context.c

    r15532 r33475  
    2222{
    2323        char displayName[DISPLAY_NAME_LEN];
    24         GET_PACKER_CONTEXT(pc);
     24        CR_GET_PACKER_CONTEXT(pc);
    2525        unsigned char *data_ptr;
    2626        int len = DISPLAY_NAME_LEN + 32;
     
    3737        }
    3838
    39         GET_BUFFERED_POINTER(pc, len);
     39        CR_GET_BUFFERED_POINTER(pc, len);
    4040        WRITE_DATA( 0, GLint, len );
    4141        WRITE_DATA( 4, GLenum, CR_CREATECONTEXT_EXTEND_OPCODE );
     
    4646        WRITE_NETWORK_POINTER( DISPLAY_NAME_LEN + 24, (void *) writeback );
    4747        WRITE_OPCODE( pc, CR_EXTEND_OPCODE );
     48    CR_UNLOCK_PACKER_CONTEXT(pc);
    4849}
    4950
     
    5354{
    5455        char displayName[DISPLAY_NAME_LEN];
    55         GET_PACKER_CONTEXT(pc);
     56        CR_GET_PACKER_CONTEXT(pc);
    5657        unsigned char *data_ptr;
    5758        int len = DISPLAY_NAME_LEN + 32;
     
    6869        }
    6970
    70         GET_BUFFERED_POINTER(pc, len);
     71        CR_GET_BUFFERED_POINTER(pc, len);
    7172        WRITE_DATA( 0, GLint, SWAP32(len) );
    7273        WRITE_DATA( 4, GLenum, SWAP32(CR_CREATECONTEXT_EXTEND_OPCODE) );
     
    7778        WRITE_NETWORK_POINTER( DISPLAY_NAME_LEN + 24, (void *) writeback );
    7879        WRITE_OPCODE( pc, CR_EXTEND_OPCODE );
     80    CR_UNLOCK_PACKER_CONTEXT(pc);
    7981}
    8082
     
    8385{
    8486        char displayName[DISPLAY_NAME_LEN];
    85         GET_PACKER_CONTEXT(pc);
     87        CR_GET_PACKER_CONTEXT(pc);
    8688        unsigned char *data_ptr;
    8789
     
    9799        }
    98100
    99         GET_BUFFERED_POINTER(pc, DISPLAY_NAME_LEN + 28 );
     101        CR_GET_BUFFERED_POINTER(pc, DISPLAY_NAME_LEN + 28 );
    100102        WRITE_DATA( 0, GLint, 28 );
    101103        WRITE_DATA( 4, GLenum, CR_WINDOWCREATE_EXTEND_OPCODE );
     
    105107        WRITE_NETWORK_POINTER( DISPLAY_NAME_LEN + 20, (void *) writeback );
    106108        WRITE_OPCODE( pc, CR_EXTEND_OPCODE );
     109    CR_UNLOCK_PACKER_CONTEXT(pc);
    107110}
    108111
     
    110113{
    111114        char displayName[DISPLAY_NAME_LEN];
    112         GET_PACKER_CONTEXT(pc);
     115        CR_GET_PACKER_CONTEXT(pc);
    113116        unsigned char *data_ptr;
    114117
     
    124127        }
    125128
    126         GET_BUFFERED_POINTER(pc, DISPLAY_NAME_LEN + 28 );
     129        CR_GET_BUFFERED_POINTER(pc, DISPLAY_NAME_LEN + 28 );
    127130        WRITE_DATA( 0, GLint, SWAP32(28) );
    128131        WRITE_DATA( 4, GLenum, SWAP32(CR_WINDOWCREATE_EXTEND_OPCODE) );
     
    132135        WRITE_NETWORK_POINTER( DISPLAY_NAME_LEN + 20, (void *) writeback );
    133136        WRITE_OPCODE( pc, CR_EXTEND_OPCODE );
     137    CR_UNLOCK_PACKER_CONTEXT(pc);
    134138}
  • trunk/src/VBox/GuestHost/OpenGL/packer/pack_current.py

    r15532 r33475  
    2525void crPackOffsetCurrentPointers( int offset )
    2626{
    27         GET_PACKER_CONTEXT(pc);
     27        CR_GET_PACKER_CONTEXT(pc);
    2828        GLnormal_p              *normal         = &(pc->current.c.normal);
    2929        GLcolor_p               *color          = &(pc->current.c.color);
     
    6060void crPackNullCurrentPointers( void )
    6161{
    62         GET_PACKER_CONTEXT(pc);
     62        CR_GET_PACKER_CONTEXT(pc);
    6363        CRCurrentStateAttr      *c              = &(pc->current.c);
    6464"""
  • trunk/src/VBox/GuestHost/OpenGL/packer/pack_error.c

    r33457 r33475  
    2727void __PackError( int line, const char *file, GLenum error, const char *info)
    2828{
    29     GET_PACKER_CONTEXT(pc);
     29    CR_GET_PACKER_CONTEXT(pc);
    3030
    3131    if (pc->Error)
  • trunk/src/VBox/GuestHost/OpenGL/packer/pack_fog.c

    r33457 r33475  
    1010static GLboolean __handleFogData( GLenum pname, const GLfloat *params )
    1111{
    12     GET_PACKER_CONTEXT(pc);
     12    CR_GET_PACKER_CONTEXT(pc);
    1313    int params_length = 0;
    1414    int packet_length = sizeof( int ) + sizeof( pname );
     
    3939    packet_length += params_length;
    4040
    41     GET_BUFFERED_POINTER(pc, packet_length );
     41    CR_GET_BUFFERED_POINTER(pc, packet_length );
    4242    WRITE_DATA( 0, int, packet_length );
    4343    WRITE_DATA( 4, GLenum, pname );
     
    5454void PACK_APIENTRY crPackFogfv(GLenum pname, const GLfloat *params)
    5555{
    56     GET_PACKER_CONTEXT(pc);
     56    CR_GET_PACKER_CONTEXT(pc);
    5757    if (__handleFogData( pname, params ))
    5858        WRITE_OPCODE( pc, CR_FOGFV_OPCODE );
     59    CR_UNLOCK_PACKER_CONTEXT(pc);
    5960}
    6061
    6162void PACK_APIENTRY crPackFogiv(GLenum pname, const GLint *params)
    6263{
    63     GET_PACKER_CONTEXT(pc);
     64    CR_GET_PACKER_CONTEXT(pc);
    6465    /* floats and ints are the same size, so the packing should be the same */
    6566    if (__handleFogData( pname, (const GLfloat *) params ))
    6667        WRITE_OPCODE( pc, CR_FOGIV_OPCODE );
     68    CR_UNLOCK_PACKER_CONTEXT(pc);
    6769}
  • trunk/src/VBox/GuestHost/OpenGL/packer/pack_init.c

    r15532 r33475  
    2424    if (!pc)
    2525        return NULL;
     26    crInitMutex(&pc->mutex);
    2627#else
    2728    GET_PACKER_CONTEXT(pc);
     
    3536}
    3637
     38void crPackDeleteContext(CRPackContext *pc)
     39{
     40#ifdef CHROMIUM_THREADSAFE
     41    crFreeMutex(&pc->mutex);
     42    crFree(pc);
     43#endif
     44}
    3745
    3846/* Set packing context for the calling thread */
  • trunk/src/VBox/GuestHost/OpenGL/packer/pack_lights.c

    r33457 r33475  
    1010static GLboolean __handleLightData( GLenum light, GLenum pname, const GLfloat *params )
    1111{
    12     GET_PACKER_CONTEXT(pc);
     12    CR_GET_PACKER_CONTEXT(pc);
    1313    unsigned int packet_length = sizeof( int ) + sizeof( light ) + sizeof( pname );
    1414    unsigned int params_length = 0;
     
    3838    }
    3939    packet_length += params_length;
    40     GET_BUFFERED_POINTER(pc, packet_length );
     40    CR_GET_BUFFERED_POINTER(pc, packet_length );
    4141    WRITE_DATA( 0, int, packet_length );
    4242    WRITE_DATA( sizeof( int ) + 0, GLenum, light );
     
    5757void PACK_APIENTRY crPackLightfv (GLenum light, GLenum pname, const GLfloat *params)
    5858{
    59     GET_PACKER_CONTEXT(pc);
     59    CR_GET_PACKER_CONTEXT(pc);
    6060    if (__handleLightData( light, pname, params ))
    6161        WRITE_OPCODE( pc, CR_LIGHTFV_OPCODE );
     62    CR_UNLOCK_PACKER_CONTEXT(pc);
    6263}
    6364
     
    6566{
    6667    /* floats and ints are the same size, so the packing should be the same */
    67     GET_PACKER_CONTEXT(pc);
     68    CR_GET_PACKER_CONTEXT(pc);
    6869    if (__handleLightData( light, pname, (const GLfloat *) params ))
    6970        WRITE_OPCODE( pc, CR_LIGHTIV_OPCODE );
     71    CR_UNLOCK_PACKER_CONTEXT(pc);
    7072}
    7173
    7274static GLboolean __handleLightModelData( GLenum pname, const GLfloat *params )
    7375{
    74     GET_PACKER_CONTEXT(pc);
     76    CR_GET_PACKER_CONTEXT(pc);
    7577    unsigned int packet_length = sizeof( int ) + sizeof( pname );
    7678    unsigned int params_length = 0;
     
    9193    }
    9294    packet_length += params_length;
    93     GET_BUFFERED_POINTER(pc, packet_length );
     95    CR_GET_BUFFERED_POINTER(pc, packet_length );
    9496    WRITE_DATA( 0, int, packet_length );
    9597    WRITE_DATA( sizeof( int ) + 0, GLenum, pname );
     
    106108void PACK_APIENTRY crPackLightModelfv (GLenum pname, const GLfloat *params)
    107109{
    108     GET_PACKER_CONTEXT(pc);
     110    CR_GET_PACKER_CONTEXT(pc);
    109111    if (__handleLightModelData( pname, params ))
    110112        WRITE_OPCODE( pc, CR_LIGHTMODELFV_OPCODE );
     113    CR_UNLOCK_PACKER_CONTEXT(pc);
    111114}
    112115
     
    114117{
    115118    /* floats and ints are the same size, so the packing should be the same */
    116     GET_PACKER_CONTEXT(pc);
     119    CR_GET_PACKER_CONTEXT(pc);
    117120    if (__handleLightModelData( pname, (const GLfloat *) params ))
    118121        WRITE_OPCODE( pc, CR_LIGHTMODELIV_OPCODE );
     122    CR_UNLOCK_PACKER_CONTEXT(pc);
    119123}
  • trunk/src/VBox/GuestHost/OpenGL/packer/pack_lists.c

    r33457 r33475  
    6363void PACK_APIENTRY crPackNewList( GLuint list, GLenum mode )
    6464{
    65     GET_PACKER_CONTEXT(pc);
     65    CR_GET_PACKER_CONTEXT(pc);
    6666    unsigned char *data_ptr;
    6767    (void) pc;
    68     GET_BUFFERED_POINTER( pc, 16 );
     68    CR_GET_BUFFERED_POINTER( pc, 16 );
    6969    WRITE_DATA( 0, GLint, 16 );
    7070    WRITE_DATA( 4, GLenum, CR_NEWLIST_EXTEND_OPCODE );
     
    7474    pc->buffer.in_List = GL_TRUE;
    7575    pc->buffer.holds_List = GL_TRUE;
     76    CR_UNLOCK_PACKER_CONTEXT(pc);
    7677}
    7778
    7879void PACK_APIENTRY crPackEndList( void )
    7980{
    80     GET_PACKER_CONTEXT(pc);
     81    CR_GET_PACKER_CONTEXT(pc);
    8182    unsigned char *data_ptr;
    82     GET_BUFFERED_POINTER( pc, 8 );
     83    CR_GET_BUFFERED_POINTER( pc, 8 );
    8384    WRITE_DATA( 0, GLint, 8 );
    8485    WRITE_DATA( 4, GLenum, CR_ENDLIST_EXTEND_OPCODE );
    8586    WRITE_OPCODE( pc, CR_EXTEND_OPCODE );
    8687    pc->buffer.in_List = GL_FALSE;
     88    CR_UNLOCK_PACKER_CONTEXT(pc);
    8789}
  • trunk/src/VBox/GuestHost/OpenGL/packer/pack_materials.c

    r33457 r33475  
    1010static void __handleMaterialData( GLenum face, GLenum pname, const GLfloat *params )
    1111{
    12     GET_PACKER_CONTEXT(pc);
     12    CR_GET_PACKER_CONTEXT(pc);
    1313    unsigned int packet_length = sizeof( int ) + sizeof( face ) + sizeof( pname );
    1414    unsigned int params_length = 0;
     
    3535    packet_length += params_length;
    3636
    37     GET_BUFFERED_POINTER(pc, packet_length );
     37    CR_GET_BUFFERED_POINTER(pc, packet_length );
    3838    WRITE_DATA( 0, int, packet_length );
    3939    WRITE_DATA( sizeof( int ) + 0, GLenum, face );
     
    5353void PACK_APIENTRY crPackMaterialfv(GLenum face, GLenum pname, const GLfloat *params)
    5454{
    55     GET_PACKER_CONTEXT(pc);
     55    CR_GET_PACKER_CONTEXT(pc);
    5656    __handleMaterialData( face, pname, params );
    5757    WRITE_OPCODE( pc, CR_MATERIALFV_OPCODE );
     58    CR_UNLOCK_PACKER_CONTEXT(pc);
    5859}
    5960
     
    6162{
    6263    /* floats and ints are the same size, so the packing should be the same */
    63     GET_PACKER_CONTEXT(pc);
     64    CR_GET_PACKER_CONTEXT(pc);
    6465    __handleMaterialData( face, pname, (const GLfloat *) params );
    6566    WRITE_OPCODE( pc, CR_MATERIALIV_OPCODE );
     67    CR_UNLOCK_PACKER_CONTEXT(pc);
    6668}
  • trunk/src/VBox/GuestHost/OpenGL/packer/pack_matrices.c

    r33457 r33475  
    1010void PACK_APIENTRY crPackMultMatrixd( const GLdouble *m )
    1111{
    12     GET_PACKER_CONTEXT(pc);
    13     unsigned char *data_ptr;
    14     int packet_length = 16*sizeof( *m );
    15     GET_BUFFERED_POINTER(pc, packet_length );
     12    CR_GET_PACKER_CONTEXT(pc);
     13    unsigned char *data_ptr;
     14    int packet_length = 16*sizeof( *m );
     15    CR_GET_BUFFERED_POINTER(pc, packet_length );
    1616    WRITE_DOUBLE( 0*sizeof(double), m[ 0] );
    1717    WRITE_DOUBLE( 1*sizeof(double), m[ 1] );
     
    3131    WRITE_DOUBLE( 15*sizeof(double), m[15] );
    3232    WRITE_OPCODE( pc, CR_MULTMATRIXD_OPCODE );
     33    CR_UNLOCK_PACKER_CONTEXT(pc);
    3334}
    3435
    3536void PACK_APIENTRY crPackMultMatrixf( const GLfloat *m )
    3637{
    37     GET_PACKER_CONTEXT(pc);
    38     unsigned char *data_ptr;
    39     int packet_length = 16*sizeof( *m );
    40     GET_BUFFERED_POINTER(pc, packet_length );
     38    CR_GET_PACKER_CONTEXT(pc);
     39    unsigned char *data_ptr;
     40    int packet_length = 16*sizeof( *m );
     41    CR_GET_BUFFERED_POINTER(pc, packet_length );
    4142    WRITE_DATA( 0*sizeof(GLfloat), GLfloat, m[ 0] );
    4243    WRITE_DATA( 1*sizeof(GLfloat), GLfloat, m[ 1] );
     
    5657    WRITE_DATA( 15*sizeof(GLfloat), GLfloat, m[15] );
    5758    WRITE_OPCODE( pc, CR_MULTMATRIXF_OPCODE );
     59    CR_UNLOCK_PACKER_CONTEXT(pc);
    5860}
    5961
    6062void PACK_APIENTRY crPackLoadMatrixd( const GLdouble *m )
    6163{
    62     GET_PACKER_CONTEXT(pc);
    63     unsigned char *data_ptr;
    64     int packet_length = 16*sizeof( *m );
    65     GET_BUFFERED_POINTER(pc, packet_length );
     64    CR_GET_PACKER_CONTEXT(pc);
     65    unsigned char *data_ptr;
     66    int packet_length = 16*sizeof( *m );
     67    CR_GET_BUFFERED_POINTER(pc, packet_length );
    6668    WRITE_DOUBLE( 0*sizeof(double), m[ 0] );
    6769    WRITE_DOUBLE( 1*sizeof(double), m[ 1] );
     
    8183    WRITE_DOUBLE( 15*sizeof(double), m[15] );
    8284    WRITE_OPCODE( pc, CR_LOADMATRIXD_OPCODE );
     85    CR_UNLOCK_PACKER_CONTEXT(pc);
    8386}
    8487
    8588void PACK_APIENTRY crPackLoadMatrixf( const GLfloat *m )
    8689{
    87     GET_PACKER_CONTEXT(pc);
    88     unsigned char *data_ptr;
    89     int packet_length = 16*sizeof( *m );
    90     GET_BUFFERED_POINTER(pc, packet_length );
     90    CR_GET_PACKER_CONTEXT(pc);
     91    unsigned char *data_ptr;
     92    int packet_length = 16*sizeof( *m );
     93    CR_GET_BUFFERED_POINTER(pc, packet_length );
    9194    WRITE_DATA( 0*sizeof(GLfloat), GLfloat, m[ 0] );
    9295    WRITE_DATA( 1*sizeof(GLfloat), GLfloat, m[ 1] );
     
    106109    WRITE_DATA( 15*sizeof(GLfloat), GLfloat, m[15] );
    107110    WRITE_OPCODE( pc, CR_LOADMATRIXF_OPCODE );
     111    CR_UNLOCK_PACKER_CONTEXT(pc);
    108112}
    109113
    110114void PACK_APIENTRY crPackMultTransposeMatrixdARB( const GLdouble *m )
    111115{
    112     GET_PACKER_CONTEXT(pc);
    113     unsigned char *data_ptr;
    114     int packet_length = 16*sizeof( *m ) + sizeof(GLint) + sizeof(GLenum);
    115     GET_BUFFERED_POINTER(pc, packet_length );
     116    CR_GET_PACKER_CONTEXT(pc);
     117    unsigned char *data_ptr;
     118    int packet_length = 16*sizeof( *m ) + sizeof(GLint) + sizeof(GLenum);
     119    CR_GET_BUFFERED_POINTER(pc, packet_length );
    116120    WRITE_DATA( 0, GLint, packet_length );
    117121    WRITE_DATA( 4, GLenum, CR_MULTTRANSPOSEMATRIXDARB_EXTEND_OPCODE );
     
    133137    WRITE_DOUBLE( 8 + 15*sizeof(double), m[15] );
    134138    WRITE_OPCODE( pc, CR_EXTEND_OPCODE );
     139    CR_UNLOCK_PACKER_CONTEXT(pc);
    135140}
    136141
    137142void PACK_APIENTRY crPackMultTransposeMatrixfARB( const GLfloat *m )
    138143{
    139     GET_PACKER_CONTEXT(pc);
    140     unsigned char *data_ptr;
    141     int packet_length = 16*sizeof( *m ) + sizeof(GLint) + sizeof(GLenum);
    142     GET_BUFFERED_POINTER(pc, packet_length );
     144    CR_GET_PACKER_CONTEXT(pc);
     145    unsigned char *data_ptr;
     146    int packet_length = 16*sizeof( *m ) + sizeof(GLint) + sizeof(GLenum);
     147    CR_GET_BUFFERED_POINTER(pc, packet_length );
    143148    WRITE_DATA( 0, GLint, packet_length );
    144149    WRITE_DATA( 4, GLenum, CR_MULTTRANSPOSEMATRIXFARB_EXTEND_OPCODE );
     
    160165    WRITE_DATA( 8 + 15*sizeof(GLfloat), GLfloat, m[15] );
    161166    WRITE_OPCODE( pc, CR_EXTEND_OPCODE );
     167    CR_UNLOCK_PACKER_CONTEXT(pc);
    162168}
    163169
    164170void PACK_APIENTRY crPackLoadTransposeMatrixdARB( const GLdouble *m )
    165171{
    166     GET_PACKER_CONTEXT(pc);
    167     unsigned char *data_ptr;
    168     int packet_length = 16*sizeof( *m ) + sizeof(GLint) + sizeof(GLenum);
    169     GET_BUFFERED_POINTER(pc, packet_length );
     172    CR_GET_PACKER_CONTEXT(pc);
     173    unsigned char *data_ptr;
     174    int packet_length = 16*sizeof( *m ) + sizeof(GLint) + sizeof(GLenum);
     175    CR_GET_BUFFERED_POINTER(pc, packet_length );
    170176    WRITE_DATA( 0, GLint, packet_length );
    171177    WRITE_DATA( 4, GLenum, CR_LOADTRANSPOSEMATRIXDARB_EXTEND_OPCODE );
     
    187193    WRITE_DOUBLE( 8 + 15*sizeof(double), m[15] );
    188194    WRITE_OPCODE( pc, CR_EXTEND_OPCODE );
     195    CR_UNLOCK_PACKER_CONTEXT(pc);
    189196}
    190197
    191198void PACK_APIENTRY crPackLoadTransposeMatrixfARB( const GLfloat *m )
    192199{
    193     GET_PACKER_CONTEXT(pc);
    194     unsigned char *data_ptr;
    195     int packet_length = 16*sizeof( *m ) + sizeof(GLint) + sizeof(GLenum);
    196     GET_BUFFERED_POINTER(pc, packet_length );
     200    CR_GET_PACKER_CONTEXT(pc);
     201    unsigned char *data_ptr;
     202    int packet_length = 16*sizeof( *m ) + sizeof(GLint) + sizeof(GLenum);
     203    CR_GET_BUFFERED_POINTER(pc, packet_length );
    197204    WRITE_DATA( 0, GLint, packet_length );
    198205    WRITE_DATA( 4, GLenum, CR_LOADTRANSPOSEMATRIXFARB_EXTEND_OPCODE );
     
    214221    WRITE_DATA( 8 + 15*sizeof(GLfloat), GLfloat, m[15] );
    215222    WRITE_OPCODE( pc, CR_EXTEND_OPCODE );
    216 }
     223    CR_UNLOCK_PACKER_CONTEXT(pc);
     224}
  • trunk/src/VBox/GuestHost/OpenGL/packer/pack_misc.c

    r33457 r33475  
    1010void PACK_APIENTRY crPackChromiumParametervCR(GLenum target, GLenum type, GLsizei count, const GLvoid *values)
    1111{
    12     GET_PACKER_CONTEXT(pc);
     12    CR_GET_PACKER_CONTEXT(pc);
    1313    unsigned int header_length = 2 * sizeof(int) + sizeof(target) + sizeof(type) + sizeof(count);
    1414    unsigned int packet_length;
     
    4646    packet_length = header_length + params_length;
    4747
    48     GET_BUFFERED_POINTER(pc, packet_length );
     48    CR_GET_BUFFERED_POINTER(pc, packet_length );
    4949    WRITE_DATA( 0, GLint, packet_length );
    5050    WRITE_DATA( 4, GLenum, CR_CHROMIUMPARAMETERVCR_EXTEND_OPCODE );
     
    9090        __PackError( __LINE__, __FILE__, GL_INVALID_ENUM,
    9191                                 "crPackChromiumParametervCR(bad type)" );
     92        CR_UNLOCK_PACKER_CONTEXT(pc);
    9293        return;
    9394    }
     95    CR_UNLOCK_PACKER_CONTEXT(pc);
    9496}
    9597
     
    98100    unsigned char *data_ptr;
    99101    int packet_length = sizeof(GLenum)+sizeof(n)+n*sizeof(*ids);
    100     GET_PACKER_CONTEXT(pc);
    101102    if (!ids) return;
    102103    data_ptr = (unsigned char *) crPackAlloc(packet_length);
  • trunk/src/VBox/GuestHost/OpenGL/packer/pack_pixels.c

    r27983 r33475  
    6464                                    int *writeback)
    6565{
    66     GET_PACKER_CONTEXT(pc);
     66    CR_GET_PACKER_CONTEXT(pc);
    6767    unsigned char *data_ptr;
    6868    GLint stride = 0;
     
    8989    }
    9090
    91     GET_BUFFERED_POINTER(pc, 48 + sizeof(CRNetworkPointer) );
     91    CR_GET_BUFFERED_POINTER(pc, 48 + sizeof(CRNetworkPointer) );
    9292    WRITE_DATA( 0,  GLint,  x );
    9393    WRITE_DATA( 4,  GLint,  y );
     
    104104    WRITE_NETWORK_POINTER( 48, (char *) pixels );
    105105    WRITE_OPCODE( pc, CR_READPIXELS_OPCODE );
     106    CR_UNLOCK_PACKER_CONTEXT(pc);
    106107}
    107108
     
    205206                                     int * writeback )
    206207{
    207     GET_PACKER_CONTEXT(pc);
     208    CR_GET_PACKER_CONTEXT(pc);
    208209    unsigned char *data_ptr;
    209210    (void) pc;
    210     GET_BUFFERED_POINTER( pc, 40 );
     211    CR_GET_BUFFERED_POINTER( pc, 40 );
    211212    WRITE_DATA( 0, GLint, 40 );
    212213    WRITE_DATA( 4, GLenum, CR_GETTEXIMAGE_EXTEND_OPCODE );
     
    218219    WRITE_NETWORK_POINTER( 32, (void *) writeback );
    219220    WRITE_OPCODE( pc, CR_EXTEND_OPCODE );
    220 }
     221    CR_UNLOCK_PACKER_CONTEXT(pc);
     222}
  • trunk/src/VBox/GuestHost/OpenGL/packer/pack_point.c

    r33457 r33475  
    1313static GLboolean __handlePointDataf( GLenum pname, const GLfloat *params )
    1414{
    15     GET_PACKER_CONTEXT(pc);
     15    CR_GET_PACKER_CONTEXT(pc);
    1616    int params_length = 0;
    1717    int packet_length = 2 * sizeof( int ) + sizeof( pname );
     
    3737    packet_length += params_length;
    3838
    39     GET_BUFFERED_POINTER(pc, packet_length );
     39    CR_GET_BUFFERED_POINTER(pc, packet_length );
    4040    WRITE_DATA( 0, GLint, packet_length );
    4141    WRITE_DATA( 4, GLenum, CR_POINTPARAMETERFVARB_EXTEND_OPCODE );
     
    5252void PACK_APIENTRY crPackPointParameterfvARB(GLenum pname, const GLfloat *params)
    5353{
    54     GET_PACKER_CONTEXT(pc);
     54    CR_GET_PACKER_CONTEXT(pc);
    5555    if (__handlePointDataf( pname, params ))
    5656        WRITE_OPCODE( pc, CR_EXTEND_OPCODE );
     57    CR_UNLOCK_PACKER_CONTEXT(pc);
    5758}
    5859
     
    6162static GLboolean __handlePointDatai( GLenum pname, const GLint *params )
    6263{
    63     GET_PACKER_CONTEXT(pc);
     64    CR_GET_PACKER_CONTEXT(pc);
    6465    int params_length = 0;
    6566    int packet_length = 2 * sizeof( int ) + sizeof( pname );
     
    8586    packet_length += params_length;
    8687
    87     GET_BUFFERED_POINTER(pc, packet_length );
     88    CR_GET_BUFFERED_POINTER(pc, packet_length );
    8889    WRITE_DATA( 0, GLint, packet_length );
    8990    WRITE_DATA( 4, GLenum, CR_POINTPARAMETERIV_EXTEND_OPCODE );
     
    100101void PACK_APIENTRY crPackPointParameteriv(GLenum pname, const GLint *params)
    101102{
    102     GET_PACKER_CONTEXT(pc);
     103    CR_GET_PACKER_CONTEXT(pc);
    103104    if (__handlePointDatai( pname, params ))
    104105        WRITE_OPCODE( pc, CR_EXTEND_OPCODE );
     106    CR_UNLOCK_PACKER_CONTEXT(pc);
    105107}
  • trunk/src/VBox/GuestHost/OpenGL/packer/pack_program.c

    r33457 r33475  
    1717void PACK_APIENTRY crPackProgramParameters4dvNV (GLenum target, GLuint index, GLuint num, const GLdouble * params)
    1818{
    19     GET_PACKER_CONTEXT(pc);
     19    CR_GET_PACKER_CONTEXT(pc);
    2020    unsigned char *data_ptr;
    2121    int packet_length = sizeof(int) + sizeof(target) + sizeof(index) + sizeof(num) + num * 4 * sizeof(GLdouble);
    2222
    23     GET_BUFFERED_POINTER(pc, packet_length);
     23    CR_GET_BUFFERED_POINTER(pc, packet_length);
    2424    WRITE_DATA(0, int, packet_length);
    2525    WRITE_DATA(sizeof(int) + 0, GLenum, target);
     
    2929
    3030    WRITE_OPCODE(pc, CR_PROGRAMPARAMETERS4DVNV_EXTEND_OPCODE);
     31    CR_UNLOCK_PACKER_CONTEXT(pc);
    3132}
    3233
     
    3435void PACK_APIENTRY crPackProgramParameters4fvNV (GLenum target, GLuint index, GLuint num, const GLfloat * params)
    3536{
    36     GET_PACKER_CONTEXT(pc);
     37    CR_GET_PACKER_CONTEXT(pc);
    3738    unsigned char *data_ptr;
    3839    int packet_length = sizeof(int) + sizeof(target) + sizeof(index) + sizeof(num) + num * 4 * sizeof(GLfloat);
    3940
    40     GET_BUFFERED_POINTER(pc, packet_length);
     41    CR_GET_BUFFERED_POINTER(pc, packet_length);
    4142    WRITE_DATA(0, int, packet_length);
    4243    WRITE_DATA(sizeof(int) + 0, GLenum, target);
     
    4647
    4748    WRITE_OPCODE(pc, CR_PROGRAMPARAMETERS4FVNV_EXTEND_OPCODE);
     49    CR_UNLOCK_PACKER_CONTEXT(pc);
    4850}
    4951
     
    161163    const int packet_length = 32;
    162164    unsigned char *data_ptr;
    163     GET_PACKER_CONTEXT(pc);
    164 
    165     GET_BUFFERED_POINTER(pc, packet_length);
     165    CR_GET_PACKER_CONTEXT(pc);
     166
     167    CR_GET_BUFFERED_POINTER(pc, packet_length);
    166168    WRITE_DATA(0, int, packet_length);
    167169    WRITE_DATA(4, GLenum, CR_EXECUTEPROGRAMNV_EXTEND_OPCODE);
     
    173175    WRITE_DATA(28, GLfloat, params[3] );
    174176    WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
     177    CR_UNLOCK_PACKER_CONTEXT(pc);
    175178}
    176179
     
    179182    const int packet_length = 20 + len;
    180183    unsigned char *data_ptr;
    181     GET_PACKER_CONTEXT(pc);
    182 
    183     GET_BUFFERED_POINTER(pc, packet_length);
     184    CR_GET_PACKER_CONTEXT(pc);
     185
     186    CR_GET_BUFFERED_POINTER(pc, packet_length);
    184187    WRITE_DATA(0, int, packet_length);
    185188    WRITE_DATA(4, GLenum, CR_LOADPROGRAMNV_EXTEND_OPCODE);
     
    189192    crMemcpy( (void *) (data_ptr + 20), program, len );
    190193    WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
     194    CR_UNLOCK_PACKER_CONTEXT(pc);
    191195}
    192196
    193197void PACK_APIENTRY crPackRequestResidentProgramsNV( GLsizei n, const GLuint *ids )
    194198{
    195     GET_PACKER_CONTEXT(pc);
     199    CR_GET_PACKER_CONTEXT(pc);
    196200    (void) pc;
    197201    (void) n;
     
    203207void PACK_APIENTRY crPackProgramNamedParameter4fNV (GLuint id, GLsizei len, const GLubyte * name, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
    204208{
    205     GET_PACKER_CONTEXT(pc);
     209    CR_GET_PACKER_CONTEXT(pc);
    206210    unsigned char *data_ptr;
    207211    int packet_length = 32 + len;
    208212
    209     GET_BUFFERED_POINTER(pc, packet_length);
     213    CR_GET_BUFFERED_POINTER(pc, packet_length);
    210214    WRITE_DATA(0, GLint, packet_length);
    211215    WRITE_DATA(4, GLenum, CR_PROGRAMNAMEDPARAMETER4FNV_EXTEND_OPCODE);
     
    218222    crMemcpy( (void *) (data_ptr + 32), name, len );
    219223    WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
     224    CR_UNLOCK_PACKER_CONTEXT(pc);
    220225}
    221226
    222227void PACK_APIENTRY crPackProgramNamedParameter4dNV (GLuint id, GLsizei len, const GLubyte * name, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
    223228{
    224     GET_PACKER_CONTEXT(pc);
     229    CR_GET_PACKER_CONTEXT(pc);
    225230    unsigned char *data_ptr;
    226231    int packet_length = 48 + len;
    227232
    228     GET_BUFFERED_POINTER(pc, packet_length);
     233    CR_GET_BUFFERED_POINTER(pc, packet_length);
    229234    WRITE_DATA(0, GLint, packet_length);
    230235    WRITE_DATA(4, GLenum, CR_PROGRAMNAMEDPARAMETER4DNV_EXTEND_OPCODE);
     
    238243
    239244    WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
     245    CR_UNLOCK_PACKER_CONTEXT(pc);
    240246}
    241247
     
    256262                                                        int *writeback)
    257263{
    258     GET_PACKER_CONTEXT(pc);
     264    CR_GET_PACKER_CONTEXT(pc);
    259265    unsigned char *data_ptr;
    260266    int packet_length;
     
    268274        8 + 8;
    269275
    270     GET_BUFFERED_POINTER(pc, packet_length);
     276    CR_GET_BUFFERED_POINTER(pc, packet_length);
    271277    WRITE_DATA(0, int, packet_length);
    272278    WRITE_DATA(4, GLenum, CR_AREPROGRAMSRESIDENTNV_EXTEND_OPCODE);
     
    276282    WRITE_NETWORK_POINTER(20 + n * sizeof(*programs), (void *) writeback);
    277283    WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
     284    CR_UNLOCK_PACKER_CONTEXT(pc);
    278285}
    279286
     
    282289{
    283290    int packet_length = 32 + len;
    284     GET_PACKER_CONTEXT(pc);
    285     unsigned char *data_ptr;
    286     GET_BUFFERED_POINTER( pc, packet_length );
     291    CR_GET_PACKER_CONTEXT(pc);
     292    unsigned char *data_ptr;
     293    CR_GET_BUFFERED_POINTER( pc, packet_length );
    287294    WRITE_DATA( 0, GLint, packet_length );
    288295    WRITE_DATA( 4, GLenum, CR_GETPROGRAMNAMEDPARAMETERFVNV_EXTEND_OPCODE );
     
    293300    WRITE_NETWORK_POINTER( 16 + len + 8, (void *) writeback );
    294301    WRITE_OPCODE( pc, CR_EXTEND_OPCODE );
     302    CR_UNLOCK_PACKER_CONTEXT(pc);
    295303}
    296304
     
    298306{
    299307    int packet_length = 32 + len;
    300     GET_PACKER_CONTEXT(pc);
    301     unsigned char *data_ptr;
    302     GET_BUFFERED_POINTER( pc, packet_length );
     308    CR_GET_PACKER_CONTEXT(pc);
     309    unsigned char *data_ptr;
     310    CR_GET_BUFFERED_POINTER( pc, packet_length );
    303311    WRITE_DATA( 0, GLint, packet_length );
    304312    WRITE_DATA( 4, GLenum, CR_GETPROGRAMNAMEDPARAMETERDVNV_EXTEND_OPCODE );
     
    309317    WRITE_NETWORK_POINTER( 16 + len + 8, (void *) writeback );
    310318    WRITE_OPCODE( pc, CR_EXTEND_OPCODE );
     319    CR_UNLOCK_PACKER_CONTEXT(pc);
    311320}
    312321
     
    333342    const int packet_length = 20 + len;
    334343    unsigned char *data_ptr;
    335     GET_PACKER_CONTEXT(pc);
    336 
    337     GET_BUFFERED_POINTER(pc, packet_length);
     344    CR_GET_PACKER_CONTEXT(pc);
     345
     346    CR_GET_BUFFERED_POINTER(pc, packet_length);
    338347    WRITE_DATA(0, int, packet_length);
    339348    WRITE_DATA(4, GLenum, CR_PROGRAMSTRINGARB_EXTEND_OPCODE);
     
    343352    crMemcpy( (void *) (data_ptr + 20), string, len );
    344353    WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
     354    CR_UNLOCK_PACKER_CONTEXT(pc);
    345355}
    346356
     
    353363void PACK_APIENTRY crPackVertexAttrib4NbvARB( GLuint index, const GLbyte *v )
    354364{
    355     GET_PACKER_CONTEXT(pc);
    356     unsigned char *data_ptr;
    357     GET_BUFFERED_POINTER( pc, 8 );
     365    CR_GET_PACKER_CONTEXT(pc);
     366    unsigned char *data_ptr;
     367    CR_GET_BUFFERED_POINTER( pc, 8 );
    358368    pc->current.c.vertexAttrib.b4[index] = data_ptr + 12;
    359369    pc->current.attribsUsedMask |= (1 << index);
     
    364374    WRITE_DATA( 7, GLbyte, v[3] );
    365375    WRITE_OPCODE( pc, CR_VERTEXATTRIB4NBVARB_OPCODE );
     376    CR_UNLOCK_PACKER_CONTEXT(pc);
    366377}
    367378
    368379void PACK_APIENTRY crPackVertexAttrib4NivARB( GLuint index, const GLint *v )
    369380{
    370     GET_PACKER_CONTEXT(pc);
    371     unsigned char *data_ptr;
    372     GET_BUFFERED_POINTER( pc, 20 );
     381    CR_GET_PACKER_CONTEXT(pc);
     382    unsigned char *data_ptr;
     383    CR_GET_BUFFERED_POINTER( pc, 20 );
    373384    pc->current.c.vertexAttrib.i4[index] = data_ptr + 12;
    374385    pc->current.attribsUsedMask |= (1 << index);
     
    379390    WRITE_DATA( 16, GLint, v[3] );
    380391    WRITE_OPCODE( pc, CR_VERTEXATTRIB4NIVARB_OPCODE );
     392    CR_UNLOCK_PACKER_CONTEXT(pc);
    381393}
    382394
    383395void PACK_APIENTRY crPackVertexAttrib4NsvARB( GLuint index, const GLshort *v )
    384396{
    385     GET_PACKER_CONTEXT(pc);
    386     unsigned char *data_ptr;
    387     GET_BUFFERED_POINTER( pc, 12 );
     397    CR_GET_PACKER_CONTEXT(pc);
     398    unsigned char *data_ptr;
     399    CR_GET_BUFFERED_POINTER( pc, 12 );
    388400    pc->current.c.vertexAttrib.s4[index] = data_ptr + 12;
    389401    pc->current.attribsUsedMask |= (1 << index);
     
    394406    WRITE_DATA( 10, GLshort, v[3] );
    395407    WRITE_OPCODE( pc, CR_VERTEXATTRIB4NSVARB_OPCODE );
     408    CR_UNLOCK_PACKER_CONTEXT(pc);
    396409}
    397410
    398411void PACK_APIENTRY crPackVertexAttrib4NubvARB(GLuint index, const GLubyte * v)
    399412{
    400     GET_PACKER_CONTEXT(pc);
    401     unsigned char *data_ptr;
    402     GET_BUFFERED_POINTER( pc, 8 );
     413    CR_GET_PACKER_CONTEXT(pc);
     414    unsigned char *data_ptr;
     415    CR_GET_BUFFERED_POINTER( pc, 8 );
    403416    pc->current.c.vertexAttrib.ub4[index] = data_ptr + 12;
    404417    pc->current.attribsUsedMask |= (1 << index);
     
    409422    WRITE_DATA( 7, GLubyte, v[3] );
    410423    WRITE_OPCODE( pc, CR_VERTEXATTRIB4NUBVARB_OPCODE );
     424    CR_UNLOCK_PACKER_CONTEXT(pc);
    411425}
    412426
    413427void PACK_APIENTRY crPackVertexAttrib4NuivARB(GLuint index, const GLuint * v)
    414428{
    415     GET_PACKER_CONTEXT(pc);
    416     unsigned char *data_ptr;
    417     GET_BUFFERED_POINTER( pc, 20 );
     429    CR_GET_PACKER_CONTEXT(pc);
     430    unsigned char *data_ptr;
     431    CR_GET_BUFFERED_POINTER( pc, 20 );
    418432    pc->current.c.vertexAttrib.ui4[index] = data_ptr + 12;
    419433    pc->current.attribsUsedMask |= (1 << index);
     
    424438    WRITE_DATA( 16, GLuint, v[3] );
    425439    WRITE_OPCODE( pc, CR_VERTEXATTRIB4NUIVARB_OPCODE );
     440    CR_UNLOCK_PACKER_CONTEXT(pc);
    426441}
    427442
    428443void PACK_APIENTRY crPackVertexAttrib4NusvARB(GLuint index, const GLushort * v)
    429444{
    430     GET_PACKER_CONTEXT(pc);
    431     unsigned char *data_ptr;
    432     GET_BUFFERED_POINTER( pc, 12 );
     445    CR_GET_PACKER_CONTEXT(pc);
     446    unsigned char *data_ptr;
     447    CR_GET_BUFFERED_POINTER( pc, 12 );
    433448    pc->current.c.vertexAttrib.s4[index] = data_ptr + 12;
    434449    pc->current.attribsUsedMask |= (1 << index);
     
    439454    WRITE_DATA( 10, GLushort, v[3] );
    440455    WRITE_OPCODE( pc, CR_VERTEXATTRIB4NUSVARB_OPCODE );
     456    CR_UNLOCK_PACKER_CONTEXT(pc);
    441457}
    442458
    443459void PACK_APIENTRY crPackVertexAttrib4bvARB(GLuint index, const GLbyte * v)
    444460{
    445     GET_PACKER_CONTEXT(pc);
    446     unsigned char *data_ptr;
    447     GET_BUFFERED_POINTER( pc, 8 );
     461    CR_GET_PACKER_CONTEXT(pc);
     462    unsigned char *data_ptr;
     463    CR_GET_BUFFERED_POINTER( pc, 8 );
    448464    pc->current.c.vertexAttrib.b4[index] = data_ptr + 12;
    449465    pc->current.attribsUsedMask |= (1 << index);
     
    454470    WRITE_DATA( 7, GLbyte, v[3] );
    455471    WRITE_OPCODE( pc, CR_VERTEXATTRIB4BVARB_OPCODE );
     472    CR_UNLOCK_PACKER_CONTEXT(pc);
    456473}
    457474
    458475void PACK_APIENTRY crPackVertexAttrib4ivARB(GLuint index, const GLint * v)
    459476{
    460     GET_PACKER_CONTEXT(pc);
    461     unsigned char *data_ptr;
    462     GET_BUFFERED_POINTER( pc, 20 );
     477    CR_GET_PACKER_CONTEXT(pc);
     478    unsigned char *data_ptr;
     479    CR_GET_BUFFERED_POINTER( pc, 20 );
    463480    pc->current.c.vertexAttrib.i4[index] = data_ptr + 12;
    464481    pc->current.attribsUsedMask |= (1 << index);
     
    469486    WRITE_DATA( 16, GLint, v[3] );
    470487    WRITE_OPCODE( pc, CR_VERTEXATTRIB4IVARB_OPCODE );
     488    CR_UNLOCK_PACKER_CONTEXT(pc);
    471489}
    472490
    473491void PACK_APIENTRY crPackVertexAttrib4uivARB(GLuint index, const GLuint * v)
    474492{
    475     GET_PACKER_CONTEXT(pc);
    476     unsigned char *data_ptr;
    477     GET_BUFFERED_POINTER( pc, 20 );
     493    CR_GET_PACKER_CONTEXT(pc);
     494    unsigned char *data_ptr;
     495    CR_GET_BUFFERED_POINTER( pc, 20 );
    478496    pc->current.c.vertexAttrib.ui4[index] = data_ptr + 12;
    479497    pc->current.attribsUsedMask |= (1 << index);
     
    484502    WRITE_DATA( 16, GLuint, v[3] );
    485503    WRITE_OPCODE( pc, CR_VERTEXATTRIB4UIVARB_OPCODE );
     504    CR_UNLOCK_PACKER_CONTEXT(pc);
    486505}
    487506
    488507void PACK_APIENTRY crPackVertexAttrib4usvARB(GLuint index, const GLushort * v)
    489508{
    490     GET_PACKER_CONTEXT(pc);
    491     unsigned char *data_ptr;
    492     GET_BUFFERED_POINTER( pc, 12 );
     509    CR_GET_PACKER_CONTEXT(pc);
     510    unsigned char *data_ptr;
     511    CR_GET_BUFFERED_POINTER( pc, 12 );
    493512    pc->current.c.vertexAttrib.s4[index] = data_ptr + 12;
    494513    pc->current.attribsUsedMask |= (1 << index);
     
    499518    WRITE_DATA( 10, GLushort, v[3] );
    500519    WRITE_OPCODE( pc, CR_VERTEXATTRIB4USVARB_OPCODE );
     520    CR_UNLOCK_PACKER_CONTEXT(pc);
    501521}
    502522
     
    504524void PACK_APIENTRY crPackVertexAttrib4ubvARB(GLuint index, const GLubyte * v)
    505525{
    506     GET_PACKER_CONTEXT(pc);
    507     unsigned char *data_ptr;
    508     GET_BUFFERED_POINTER( pc, 8 );
     526    CR_GET_PACKER_CONTEXT(pc);
     527    unsigned char *data_ptr;
     528    CR_GET_BUFFERED_POINTER( pc, 8 );
    509529    pc->current.c.vertexAttrib.ub4[index] = data_ptr + 12;
    510530    pc->current.attribsUsedMask |= (1 << index);
     
    515535    WRITE_DATA( 7, GLubyte, v[3] );
    516536    WRITE_OPCODE( pc, CR_VERTEXATTRIB4UBVARB_OPCODE );
    517 }
    518 
     537    CR_UNLOCK_PACKER_CONTEXT(pc);
     538}
     539
  • trunk/src/VBox/GuestHost/OpenGL/packer/pack_regcombiner.c

    r33457 r33475  
    1010static GLboolean __handleCombinerParameterData( GLenum pname, const GLfloat *params, GLenum extended_opcode )
    1111{
    12     GET_PACKER_CONTEXT(pc);
     12    CR_GET_PACKER_CONTEXT(pc);
    1313    unsigned int params_length = 0;
    1414    unsigned int packet_length = sizeof( int ) + sizeof( extended_opcode ) + sizeof( pname );
     
    3232    }
    3333    packet_length += params_length;
    34     GET_BUFFERED_POINTER(pc, packet_length );
     34    CR_GET_BUFFERED_POINTER(pc, packet_length );
    3535    WRITE_DATA( 0, int, packet_length );
    3636    WRITE_DATA( sizeof( int ) + 0, GLenum, extended_opcode );
     
    4949void PACK_APIENTRY crPackCombinerParameterfvNV( GLenum pname, const GLfloat *params )
    5050{
    51     GET_PACKER_CONTEXT(pc);
     51    CR_GET_PACKER_CONTEXT(pc);
    5252    if (__handleCombinerParameterData( pname, params, CR_COMBINERPARAMETERFVNV_EXTEND_OPCODE ))
    5353        WRITE_OPCODE( pc, CR_EXTEND_OPCODE );
     54    CR_UNLOCK_PACKER_CONTEXT(pc);
    5455}
    5556
     
    5758{
    5859    /* floats and ints are the same size, so the packing should be the same */
    59     GET_PACKER_CONTEXT(pc);
     60    CR_GET_PACKER_CONTEXT(pc);
    6061    if (__handleCombinerParameterData( pname, (const GLfloat *) params, CR_COMBINERPARAMETERIVNV_EXTEND_OPCODE ))
    6162        WRITE_OPCODE( pc, CR_EXTEND_OPCODE );
     63    CR_UNLOCK_PACKER_CONTEXT(pc);
    6264}
    6365
    6466void PACK_APIENTRY crPackCombinerStageParameterfvNV( GLenum stage, GLenum pname, const GLfloat *params )
    6567{
    66     GET_PACKER_CONTEXT(pc);
     68    CR_GET_PACKER_CONTEXT(pc);
    6769    unsigned char *data_ptr;
    6870
    69     GET_BUFFERED_POINTER(pc, 32 );
     71    CR_GET_BUFFERED_POINTER(pc, 32 );
    7072    WRITE_DATA( 0, GLint, 32 );
    7173    WRITE_DATA( 4, GLenum, CR_COMBINERSTAGEPARAMETERFVNV_EXTEND_OPCODE );
     
    7779    WRITE_DATA( 28, GLfloat, params[3] );
    7880    WRITE_OPCODE( pc, CR_EXTEND_OPCODE );
     81    CR_UNLOCK_PACKER_CONTEXT(pc);
    7982}
  • trunk/src/VBox/GuestHost/OpenGL/packer/pack_shaders.c

    r28800 r33475  
    2323void PACK_APIENTRY crPackBindAttribLocation(GLuint program, GLuint index, const char *name)
    2424{
    25     GET_PACKER_CONTEXT(pc);
     25    CR_GET_PACKER_CONTEXT(pc);
    2626    unsigned char *data_ptr;
    2727    int cbName = crStrlen(name)+1;
    2828    int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(program)+sizeof(index) + cbName*sizeof(*name);
    2929
    30     GET_BUFFERED_POINTER(pc, packet_length);
     30    CR_GET_BUFFERED_POINTER(pc, packet_length);
    3131    WRITE_DATA_AI(int, packet_length);
    3232    WRITE_DATA_AI(GLenum, CR_BINDATTRIBLOCATION_EXTEND_OPCODE);
     
    3535    crMemcpy(data_ptr, name, cbName*sizeof(*name));
    3636    WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
     37    CR_UNLOCK_PACKER_CONTEXT(pc);
    3738}
    3839
    3940void PACK_APIENTRY crPackShaderSource(GLuint shader, GLsizei count, const char **string, const GLint *length)
    4041{
    41     GET_PACKER_CONTEXT(pc);
     42    CR_GET_PACKER_CONTEXT(pc);
    4243    unsigned char *data_ptr;
    4344    GLint *pLocalLength;
     
    6162    }
    6263
    63     GET_BUFFERED_POINTER(pc, packet_length);
     64    CR_GET_BUFFERED_POINTER(pc, packet_length);
    6465    WRITE_DATA_AI(int, packet_length);
    6566    WRITE_DATA_AI(GLenum, CR_SHADERSOURCE_EXTEND_OPCODE);
     
    8283    }
    8384    WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
     85    CR_UNLOCK_PACKER_CONTEXT(pc);
    8486
    8587    crFree(pLocalLength);
     
    8890void PACK_APIENTRY crPackUniform1fv(GLint location, GLsizei count, const GLfloat *value)
    8991{
    90     GET_PACKER_CONTEXT(pc);
     92    CR_GET_PACKER_CONTEXT(pc);
    9193    unsigned char *data_ptr;
    9294    int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(location)+sizeof(count) + count*sizeof(*value);
    9395
    94     GET_BUFFERED_POINTER(pc, packet_length);
     96    CR_GET_BUFFERED_POINTER(pc, packet_length);
    9597    WRITE_DATA_AI(int, packet_length);
    9698    WRITE_DATA_AI(GLenum, CR_UNIFORM1FV_EXTEND_OPCODE);
     
    99101    crMemcpy(data_ptr, value, count*sizeof(*value));
    100102    WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
     103    CR_UNLOCK_PACKER_CONTEXT(pc);
    101104}
    102105
    103106void PACK_APIENTRY crPackUniform1iv(GLint location, GLsizei count, const GLint *value)
    104107{
    105     GET_PACKER_CONTEXT(pc);
     108    CR_GET_PACKER_CONTEXT(pc);
    106109    unsigned char *data_ptr;
    107110    int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(location)+sizeof(count) + count*sizeof(*value);
    108111
    109     GET_BUFFERED_POINTER(pc, packet_length);
     112    CR_GET_BUFFERED_POINTER(pc, packet_length);
    110113    WRITE_DATA_AI(int, packet_length);
    111114    WRITE_DATA_AI(GLenum, CR_UNIFORM1IV_EXTEND_OPCODE);
     
    114117    crMemcpy(data_ptr, value, count*sizeof(*value));
    115118    WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
     119    CR_UNLOCK_PACKER_CONTEXT(pc);
    116120}
    117121
    118122void PACK_APIENTRY crPackUniform2fv(GLint location, GLsizei count, const GLfloat *value)
    119123{
    120     GET_PACKER_CONTEXT(pc);
     124    CR_GET_PACKER_CONTEXT(pc);
    121125    unsigned char *data_ptr;
    122126    int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(location)+sizeof(count) + 2*count*sizeof(*value);
    123127
    124     GET_BUFFERED_POINTER(pc, packet_length);
     128    CR_GET_BUFFERED_POINTER(pc, packet_length);
    125129    WRITE_DATA_AI(int, packet_length);
    126130    WRITE_DATA_AI(GLenum, CR_UNIFORM2FV_EXTEND_OPCODE);
     
    129133    crMemcpy(data_ptr, value, 2*count*sizeof(*value));
    130134    WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
     135    CR_UNLOCK_PACKER_CONTEXT(pc);
    131136}
    132137
    133138void PACK_APIENTRY crPackUniform2iv(GLint location, GLsizei count, const GLint *value)
    134139{
    135     GET_PACKER_CONTEXT(pc);
     140    CR_GET_PACKER_CONTEXT(pc);
    136141    unsigned char *data_ptr;
    137142    int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(location)+sizeof(count) + 2*count*sizeof(*value);
    138143
    139     GET_BUFFERED_POINTER(pc, packet_length);
     144    CR_GET_BUFFERED_POINTER(pc, packet_length);
    140145    WRITE_DATA_AI(int, packet_length);
    141146    WRITE_DATA_AI(GLenum, CR_UNIFORM2IV_EXTEND_OPCODE);
     
    144149    crMemcpy(data_ptr, value, 2*count*sizeof(*value));
    145150    WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
     151    CR_UNLOCK_PACKER_CONTEXT(pc);
    146152}
    147153
    148154void PACK_APIENTRY crPackUniform3fv(GLint location, GLsizei count, const GLfloat *value)
    149155{
    150     GET_PACKER_CONTEXT(pc);
     156    CR_GET_PACKER_CONTEXT(pc);
    151157    unsigned char *data_ptr;
    152158    int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(location)+sizeof(count) + 3*count*sizeof(*value);
    153159
    154     GET_BUFFERED_POINTER(pc, packet_length);
     160    CR_GET_BUFFERED_POINTER(pc, packet_length);
    155161    WRITE_DATA_AI(int, packet_length);
    156162    WRITE_DATA_AI(GLenum, CR_UNIFORM3FV_EXTEND_OPCODE);
     
    159165    crMemcpy(data_ptr, value, 3*count*sizeof(*value));
    160166    WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
     167    CR_UNLOCK_PACKER_CONTEXT(pc);
    161168}
    162169
    163170void PACK_APIENTRY crPackUniform3iv(GLint location, GLsizei count, const GLint *value)
    164171{
    165     GET_PACKER_CONTEXT(pc);
     172    CR_GET_PACKER_CONTEXT(pc);
    166173    unsigned char *data_ptr;
    167174    int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(location)+sizeof(count) + 3*count*sizeof(*value);
    168175
    169     GET_BUFFERED_POINTER(pc, packet_length);
     176    CR_GET_BUFFERED_POINTER(pc, packet_length);
    170177    WRITE_DATA_AI(int, packet_length);
    171178    WRITE_DATA_AI(GLenum, CR_UNIFORM3IV_EXTEND_OPCODE);
     
    174181    crMemcpy(data_ptr, value, 3*count*sizeof(*value));
    175182    WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
     183    CR_UNLOCK_PACKER_CONTEXT(pc);
    176184}
    177185
    178186void PACK_APIENTRY crPackUniform4fv(GLint location, GLsizei count, const GLfloat *value)
    179187{
    180     GET_PACKER_CONTEXT(pc);
     188    CR_GET_PACKER_CONTEXT(pc);
    181189    unsigned char *data_ptr;
    182190    int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(location)+sizeof(count) + 4*count*sizeof(*value);
    183191
    184     GET_BUFFERED_POINTER(pc, packet_length);
     192    CR_GET_BUFFERED_POINTER(pc, packet_length);
    185193    WRITE_DATA_AI(int, packet_length);
    186194    WRITE_DATA_AI(GLenum, CR_UNIFORM4FV_EXTEND_OPCODE);
     
    189197    crMemcpy(data_ptr, value, 4*count*sizeof(*value));
    190198    WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
     199    CR_UNLOCK_PACKER_CONTEXT(pc);
    191200}
    192201
    193202void PACK_APIENTRY crPackUniform4iv(GLint location, GLsizei count, const GLint *value)
    194203{
    195     GET_PACKER_CONTEXT(pc);
     204    CR_GET_PACKER_CONTEXT(pc);
    196205    unsigned char *data_ptr;
    197206    int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(location)+sizeof(count) + 4*count*sizeof(*value);
    198207
    199     GET_BUFFERED_POINTER(pc, packet_length);
     208    CR_GET_BUFFERED_POINTER(pc, packet_length);
    200209    WRITE_DATA_AI(int, packet_length);
    201210    WRITE_DATA_AI(GLenum, CR_UNIFORM4IV_EXTEND_OPCODE);
     
    204213    crMemcpy(data_ptr, value, 4*count*sizeof(*value));
    205214    WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
     215    CR_UNLOCK_PACKER_CONTEXT(pc);
    206216}
    207217
    208218void PACK_APIENTRY crPackUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
    209219{
    210     GET_PACKER_CONTEXT(pc);
     220    CR_GET_PACKER_CONTEXT(pc);
    211221    unsigned char *data_ptr;
    212222    int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(location)+sizeof(count)+sizeof(transpose) + 2*2*count*sizeof(*value);
    213223
    214     GET_BUFFERED_POINTER(pc, packet_length);
     224    CR_GET_BUFFERED_POINTER(pc, packet_length);
    215225    WRITE_DATA_AI(int, packet_length);
    216226    WRITE_DATA_AI(GLenum, CR_UNIFORMMATRIX2FV_EXTEND_OPCODE);
     
    220230    crMemcpy(data_ptr, value, 2*2*count*sizeof(*value));
    221231    WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
     232    CR_UNLOCK_PACKER_CONTEXT(pc);
    222233}
    223234
    224235void PACK_APIENTRY crPackUniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
    225236{
    226     GET_PACKER_CONTEXT(pc);
     237    CR_GET_PACKER_CONTEXT(pc);
    227238    unsigned char *data_ptr;
    228239    int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(location)+sizeof(count)+sizeof(transpose) + 3*3*count*sizeof(*value);
    229240
    230     GET_BUFFERED_POINTER(pc, packet_length);
     241    CR_GET_BUFFERED_POINTER(pc, packet_length);
    231242    WRITE_DATA_AI(int, packet_length);
    232243    WRITE_DATA_AI(GLenum, CR_UNIFORMMATRIX3FV_EXTEND_OPCODE);
     
    236247    crMemcpy(data_ptr, value, 3*3*count*sizeof(*value));
    237248    WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
     249    CR_UNLOCK_PACKER_CONTEXT(pc);
    238250}
    239251
    240252void PACK_APIENTRY crPackUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
    241253{
    242     GET_PACKER_CONTEXT(pc);
     254    CR_GET_PACKER_CONTEXT(pc);
    243255    unsigned char *data_ptr;
    244256    int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(location)+sizeof(count)+sizeof(transpose) + 4*4*count*sizeof(*value);
    245257
    246     GET_BUFFERED_POINTER(pc, packet_length);
     258    CR_GET_BUFFERED_POINTER(pc, packet_length);
    247259    WRITE_DATA_AI(int, packet_length);
    248260    WRITE_DATA_AI(GLenum, CR_UNIFORMMATRIX4FV_EXTEND_OPCODE);
     
    252264    crMemcpy(data_ptr, value, 4*4*count*sizeof(*value));
    253265    WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
     266    CR_UNLOCK_PACKER_CONTEXT(pc);
    254267}
    255268
    256269void PACK_APIENTRY crPackUniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
    257270{
    258     GET_PACKER_CONTEXT(pc);
     271    CR_GET_PACKER_CONTEXT(pc);
    259272    unsigned char *data_ptr;
    260273    int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(location)+sizeof(count)+sizeof(transpose)
    261274                        + 2*3*count*sizeof(*value);
    262275
    263     GET_BUFFERED_POINTER(pc, packet_length);
     276    CR_GET_BUFFERED_POINTER(pc, packet_length);
    264277    WRITE_DATA_AI(int, packet_length);
    265278    WRITE_DATA_AI(GLenum, CR_UNIFORMMATRIX2X3FV_EXTEND_OPCODE);
     
    269282    crMemcpy(data_ptr, value, 2*3*count*sizeof(*value));
    270283    WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
     284    CR_UNLOCK_PACKER_CONTEXT(pc);
    271285}
    272286
    273287void PACK_APIENTRY crPackUniformMatrix3x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
    274288{
    275     GET_PACKER_CONTEXT(pc);
     289    CR_GET_PACKER_CONTEXT(pc);
    276290    unsigned char *data_ptr;
    277291    int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(location)+sizeof(count)+sizeof(transpose)
    278292                        + 3*2*count*sizeof(*value);
    279293
    280     GET_BUFFERED_POINTER(pc, packet_length);
     294    CR_GET_BUFFERED_POINTER(pc, packet_length);
    281295    WRITE_DATA_AI(int, packet_length);
    282296    WRITE_DATA_AI(GLenum, CR_UNIFORMMATRIX3X2FV_EXTEND_OPCODE);
     
    286300    crMemcpy(data_ptr, value, 3*2*count*sizeof(*value));
    287301    WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
     302    CR_UNLOCK_PACKER_CONTEXT(pc);
    288303}
    289304
    290305void PACK_APIENTRY crPackUniformMatrix2x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
    291306{
    292     GET_PACKER_CONTEXT(pc);
     307    CR_GET_PACKER_CONTEXT(pc);
    293308    unsigned char *data_ptr;
    294309    int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(location)+sizeof(count)+sizeof(transpose)
    295310                        + 2*4*count*sizeof(*value);
    296311
    297     GET_BUFFERED_POINTER(pc, packet_length);
     312    CR_GET_BUFFERED_POINTER(pc, packet_length);
    298313    WRITE_DATA_AI(int, packet_length);
    299314    WRITE_DATA_AI(GLenum, CR_UNIFORMMATRIX2X4FV_EXTEND_OPCODE);
     
    303318    crMemcpy(data_ptr, value, 2*4*count*sizeof(*value));
    304319    WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
     320    CR_UNLOCK_PACKER_CONTEXT(pc);
    305321}
    306322
    307323void PACK_APIENTRY crPackUniformMatrix4x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
    308324{
    309     GET_PACKER_CONTEXT(pc);
     325    CR_GET_PACKER_CONTEXT(pc);
    310326    unsigned char *data_ptr;
    311327    int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(location)+sizeof(count)+sizeof(transpose)
    312328                        + 4*2*count*sizeof(*value);
    313329
    314     GET_BUFFERED_POINTER(pc, packet_length);
     330    CR_GET_BUFFERED_POINTER(pc, packet_length);
    315331    WRITE_DATA_AI(int, packet_length);
    316332    WRITE_DATA_AI(GLenum, CR_UNIFORMMATRIX4X2FV_EXTEND_OPCODE);
     
    320336    crMemcpy(data_ptr, value, 4*2*count*sizeof(*value));
    321337    WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
     338    CR_UNLOCK_PACKER_CONTEXT(pc);
    322339}
    323340
    324341void PACK_APIENTRY crPackUniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
    325342{
    326     GET_PACKER_CONTEXT(pc);
     343    CR_GET_PACKER_CONTEXT(pc);
    327344    unsigned char *data_ptr;
    328345    int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(location)+sizeof(count)+sizeof(transpose)
    329346                        + 3*4*count*sizeof(*value);
    330347
    331     GET_BUFFERED_POINTER(pc, packet_length);
     348    CR_GET_BUFFERED_POINTER(pc, packet_length);
    332349    WRITE_DATA_AI(int, packet_length);
    333350    WRITE_DATA_AI(GLenum, CR_UNIFORMMATRIX3X4FV_EXTEND_OPCODE);
     
    337354    crMemcpy(data_ptr, value, 3*4*count*sizeof(*value));
    338355    WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
     356    CR_UNLOCK_PACKER_CONTEXT(pc);
    339357}
    340358
    341359void PACK_APIENTRY crPackUniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
    342360{
    343     GET_PACKER_CONTEXT(pc);
     361    CR_GET_PACKER_CONTEXT(pc);
    344362    unsigned char *data_ptr;
    345363    int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(location)+sizeof(count)+sizeof(transpose)
    346364                        + 4*3*count*sizeof(*value);
    347365
    348     GET_BUFFERED_POINTER(pc, packet_length);
     366    CR_GET_BUFFERED_POINTER(pc, packet_length);
    349367    WRITE_DATA_AI(int, packet_length);
    350368    WRITE_DATA_AI(GLenum, CR_UNIFORMMATRIX4X3FV_EXTEND_OPCODE);
     
    354372    crMemcpy(data_ptr, value, 4*3*count*sizeof(*value));
    355373    WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
     374    CR_UNLOCK_PACKER_CONTEXT(pc);
    356375}
    357376
    358377void PACK_APIENTRY crPackDrawBuffers(GLsizei n, const GLenum *bufs)
    359378{
    360     GET_PACKER_CONTEXT(pc);
     379    CR_GET_PACKER_CONTEXT(pc);
    361380    unsigned char *data_ptr;
    362381    int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(n) + n*sizeof(*bufs);
    363382
    364     GET_BUFFERED_POINTER(pc, packet_length);
     383    CR_GET_BUFFERED_POINTER(pc, packet_length);
    365384    WRITE_DATA_AI(int, packet_length);
    366385    WRITE_DATA_AI(GLenum, CR_DRAWBUFFERS_EXTEND_OPCODE);
     
    368387    crMemcpy(data_ptr, bufs, n*sizeof(*bufs));
    369388    WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
     389    CR_UNLOCK_PACKER_CONTEXT(pc);
    370390}
    371391
     
    376396void PACK_APIENTRY crPackGetActiveAttrib(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, char * name, int * writeback)
    377397{
    378     GET_PACKER_CONTEXT(pc);
     398    CR_GET_PACKER_CONTEXT(pc);
    379399    unsigned char *data_ptr;
    380400    (void) pc;
     
    382402    (void) type;
    383403    (void) name;
    384     GET_BUFFERED_POINTER(pc, 36);
     404    CR_GET_BUFFERED_POINTER(pc, 36);
    385405    WRITE_DATA(0, GLint, 36);
    386406    WRITE_DATA(4, GLenum, CR_GETACTIVEATTRIB_EXTEND_OPCODE);
     
    391411    WRITE_NETWORK_POINTER(28, (void *) writeback);
    392412    WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
     413    CR_UNLOCK_PACKER_CONTEXT(pc);
    393414}
    394415
    395416void PACK_APIENTRY crPackGetActiveUniform(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, char * name, int * writeback)
    396417{
    397     GET_PACKER_CONTEXT(pc);
     418    CR_GET_PACKER_CONTEXT(pc);
    398419    unsigned char *data_ptr;
    399420    (void) pc;
     
    401422    (void) type;
    402423    (void) name;
    403     GET_BUFFERED_POINTER(pc, 36);
     424    CR_GET_BUFFERED_POINTER(pc, 36);
    404425    WRITE_DATA(0, GLint, 36);
    405426    WRITE_DATA(4, GLenum, CR_GETACTIVEUNIFORM_EXTEND_OPCODE);
     
    410431    WRITE_NETWORK_POINTER(28, (void *) writeback);
    411432    WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
     433    CR_UNLOCK_PACKER_CONTEXT(pc);
    412434}
    413435
    414436void PACK_APIENTRY crPackGetAttachedShaders(GLuint program, GLsizei maxCount, GLsizei * count, GLuint * shaders, int * writeback)
    415437{
    416     GET_PACKER_CONTEXT(pc);
     438    CR_GET_PACKER_CONTEXT(pc);
    417439    unsigned char *data_ptr;
    418440    (void) pc;
    419441    (void) shaders;
    420     GET_BUFFERED_POINTER(pc, 32);
     442    CR_GET_BUFFERED_POINTER(pc, 32);
    421443    WRITE_DATA(0, GLint, 32);
    422444    WRITE_DATA(4, GLenum, CR_GETATTACHEDSHADERS_EXTEND_OPCODE);
     
    426448    WRITE_NETWORK_POINTER(24, (void *) writeback);
    427449    WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
     450    CR_UNLOCK_PACKER_CONTEXT(pc);
    428451}
    429452
    430453void PACK_APIENTRY crPackGetAttachedObjectsARB(GLhandleARB containerObj, GLsizei maxCount, GLsizei * count, GLhandleARB * obj, int * writeback)
    431454{
    432         GET_PACKER_CONTEXT(pc);
     455        CR_GET_PACKER_CONTEXT(pc);
    433456        unsigned char *data_ptr;
    434457        (void) pc;
    435         GET_BUFFERED_POINTER(pc, 32);
     458        CR_GET_BUFFERED_POINTER(pc, 32);
    436459        WRITE_DATA(0, GLint, 32);
    437460        WRITE_DATA(4, GLenum, CR_GETATTACHEDOBJECTSARB_EXTEND_OPCODE);
     
    441464        WRITE_NETWORK_POINTER(24, (void *) writeback);
    442465        WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
     466    CR_UNLOCK_PACKER_CONTEXT(pc);
    443467}
    444468
    445469void PACK_APIENTRY crPackGetInfoLogARB(GLhandleARB obj, GLsizei maxLength, GLsizei * length, GLcharARB * infoLog, int * writeback)
    446470{
    447         GET_PACKER_CONTEXT(pc);
     471        CR_GET_PACKER_CONTEXT(pc);
    448472        unsigned char *data_ptr;
    449473        (void) pc;
    450         GET_BUFFERED_POINTER(pc, 32);
     474        CR_GET_BUFFERED_POINTER(pc, 32);
    451475        WRITE_DATA(0, GLint, 32);
    452476        WRITE_DATA(4, GLenum, CR_GETINFOLOGARB_EXTEND_OPCODE);
     
    456480        WRITE_NETWORK_POINTER(24, (void *) writeback);
    457481        WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
     482    CR_UNLOCK_PACKER_CONTEXT(pc);
    458483}
    459484
    460485void PACK_APIENTRY crPackGetProgramInfoLog(GLuint program, GLsizei bufSize, GLsizei * length, char * infoLog, int * writeback)
    461486{
    462     GET_PACKER_CONTEXT(pc);
     487    CR_GET_PACKER_CONTEXT(pc);
    463488    unsigned char *data_ptr;
    464489    (void) pc;
    465490    (void) infoLog;
    466     GET_BUFFERED_POINTER(pc, 32);
     491    CR_GET_BUFFERED_POINTER(pc, 32);
    467492    WRITE_DATA(0, GLint, 32);
    468493    WRITE_DATA(4, GLenum, CR_GETPROGRAMINFOLOG_EXTEND_OPCODE);
     
    472497    WRITE_NETWORK_POINTER(24, (void *) writeback);
    473498    WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
     499    CR_UNLOCK_PACKER_CONTEXT(pc);
    474500}
    475501
    476502void PACK_APIENTRY crPackGetShaderInfoLog(GLuint shader, GLsizei bufSize, GLsizei * length, char * infoLog, int * writeback)
    477503{
    478     GET_PACKER_CONTEXT(pc);
     504    CR_GET_PACKER_CONTEXT(pc);
    479505    unsigned char *data_ptr;
    480506    (void) pc;
    481507    (void) infoLog;
    482     GET_BUFFERED_POINTER(pc, 32);
     508    CR_GET_BUFFERED_POINTER(pc, 32);
    483509    WRITE_DATA(0, GLint, 32);
    484510    WRITE_DATA(4, GLenum, CR_GETSHADERINFOLOG_EXTEND_OPCODE);
     
    488514    WRITE_NETWORK_POINTER(24, (void *) writeback);
    489515    WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
     516    CR_UNLOCK_PACKER_CONTEXT(pc);
    490517}
    491518
    492519void PACK_APIENTRY crPackGetShaderSource(GLuint shader, GLsizei bufSize, GLsizei * length, char * source, int * writeback)
    493520{
    494     GET_PACKER_CONTEXT(pc);
     521    CR_GET_PACKER_CONTEXT(pc);
    495522    unsigned char *data_ptr;
    496523    (void) pc;
    497524    (void) source;
    498     GET_BUFFERED_POINTER(pc, 32);
     525    CR_GET_BUFFERED_POINTER(pc, 32);
    499526    WRITE_DATA(0, GLint, 32);
    500527    WRITE_DATA(4, GLenum, CR_GETSHADERSOURCE_EXTEND_OPCODE);
     
    504531    WRITE_NETWORK_POINTER(24, (void *) writeback);
    505532    WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
     533    CR_UNLOCK_PACKER_CONTEXT(pc);
    506534}
    507535
    508536void PACK_APIENTRY crPackGetUniformsLocations(GLuint program, GLsizei maxcbData, GLsizei * cbData, GLvoid * pData, int * writeback)
    509537{
    510         GET_PACKER_CONTEXT(pc);
     538        CR_GET_PACKER_CONTEXT(pc);
    511539    unsigned char *data_ptr;
    512540    (void) pData;
    513     GET_BUFFERED_POINTER(pc, 32);
     541    CR_GET_BUFFERED_POINTER(pc, 32);
    514542    WRITE_DATA(0, GLint, 32);
    515543    WRITE_DATA(4, GLenum, CR_GETUNIFORMSLOCATIONS_EXTEND_OPCODE);
     
    519547    WRITE_NETWORK_POINTER(24, (void *) writeback);
    520548    WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
     549    CR_UNLOCK_PACKER_CONTEXT(pc);
    521550}
    522551
    523552void PACK_APIENTRY crPackGetAttribLocation(GLuint program, const char * name, GLint * return_value, int * writeback)
    524553{
    525     GET_PACKER_CONTEXT(pc);
     554    CR_GET_PACKER_CONTEXT(pc);
    526555    unsigned char *data_ptr;
    527556    int cbName = crStrlen(name)+1;
    528557    int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(program)+cbName*sizeof(*name)+16;
    529558
    530     GET_BUFFERED_POINTER(pc, packet_length);
     559    CR_GET_BUFFERED_POINTER(pc, packet_length);
    531560    WRITE_DATA_AI(int, packet_length);
    532561    WRITE_DATA_AI(GLenum, CR_GETATTRIBLOCATION_EXTEND_OPCODE);
     
    537566    WRITE_NETWORK_POINTER(8, (void *) writeback);
    538567    WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
     568    CR_UNLOCK_PACKER_CONTEXT(pc);
    539569}
    540570
    541571void PACK_APIENTRY crPackGetUniformLocation(GLuint program, const char * name, GLint * return_value, int * writeback)
    542572{
    543     GET_PACKER_CONTEXT(pc);
     573    CR_GET_PACKER_CONTEXT(pc);
    544574    unsigned char *data_ptr;
    545575    int cbName = crStrlen(name)+1;
    546576    int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(program)+cbName*sizeof(*name)+16;
    547577
    548     GET_BUFFERED_POINTER(pc, packet_length);
     578    CR_GET_BUFFERED_POINTER(pc, packet_length);
    549579    WRITE_DATA_AI(int, packet_length);
    550580    WRITE_DATA_AI(GLenum, CR_GETUNIFORMLOCATION_EXTEND_OPCODE);
     
    555585    WRITE_NETWORK_POINTER(8, (void *) writeback);
    556586    WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
     587    CR_UNLOCK_PACKER_CONTEXT(pc);
    557588}
    558589
    559590void PACK_APIENTRY crPackBindAttribLocationSWAP(GLuint program, GLuint index, const char *name)
    560591{
    561     GET_PACKER_CONTEXT(pc);
     592    CR_GET_PACKER_CONTEXT(pc);
    562593    (void)program;
    563594    (void)index;
     
    569600void PACK_APIENTRY crPackShaderSourceSWAP(GLuint shader, GLsizei count, const char **string, const GLint *length)
    570601{
    571     GET_PACKER_CONTEXT(pc);
     602    CR_GET_PACKER_CONTEXT(pc);
    572603    (void)shader;
    573604    (void)count;
     
    580611void PACK_APIENTRY crPackUniform1fvSWAP(GLint location, GLsizei count, const GLfloat *value)
    581612{
    582     GET_PACKER_CONTEXT(pc);
     613    CR_GET_PACKER_CONTEXT(pc);
    583614    (void)location;
    584615    (void)count;
     
    591622void PACK_APIENTRY crPackUniform1ivSWAP(GLint location, GLsizei count, const GLint *value)
    592623{
    593     GET_PACKER_CONTEXT(pc);
     624    CR_GET_PACKER_CONTEXT(pc);
    594625    (void)location;
    595626    (void)count;
     
    601632void PACK_APIENTRY crPackUniform2fvSWAP(GLint location, GLsizei count, const GLfloat *value)
    602633{
    603     GET_PACKER_CONTEXT(pc);
     634    CR_GET_PACKER_CONTEXT(pc);
    604635    (void)location;
    605636    (void)count;
     
    611642void PACK_APIENTRY crPackUniform2ivSWAP(GLint location, GLsizei count, const GLint * value)
    612643{
    613     GET_PACKER_CONTEXT(pc);
     644    CR_GET_PACKER_CONTEXT(pc);
    614645    (void)location;
    615646    (void)count;
     
    621652void PACK_APIENTRY crPackUniform3fvSWAP(GLint location, GLsizei count, const GLfloat *value)
    622653{
    623     GET_PACKER_CONTEXT(pc);
     654    CR_GET_PACKER_CONTEXT(pc);
    624655    (void)location;
    625656    (void)count;
     
    631662void PACK_APIENTRY crPackUniform3ivSWAP(GLint location, GLsizei count, const GLint *value)
    632663{
    633     GET_PACKER_CONTEXT(pc);
     664    CR_GET_PACKER_CONTEXT(pc);
    634665    (void)location;
    635666    (void)count;
     
    641672void PACK_APIENTRY crPackUniform4fvSWAP(GLint location, GLsizei count, const GLfloat *value)
    642673{
    643     GET_PACKER_CONTEXT(pc);
     674    CR_GET_PACKER_CONTEXT(pc);
    644675    (void)location;
    645676    (void)count;
     
    651682void PACK_APIENTRY crPackUniform4ivSWAP(GLint location, GLsizei count, const GLint *value)
    652683{
    653     GET_PACKER_CONTEXT(pc);
     684    CR_GET_PACKER_CONTEXT(pc);
    654685    (void)location;
    655686    (void)count;
     
    661692void PACK_APIENTRY crPackUniformMatrix2fvSWAP(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
    662693{
    663     GET_PACKER_CONTEXT(pc);
     694    CR_GET_PACKER_CONTEXT(pc);
    664695    (void)location;
    665696    (void)count;
     
    672703void PACK_APIENTRY crPackUniformMatrix3fvSWAP(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
    673704{
    674     GET_PACKER_CONTEXT(pc);
     705    CR_GET_PACKER_CONTEXT(pc);
    675706    (void)location;
    676707    (void)count;
     
    683714void PACK_APIENTRY crPackUniformMatrix4fvSWAP(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
    684715{
    685     GET_PACKER_CONTEXT(pc);
     716    CR_GET_PACKER_CONTEXT(pc);
    686717    (void)location;
    687718    (void)count;
     
    694725void PACK_APIENTRY crPackUniformMatrix2x3fvSWAP(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
    695726{
    696     GET_PACKER_CONTEXT(pc);
     727    CR_GET_PACKER_CONTEXT(pc);
    697728    (void)location;
    698729    (void)count;
     
    705736void PACK_APIENTRY crPackUniformMatrix3x2fvSWAP(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
    706737{
    707     GET_PACKER_CONTEXT(pc);
     738    CR_GET_PACKER_CONTEXT(pc);
    708739    (void)location;
    709740    (void)count;
     
    716747void PACK_APIENTRY crPackUniformMatrix2x4fvSWAP(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
    717748{
    718     GET_PACKER_CONTEXT(pc);
     749    CR_GET_PACKER_CONTEXT(pc);
    719750    (void)location;
    720751    (void)count;
     
    727758void PACK_APIENTRY crPackUniformMatrix4x2fvSWAP(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
    728759{
    729     GET_PACKER_CONTEXT(pc);
     760    CR_GET_PACKER_CONTEXT(pc);
    730761    (void)location;
    731762    (void)count;
     
    738769void PACK_APIENTRY crPackUniformMatrix3x4fvSWAP(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
    739770{
    740     GET_PACKER_CONTEXT(pc);
     771    CR_GET_PACKER_CONTEXT(pc);
    741772    (void)location;
    742773    (void)count;
     
    749780void PACK_APIENTRY crPackUniformMatrix4x3fvSWAP(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
    750781{
    751     GET_PACKER_CONTEXT(pc);
     782    CR_GET_PACKER_CONTEXT(pc);
    752783    (void)location;
    753784    (void)count;
     
    760791void PACK_APIENTRY crPackDrawBuffersSWAP(GLsizei n, const GLenum *bufs)
    761792{
    762     GET_PACKER_CONTEXT(pc);
     793    CR_GET_PACKER_CONTEXT(pc);
    763794    (void)n;
    764795    (void)bufs;
     
    769800void PACK_APIENTRY crPackGetAttribLocationSWAP(GLuint program, const char * name, GLint * return_value, int * writeback)
    770801{
    771     GET_PACKER_CONTEXT(pc);
     802    CR_GET_PACKER_CONTEXT(pc);
    772803    (void)program;
    773804    (void)name;
     
    780811void PACK_APIENTRY crPackGetUniformLocationSWAP(GLuint program, const char * name, GLint * return_value, int * writeback)
    781812{
    782     GET_PACKER_CONTEXT(pc);
     813    CR_GET_PACKER_CONTEXT(pc);
    783814    (void)program;
    784815    (void)name;
  • trunk/src/VBox/GuestHost/OpenGL/packer/pack_stipple.c

    r27983 r33475  
    1212void PACK_APIENTRY crPackPolygonStipple( const GLubyte *mask )
    1313{
    14     GET_PACKER_CONTEXT(pc);
     14    CR_GET_PACKER_CONTEXT(pc);
    1515    unsigned char *data_ptr;
    1616    int nodata = crStateIsBufferBound(GL_PIXEL_UNPACK_BUFFER_ARB);
     
    2222        packet_length += 32*32/8;
    2323
    24     GET_BUFFERED_POINTER(pc, packet_length );
     24    CR_GET_BUFFERED_POINTER(pc, packet_length );
    2525    WRITE_DATA_AI(int, nodata);
    2626    if (nodata)
     
    3333    }
    3434    WRITE_OPCODE( pc, CR_POLYGONSTIPPLE_OPCODE );
     35    CR_UNLOCK_PACKER_CONTEXT(pc);
    3536}
  • trunk/src/VBox/GuestHost/OpenGL/packer/pack_swap_lists.c

    r33457 r33475  
    8787void PACK_APIENTRY crPackNewListSWAP( GLuint list, GLenum mode )
    8888{
    89     GET_PACKER_CONTEXT(pc);
     89    CR_GET_PACKER_CONTEXT(pc);
    9090    unsigned char *data_ptr;
    9191    (void) pc;
    92     GET_BUFFERED_POINTER( pc, 16 );
     92    CR_GET_BUFFERED_POINTER( pc, 16 );
    9393    WRITE_DATA( 0, GLint, SWAP32(16) );
    9494    WRITE_DATA( 4, GLenum, SWAP32(CR_NEWLIST_EXTEND_OPCODE) );
     
    9898    pc->buffer.in_List = GL_TRUE;
    9999    pc->buffer.holds_List = GL_TRUE;
     100    CR_UNLOCK_PACKER_CONTEXT(pc);
    100101}
    101102
     
    103104void PACK_APIENTRY crPackEndListSWAP( void )
    104105{
    105     GET_PACKER_CONTEXT(pc);
     106    CR_GET_PACKER_CONTEXT(pc);
    106107    unsigned char *data_ptr;
    107108    (void) pc;
    108     GET_BUFFERED_POINTER( pc, 8 );
     109    CR_GET_BUFFERED_POINTER( pc, 8 );
    109110    WRITE_DATA( 0, GLint, SWAP32(8) );
    110111    WRITE_DATA( 4, GLenum, SWAP32(CR_ENDLIST_EXTEND_OPCODE) );
    111112    WRITE_OPCODE( pc, CR_EXTEND_OPCODE );
    112113    pc->buffer.in_List = GL_FALSE;
     114    CR_UNLOCK_PACKER_CONTEXT(pc);
    113115}
  • trunk/src/VBox/GuestHost/OpenGL/packer/pack_swap_texture.c

    r33457 r33475  
    285285static void __handleTexEnvData( GLenum target, GLenum pname, const GLfloat *params )
    286286{
    287     GET_PACKER_CONTEXT(pc);
     287    CR_GET_PACKER_CONTEXT(pc);
    288288    unsigned char *data_ptr;
    289289    int num_params;
     
    303303    packet_length += num_params*sizeof(*params);
    304304
    305     GET_BUFFERED_POINTER(pc, packet_length );
     305    CR_GET_BUFFERED_POINTER(pc, packet_length );
    306306    WRITE_DATA( 0, int, SWAP32(packet_length) );
    307307    WRITE_DATA( sizeof( int ) + 0, GLenum, SWAP32(target) );
     
    317317        const GLfloat *params )
    318318{
    319     GET_PACKER_CONTEXT(pc);
     319    CR_GET_PACKER_CONTEXT(pc);
    320320    __handleTexEnvData( target, pname, params );
    321321    WRITE_OPCODE( pc, CR_TEXENVFV_OPCODE );
     322    CR_UNLOCK_PACKER_CONTEXT(pc);
    322323}
    323324
     
    326327{
    327328    /* floats and ints are the same size, so the packing should be the same */
    328     GET_PACKER_CONTEXT(pc);
     329    CR_GET_PACKER_CONTEXT(pc);
    329330    __handleTexEnvData( target, pname, (const GLfloat *) params );
    330331    WRITE_OPCODE( pc, CR_TEXENVIV_OPCODE );
     332    CR_UNLOCK_PACKER_CONTEXT(pc);
    331333}
    332334
     
    370372        int sizeof_param, const GLvoid *params )
    371373{
    372     GET_PACKER_CONTEXT(pc);
     374    CR_GET_PACKER_CONTEXT(pc);
    373375    unsigned char *data_ptr;
    374376    int packet_length = sizeof( int ) + sizeof( coord ) + sizeof( pname );
     
    381383    packet_length += num_params * sizeof_param;
    382384   
    383     GET_BUFFERED_POINTER(pc, packet_length );
     385    CR_GET_BUFFERED_POINTER(pc, packet_length );
    384386    WRITE_DATA( 0, int, SWAP32(packet_length) );
    385387    WRITE_DATA( sizeof( int ) + 0, GLenum, SWAP32(coord) );
     
    394396        const GLdouble *params )
    395397{
    396     GET_PACKER_CONTEXT(pc);
     398    CR_GET_PACKER_CONTEXT(pc);
    397399    __handleTexGenData( coord, pname, sizeof( *params ), params );
    398400    WRITE_OPCODE( pc, CR_TEXGENDV_OPCODE );
     401    CR_UNLOCK_PACKER_CONTEXT(pc);
    399402}
    400403
     
    402405        const GLfloat *params )
    403406{
    404     GET_PACKER_CONTEXT(pc);
     407    CR_GET_PACKER_CONTEXT(pc);
    405408    __handleTexGenData( coord, pname, sizeof( *params ), params );
    406409    WRITE_OPCODE( pc, CR_TEXGENFV_OPCODE );
     410    CR_UNLOCK_PACKER_CONTEXT(pc);
    407411}
    408412
     
    410414        const GLint *params )
    411415{
    412     GET_PACKER_CONTEXT(pc);
     416    CR_GET_PACKER_CONTEXT(pc);
    413417    __handleTexGenData( coord, pname, sizeof( *params ), params );
    414418    WRITE_OPCODE( pc, CR_TEXGENIV_OPCODE );
     419    CR_UNLOCK_PACKER_CONTEXT(pc);
    415420}
    416421
     
    432437static GLboolean __handleTexParameterData( GLenum target, GLenum pname, const GLfloat *params )
    433438{
    434     GET_PACKER_CONTEXT(pc);
     439    CR_GET_PACKER_CONTEXT(pc);
    435440    unsigned char *data_ptr;
    436441    int packet_length = sizeof( int ) + sizeof( target ) + sizeof( pname );
     
    495500    packet_length += num_params * sizeof(*params);
    496501
    497     GET_BUFFERED_POINTER(pc, packet_length );
     502    CR_GET_BUFFERED_POINTER(pc, packet_length );
    498503    WRITE_DATA( 0, int, SWAP32(packet_length) );
    499504    WRITE_DATA( sizeof( int ) + 0, GLenum, SWAP32(target) );
     
    509514        const GLfloat *params )
    510515{
    511     GET_PACKER_CONTEXT(pc);
     516    CR_GET_PACKER_CONTEXT(pc);
    512517    if (__handleTexParameterData( target, pname, params ))
    513518        WRITE_OPCODE( pc, CR_TEXPARAMETERFV_OPCODE );
     519    CR_UNLOCK_PACKER_CONTEXT(pc);
    514520}
    515521
     
    517523        const GLint *params )
    518524{
    519     GET_PACKER_CONTEXT(pc);
     525    CR_GET_PACKER_CONTEXT(pc);
    520526    if (__handleTexParameterData( target, pname, (GLfloat *) params ))
    521527        WRITE_OPCODE( pc, CR_TEXPARAMETERIV_OPCODE );
     528    CR_UNLOCK_PACKER_CONTEXT(pc);
    522529}
    523530
     
    654661void PACK_APIENTRY crPackAreTexturesResidentSWAP( GLsizei n, const GLuint *textures, GLboolean *residences, GLboolean *return_val, int *writeback )
    655662{
    656     GET_PACKER_CONTEXT(pc);
     663    CR_GET_PACKER_CONTEXT(pc);
    657664    unsigned char *data_ptr;
    658665    int packet_length;
     
    666673        8 + 8 + 8;               /* return pointers */
    667674
    668     GET_BUFFERED_POINTER(pc, packet_length);
     675    CR_GET_BUFFERED_POINTER(pc, packet_length);
    669676    WRITE_DATA( 0, int, SWAP32(packet_length) );
    670677    WRITE_DATA( sizeof( int ) + 0, GLenum, SWAP32(CR_ARETEXTURESRESIDENT_EXTEND_OPCODE) );
     
    678685    WRITE_NETWORK_POINTER( sizeof( int ) + 24 + n*sizeof( *textures ), (void *) writeback );
    679686    WRITE_OPCODE( pc, CR_EXTEND_OPCODE );
     687    CR_UNLOCK_PACKER_CONTEXT(pc);
    680688}
    681689
     
    963971void PACK_APIENTRY crPackGetCompressedTexImageARBSWAP( GLenum target, GLint level, GLvoid *img, int *writeback )
    964972{
    965     GET_PACKER_CONTEXT(pc);
     973    CR_GET_PACKER_CONTEXT(pc);
    966974    crError ( "GetCompressedTexImageARB needs to be special cased!");
    967975    (void) pc;
  • trunk/src/VBox/GuestHost/OpenGL/packer/pack_texture.c

    r27983 r33475  
    298298__handleTexEnvData(GLenum target, GLenum pname, const GLfloat * params)
    299299{
    300     GET_PACKER_CONTEXT(pc);
     300    CR_GET_PACKER_CONTEXT(pc);
    301301    unsigned char *data_ptr;
    302302    int params_length;
     
    318318    packet_length += params_length;
    319319
    320     GET_BUFFERED_POINTER(pc, packet_length);
     320    CR_GET_BUFFERED_POINTER(pc, packet_length);
    321321    WRITE_DATA(0, int, packet_length);
    322322    WRITE_DATA(sizeof(int) + 0, GLenum, target);
     
    329329crPackTexEnvfv(GLenum target, GLenum pname, const GLfloat * params)
    330330{
    331     GET_PACKER_CONTEXT(pc);
     331    CR_GET_PACKER_CONTEXT(pc);
    332332    __handleTexEnvData(target, pname, params);
    333333    WRITE_OPCODE(pc, CR_TEXENVFV_OPCODE);
     334    CR_UNLOCK_PACKER_CONTEXT(pc);
    334335}
    335336
     
    338339{
    339340    /* floats and ints are the same size, so the packing should be the same */
    340     GET_PACKER_CONTEXT(pc);
     341    CR_GET_PACKER_CONTEXT(pc);
    341342    __handleTexEnvData(target, pname, (const GLfloat *) params);
    342343    WRITE_OPCODE(pc, CR_TEXENVIV_OPCODE);
     344    CR_UNLOCK_PACKER_CONTEXT(pc);
    343345}
    344346
     
    380382                                     int sizeof_param, const GLvoid * params)
    381383{
    382     GET_PACKER_CONTEXT(pc);
     384    CR_GET_PACKER_CONTEXT(pc);
    383385    unsigned char *data_ptr;
    384386    int packet_length =
     
    391393    }
    392394
    393     GET_BUFFERED_POINTER(pc, packet_length);
     395    CR_GET_BUFFERED_POINTER(pc, packet_length);
    394396    WRITE_DATA(0, int, packet_length);
    395397    WRITE_DATA(sizeof(int) + 0, GLenum, coord);
     
    401403crPackTexGendv(GLenum coord, GLenum pname, const GLdouble * params)
    402404{
    403     GET_PACKER_CONTEXT(pc);
     405    CR_GET_PACKER_CONTEXT(pc);
    404406    __handleTexGenData(coord, pname, sizeof(*params), params);
    405407    WRITE_OPCODE(pc, CR_TEXGENDV_OPCODE);
     408    CR_UNLOCK_PACKER_CONTEXT(pc);
    406409}
    407410
     
    409412crPackTexGenfv(GLenum coord, GLenum pname, const GLfloat * params)
    410413{
    411     GET_PACKER_CONTEXT(pc);
     414    CR_GET_PACKER_CONTEXT(pc);
    412415    __handleTexGenData(coord, pname, sizeof(*params), params);
    413416    WRITE_OPCODE(pc, CR_TEXGENFV_OPCODE);
     417    CR_UNLOCK_PACKER_CONTEXT(pc);
    414418}
    415419
     
    417421crPackTexGeniv(GLenum coord, GLenum pname, const GLint * params)
    418422{
    419     GET_PACKER_CONTEXT(pc);
     423    CR_GET_PACKER_CONTEXT(pc);
    420424    __handleTexGenData(coord, pname, sizeof(*params), params);
    421425    WRITE_OPCODE(pc, CR_TEXGENIV_OPCODE);
     426    CR_UNLOCK_PACKER_CONTEXT(pc);
    422427}
    423428
     
    443448__handleTexParameterData(GLenum target, GLenum pname, const GLfloat * params)
    444449{
    445     GET_PACKER_CONTEXT(pc);
     450    CR_GET_PACKER_CONTEXT(pc);
    446451    unsigned char *data_ptr;
    447452    int packet_length = sizeof(int) + sizeof(target) + sizeof(pname);
     
    504509    packet_length += num_params * sizeof(*params);
    505510
    506     GET_BUFFERED_POINTER(pc, packet_length);
     511    CR_GET_BUFFERED_POINTER(pc, packet_length);
    507512    WRITE_DATA(0, int, packet_length);
    508513    WRITE_DATA(sizeof(int) + 0, GLenum, target);
     
    515520crPackTexParameterfv(GLenum target, GLenum pname, const GLfloat * params)
    516521{
    517     GET_PACKER_CONTEXT(pc);
     522    CR_GET_PACKER_CONTEXT(pc);
    518523    if (__handleTexParameterData(target, pname, params))
    519524        WRITE_OPCODE(pc, CR_TEXPARAMETERFV_OPCODE);
     525    CR_UNLOCK_PACKER_CONTEXT(pc);
    520526}
    521527
     
    523529crPackTexParameteriv(GLenum target, GLenum pname, const GLint * params)
    524530{
    525     GET_PACKER_CONTEXT(pc);
     531    CR_GET_PACKER_CONTEXT(pc);
    526532    if (__handleTexParameterData(target, pname, (GLfloat *) params))
    527533        WRITE_OPCODE(pc, CR_TEXPARAMETERIV_OPCODE);
     534    CR_UNLOCK_PACKER_CONTEXT(pc);
    528535}
    529536
     
    688695                                                    int *writeback)
    689696{
    690     GET_PACKER_CONTEXT(pc);
     697    CR_GET_PACKER_CONTEXT(pc);
    691698    unsigned char *data_ptr;
    692699    int packet_length;
     
    700707        8 + 8;
    701708
    702     GET_BUFFERED_POINTER(pc, packet_length);
     709    CR_GET_BUFFERED_POINTER(pc, packet_length);
    703710    WRITE_DATA(0, int, packet_length);
    704711    WRITE_DATA(4, GLenum, CR_ARETEXTURESRESIDENT_EXTEND_OPCODE);
     
    708715    WRITE_NETWORK_POINTER(20 + n * sizeof(*textures), (void *) writeback);
    709716    WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
     717    CR_UNLOCK_PACKER_CONTEXT(pc);
    710718}
    711719
     
    10021010void PACK_APIENTRY crPackGetCompressedTexImageARB( GLenum target, GLint level, GLvoid *img, int *writeback )
    10031011{
    1004     GET_PACKER_CONTEXT(pc);
     1012    CR_GET_PACKER_CONTEXT(pc);
    10051013    int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(target)+sizeof(level)+2*8;
    10061014    unsigned char *data_ptr;
    1007     GET_BUFFERED_POINTER( pc, packet_length );
     1015    CR_GET_BUFFERED_POINTER( pc, packet_length );
    10081016
    10091017    WRITE_DATA_AI(int, packet_length);
     
    10141022    WRITE_NETWORK_POINTER(8, (void *) writeback );
    10151023    WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
    1016 }
     1024    CR_UNLOCK_PACKER_CONTEXT(pc);
     1025}
  • trunk/src/VBox/GuestHost/OpenGL/packer/pack_visibleregion.c

    r28800 r33475  
    2727    GLint i, size, cnt;
    2828
    29     GET_PACKER_CONTEXT(pc);
     29    CR_GET_PACKER_CONTEXT(pc);
    3030    unsigned char *data_ptr;
    3131    (void) pc;
    3232    size = 16 + cRects * 4 * sizeof(GLint);
    33     GET_BUFFERED_POINTER( pc, size );
     33    CR_GET_BUFFERED_POINTER( pc, size );
    3434    WRITE_DATA( 0, GLint, size );
    3535    WRITE_DATA( 4, GLenum, CR_WINDOWVISIBLEREGION_EXTEND_OPCODE );
     
    4747    }
    4848    WRITE_OPCODE( pc, CR_EXTEND_OPCODE );
     49    CR_UNLOCK_PACKER_CONTEXT(pc);
    4950}
    5051
  • trunk/src/VBox/GuestHost/OpenGL/packer/packer.py

    r20815 r33475  
    118118        print 'void PACK_APIENTRY crPack%s( %s )' % (func_name, apiutil.MakeDeclarationString(params))
    119119    print '{'
    120     print '\tGET_PACKER_CONTEXT(pc);'
     120    print '\tCR_GET_PACKER_CONTEXT(pc);'
    121121
    122122    # Save original function name
     
    168168
    169169    if packet_length == 0 and not is_extended:
    170         print "\tGET_BUFFERED_POINTER_NO_ARGS( pc );"
     170        print "\tCR_GET_BUFFERED_POINTER_NO_ARGS( pc );"
    171171    elif func_name[:9] == "Translate" or func_name[:5] == "Color":
    172172        # XXX WTF is the purpose of this?
    173173        if is_extended:
    174174            packet_length += 8
    175         print "\tGET_BUFFERED_POINTER_NO_BEGINEND_FLUSH( pc, %d );" % packet_length
     175        print "\tCR_GET_BUFFERED_POINTER_NO_BEGINEND_FLUSH( pc, %d, GL_TRUE );" % packet_length
    176176    else:
    177177        if is_extended:
    178178            packet_length += 8
    179         print "\tGET_BUFFERED_POINTER( pc, %d );" % packet_length
     179        print "\tCR_GET_BUFFERED_POINTER( pc, %d );" % packet_length
    180180    UpdateCurrentPointer( func_name )
    181181
     
    209209    else:
    210210        print "\tWRITE_OPCODE( pc, %s );" % apiutil.OpcodeName( func_name )
     211
     212    print '\tCR_UNLOCK_PACKER_CONTEXT(pc);'
    211213    print '}\n'
    212214
  • trunk/src/VBox/GuestHost/OpenGL/packer/packer_bbox.py

    r15532 r33475  
    167167
    168168
    169         print "\tGET_PACKER_CONTEXT(pc);"
     169        print "\tCR_GET_PACKER_CONTEXT(pc);"
    170170        print "\tunsigned char *data_ptr;"
    171171
     
    195195                        print "\tCREATE_%dD_FLOATS();" % num_coords
    196196
    197         print "\tGET_BUFFERED%s_POINTER( pc, %d );" % (countSuffix, packet_length)
     197        print "\tCR_GET_BUFFERED%s_POINTER( pc, %d );" % (countSuffix, packet_length)
    198198
    199199        # Bounding box code
     
    260260                else:
    261261                        print "\tWRITE_OPCODE( pc, %s );" % apiutil.OpcodeName( func_name )
     262
     263        print "\tCR_UNLOCK_PACKER_CONTEXT(pc);"
     264
    262265
    263266        print '}\n'
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