- Timestamp:
- Oct 26, 2010 5:23:54 PM (14 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 31 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_init.c
r20083 r33475 70 70 packSPUCleanup(void) 71 71 { 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 72 91 return 1; 73 92 } -
trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_net.c
r32499 r33475 120 120 CRPackBuffer *buf; 121 121 122 #ifdef CHROMIUM_THREADSAFE 122 123 crLockMutex(&_PackMutex); 124 #endif 123 125 124 126 /* we should _always_ pass a valid <arg> value */ 125 127 CRASSERT(thread); 128 #ifdef CHROMIUM_THREADSAFE 129 CR_LOCK_PACKER_CONTEXT(thread->packer); 130 #endif 126 131 ctx = thread->currentContext; 127 132 buf = &(thread->buffer); … … 145 150 crPackSetBuffer( thread->packer, buf ); 146 151 crPackResetPointers(thread->packer); 152 #ifdef CHROMIUM_THREADSAFE 153 CR_UNLOCK_PACKER_CONTEXT(thread->packer); 147 154 crUnlockMutex(&_PackMutex); 155 #endif 148 156 return; 149 157 } … … 173 181 crPackResetPointers(thread->packer); 174 182 183 #ifdef CHROMIUM_THREADSAFE 184 CR_UNLOCK_PACKER_CONTEXT(thread->packer); 175 185 crUnlockMutex(&_PackMutex); 186 #endif 176 187 } 177 188 -
trunk/src/VBox/GuestHost/OpenGL/include/cr_pack.h
r20183 r33475 67 67 int swapping; 68 68 CRPackBuffer *currentBuffer; 69 CRmutex mutex; 69 70 char *file; /**< for debugging only */ 70 71 int line; /**< for debugging only */ … … 73 74 74 75 extern DECLEXPORT(CRPackContext *) crPackNewContext(int swapping); 76 extern DECLEXPORT(void) crPackDeleteContext(CRPackContext *pc); 75 77 extern DECLEXPORT(void) crPackSetContext( CRPackContext *pc ); 76 78 extern DECLEXPORT(CRPackContext *) crPackGetContext( void ); … … 138 140 #ifdef CHROMIUM_THREADSAFE 139 141 extern 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)) 141 145 #else 142 146 extern 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) 144 150 #endif 145 151 … … 189 195 * Only flush if buffer is full. 190 196 */ 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); \ 201 208 } while (0) 202 209 … … 206 213 * no longer inside glBegin/glEnd. 207 214 */ 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 ); \ 211 219 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 ); \ 216 237 } while (0) 217 238 … … 220 241 * As above, but for vertex data between glBegin/End (counts vertices). 221 242 */ 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 ); \ 227 249 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); \ 232 254 } while (0) 233 255 … … 237 259 * as glFinish(). 238 260 */ 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 ); \ 241 263 WRITE_DATA( 0, GLuint, 0xdeadbeef ) 242 264 -
trunk/src/VBox/GuestHost/OpenGL/packer/pack_arrays.c
r22514 r33475 30 30 * Look at glgets regarding max vertices in arrays. 31 31 */ 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 ); 36 36 WRITE_DATA( 0, GLint, packet_length ); 37 37 WRITE_DATA( 4, GLenum, CR_VERTEXPOINTER_EXTEND_OPCODE ); … … 41 41 WRITE_DATA( 20, GLuint, (GLuint) ((uintptr_t) pointer) ); 42 42 WRITE_OPCODE( pc, CR_EXTEND_OPCODE ); 43 CR_UNLOCK_PACKER_CONTEXT(pc); 43 44 } 44 45 45 46 void PACK_APIENTRY crPackColorPointer( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) 46 47 { 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 ); 51 52 WRITE_DATA( 0, GLint, packet_length ); 52 53 WRITE_DATA( 4, GLenum, CR_COLORPOINTER_EXTEND_OPCODE ); … … 56 57 WRITE_DATA( 20, GLuint, (GLuint) ((uintptr_t) pointer) ); 57 58 WRITE_OPCODE( pc, CR_EXTEND_OPCODE ); 59 CR_UNLOCK_PACKER_CONTEXT(pc); 58 60 } 59 61 60 62 void PACK_APIENTRY crPackNormalPointer( GLenum type, GLsizei stride, const GLvoid *pointer ) 61 63 { 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 ); 66 68 WRITE_DATA( 0, GLint, packet_length ); 67 69 WRITE_DATA( 4, GLenum, CR_NORMALPOINTER_EXTEND_OPCODE ); … … 70 72 WRITE_DATA( 16, GLuint, (GLuint) ((uintptr_t) pointer) ); 71 73 WRITE_OPCODE( pc, CR_EXTEND_OPCODE ); 74 CR_UNLOCK_PACKER_CONTEXT(pc); 72 75 } 73 76 74 77 void PACK_APIENTRY crPackTexCoordPointer( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) 75 78 { 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 ); 80 83 WRITE_DATA( 0, GLint, packet_length ); 81 84 WRITE_DATA( 4, GLenum, CR_TEXCOORDPOINTER_EXTEND_OPCODE ); … … 85 88 WRITE_DATA( 20, GLuint, (GLuint) ((uintptr_t) pointer) ); 86 89 WRITE_OPCODE( pc, CR_EXTEND_OPCODE ); 90 CR_UNLOCK_PACKER_CONTEXT(pc); 87 91 } 88 92 89 93 void PACK_APIENTRY crPackEdgeFlagPointer( GLsizei stride, const GLvoid *pointer ) 90 94 { 91 GET_PACKER_CONTEXT(pc);95 CR_GET_PACKER_CONTEXT(pc); 92 96 unsigned char *data_ptr; 93 97 int packet_length = 16; 94 GET_BUFFERED_POINTER( pc, packet_length );98 CR_GET_BUFFERED_POINTER( pc, packet_length ); 95 99 WRITE_DATA( 0, GLint, packet_length ); 96 100 WRITE_DATA( 4, GLenum, CR_EDGEFLAGPOINTER_EXTEND_OPCODE ); … … 98 102 WRITE_DATA( 12, GLuint, (GLuint) ((uintptr_t) pointer) ); 99 103 WRITE_OPCODE( pc, CR_EXTEND_OPCODE ); 104 CR_UNLOCK_PACKER_CONTEXT(pc); 100 105 } 101 106 102 107 void PACK_APIENTRY crPackIndexPointer( GLenum type, GLsizei stride, const GLvoid *pointer ) 103 108 { 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 ); 108 113 WRITE_DATA( 0, GLint, packet_length ); 109 114 WRITE_DATA( 4, GLenum, CR_INDEXPOINTER_EXTEND_OPCODE ); … … 112 117 WRITE_DATA( 16, GLuint, (GLuint) ((uintptr_t) pointer) ); 113 118 WRITE_OPCODE( pc, CR_EXTEND_OPCODE ); 119 CR_UNLOCK_PACKER_CONTEXT(pc); 114 120 } 115 121 116 122 void PACK_APIENTRY crPackSecondaryColorPointerEXT( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) 117 123 { 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 ); 122 128 WRITE_DATA( 0, GLint, packet_length ); 123 129 WRITE_DATA( 4, GLenum, CR_SECONDARYCOLORPOINTEREXT_EXTEND_OPCODE ); … … 127 133 WRITE_DATA( 20, GLuint, (GLuint) ((uintptr_t) pointer) ); 128 134 WRITE_OPCODE( pc, CR_EXTEND_OPCODE ); 135 CR_UNLOCK_PACKER_CONTEXT(pc); 129 136 } 130 137 131 138 void PACK_APIENTRY crPackFogCoordPointerEXT( GLenum type, GLsizei stride, const GLvoid * pointer ) 132 139 { 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 ); 137 144 WRITE_DATA( 0, GLint, packet_length ); 138 145 WRITE_DATA( 4, GLenum, CR_FOGCOORDPOINTEREXT_EXTEND_OPCODE ); … … 141 148 WRITE_DATA( 16, GLuint, (GLuint) ((uintptr_t) pointer) ); 142 149 WRITE_OPCODE( pc, CR_EXTEND_OPCODE ); 150 CR_UNLOCK_PACKER_CONTEXT(pc); 143 151 } 144 152 145 153 void PACK_APIENTRY crPackVertexAttribPointerARB( GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer ) 146 154 { 147 GET_PACKER_CONTEXT(pc);155 CR_GET_PACKER_CONTEXT(pc); 148 156 unsigned char *data_ptr; 149 157 int packet_length = 32; 150 GET_BUFFERED_POINTER( pc, packet_length );158 CR_GET_BUFFERED_POINTER( pc, packet_length ); 151 159 WRITE_DATA( 0, GLint, packet_length ); 152 160 WRITE_DATA( 4, GLenum, CR_VERTEXATTRIBPOINTERARB_EXTEND_OPCODE ); … … 158 166 WRITE_DATA( 28, GLuint, (GLuint) ((uintptr_t) pointer) ); 159 167 WRITE_OPCODE( pc, CR_EXTEND_OPCODE ); 168 CR_UNLOCK_PACKER_CONTEXT(pc); 160 169 } 161 170 162 171 void PACK_APIENTRY crPackVertexAttribPointerNV( GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) 163 172 { 164 GET_PACKER_CONTEXT(pc);173 CR_GET_PACKER_CONTEXT(pc); 165 174 unsigned char *data_ptr; 166 175 int packet_length = 28; 167 GET_BUFFERED_POINTER( pc, packet_length );176 CR_GET_BUFFERED_POINTER( pc, packet_length ); 168 177 WRITE_DATA( 0, GLint, packet_length ); 169 178 WRITE_DATA( 4, GLenum, CR_VERTEXATTRIBPOINTERNV_EXTEND_OPCODE ); … … 174 183 WRITE_DATA( 24, GLuint, (GLuint) ((uintptr_t) pointer) ); 175 184 WRITE_OPCODE( pc, CR_EXTEND_OPCODE ); 185 CR_UNLOCK_PACKER_CONTEXT(pc); 176 186 } 177 187 178 188 void PACK_APIENTRY crPackInterleavedArrays( GLenum format, GLsizei stride, const GLvoid *pointer ) 179 189 { 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 ); 184 194 WRITE_DATA( 0, GLint, packet_length ); 185 195 WRITE_DATA( 4, GLenum, CR_INTERLEAVEDARRAYS_EXTEND_OPCODE ); … … 188 198 WRITE_DATA( 16, GLuint, (GLuint) ((uintptr_t) pointer) ); 189 199 WRITE_OPCODE( pc, CR_EXTEND_OPCODE ); 200 CR_UNLOCK_PACKER_CONTEXT(pc); 190 201 } 191 202 -
trunk/src/VBox/GuestHost/OpenGL/packer/pack_beginend.c
r33457 r33475 10 10 void PACK_APIENTRY crPackBegin( GLenum mode ) 11 11 { 12 GET_PACKER_CONTEXT(pc);12 CR_GET_PACKER_CONTEXT(pc); 13 13 unsigned char *data_ptr; 14 14 (void) pc; … … 20 20 pc->buffer.holds_BeginEnd = 1; 21 21 } 22 GET_BUFFERED_POINTER( pc, 4 );22 CR_GET_BUFFERED_POINTER( pc, 4 ); 23 23 pc->current.begin_data = data_ptr; 24 24 pc->current.begin_op = pc->buffer.opcode_current; … … 26 26 WRITE_DATA( 0, GLenum, mode ); 27 27 WRITE_OPCODE( pc, CR_BEGIN_OPCODE ); 28 CR_UNLOCK_PACKER_CONTEXT(pc); 28 29 } 29 30 30 31 void PACK_APIENTRY crPackBeginSWAP( GLenum mode ) 31 32 { 32 GET_PACKER_CONTEXT(pc);33 CR_GET_PACKER_CONTEXT(pc); 33 34 unsigned char *data_ptr; 34 35 (void) pc; … … 40 41 pc->buffer.holds_BeginEnd = 1; 41 42 } 42 GET_BUFFERED_POINTER( pc, 4 );43 CR_GET_BUFFERED_POINTER( pc, 4 ); 43 44 pc->current.begin_data = data_ptr; 44 45 pc->current.begin_op = pc->buffer.opcode_current; … … 46 47 WRITE_DATA( 0, GLenum, SWAP32(mode) ); 47 48 WRITE_OPCODE( pc, CR_BEGIN_OPCODE ); 49 CR_UNLOCK_PACKER_CONTEXT(pc); 48 50 } 49 51 50 52 void PACK_APIENTRY crPackEnd( void ) 51 53 { 52 GET_PACKER_CONTEXT(pc);54 CR_GET_PACKER_CONTEXT(pc); 53 55 unsigned char *data_ptr; 54 56 (void) pc; 55 GET_BUFFERED_POINTER_NO_ARGS( pc );57 CR_GET_BUFFERED_POINTER_NO_ARGS( pc ); 56 58 WRITE_OPCODE( pc, CR_END_OPCODE ); 57 59 pc->buffer.in_BeginEnd = 0; 60 CR_UNLOCK_PACKER_CONTEXT(pc); 58 61 } 59 62 60 63 void PACK_APIENTRY crPackEndSWAP( void ) 61 64 { 62 GET_PACKER_CONTEXT(pc);65 CR_GET_PACKER_CONTEXT(pc); 63 66 unsigned char *data_ptr; 64 67 (void) pc; 65 GET_BUFFERED_POINTER_NO_ARGS( pc );68 CR_GET_BUFFERED_POINTER_NO_ARGS( pc ); 66 69 WRITE_OPCODE( pc, CR_END_OPCODE ); 67 70 pc->buffer.in_BeginEnd = 0; 71 CR_UNLOCK_PACKER_CONTEXT(pc); 68 72 } 69 73 -
trunk/src/VBox/GuestHost/OpenGL/packer/pack_bounds.c
r33457 r33475 11 11 void PACK_APIENTRY crPackBoundsInfoCR( const CRrecti *bounds, const GLbyte *payload, GLint len, GLint num_opcodes ) 12 12 { 13 GET_PACKER_CONTEXT(pc);13 CR_GET_PACKER_CONTEXT(pc); 14 14 /* Don't get the buffered_ptr here because we've already 15 15 * verified that there's enough space for everything. */ 16 16 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; 20 25 21 26 WRITE_DATA( 0, int, total_len ); … … 42 47 WRITE_OPCODE( pc, CR_BOUNDSINFOCR_OPCODE ); 43 48 pc->buffer.data_current += 24 + len_aligned; 49 CR_UNLOCK_PACKER_CONTEXT(pc); 44 50 } -
trunk/src/VBox/GuestHost/OpenGL/packer/pack_buffer.c
r15532 r33475 259 259 const int num_data = crPackNumData(src); 260 260 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; 263 267 } 264 268 … … 267 271 { 268 272 const int len_aligned = (src->data_current - src->opcode_current - 1 + 3) & ~3; 269 GET_PACKER_CONTEXT(pc);273 CR_GET_PACKER_CONTEXT(pc); 270 274 /* 24 is the size of the bounds-info packet... */ 271 275 return crPackCanHoldOpcode( pc, 1, len_aligned + 24 ); … … 274 278 void crPackAppendBuffer( const CRPackBuffer *src ) 275 279 { 276 GET_PACKER_CONTEXT(pc);280 CR_GET_PACKER_CONTEXT(pc); 277 281 const int num_data = crPackNumData(src); 278 282 const int num_opcode = crPackNumOpcodes(src); … … 280 284 CRASSERT(num_data >= 0); 281 285 CRASSERT(num_opcode >= 0); 286 287 CR_LOCK_PACKER_CONTEXT(pc); 282 288 283 289 /* don't append onto ourself! */ … … 290 296 { 291 297 crWarning( "crPackAppendBuffer: overflowed the destination!" ); 298 CR_UNLOCK_PACKER_CONTEXT(pc); 292 299 return; 293 300 } 294 301 else 302 { 295 303 crError( "crPackAppendBuffer: overflowed the destination!" ); 304 CR_UNLOCK_PACKER_CONTEXT(pc); 305 } 296 306 } 297 307 … … 308 318 pc->buffer.in_BeginEnd = src->in_BeginEnd; 309 319 pc->buffer.holds_List |= src->holds_List; 320 CR_UNLOCK_PACKER_CONTEXT(pc); 310 321 } 311 322 … … 314 325 crPackAppendBoundedBuffer( const CRPackBuffer *src, const CRrecti *bounds ) 315 326 { 316 GET_PACKER_CONTEXT(pc);327 CR_GET_PACKER_CONTEXT(pc); 317 328 const GLbyte *payload = (const GLbyte *) src->opcode_current + 1; 318 329 const int num_opcodes = crPackNumOpcodes(src); … … 320 331 321 332 CRASSERT(pc); 333 CR_LOCK_PACKER_CONTEXT(pc); 322 334 CRASSERT(pc->currentBuffer); 323 335 CRASSERT(pc->currentBuffer != src); … … 332 344 { 333 345 crWarning( "crPackAppendBoundedBuffer: overflowed the destination!" ); 346 CR_UNLOCK_PACKER_CONTEXT(pc); 334 347 return; 335 348 } 336 349 else 350 { 337 351 crError( "crPackAppendBoundedBuffer: overflowed the destination!" ); 352 CR_UNLOCK_PACKER_CONTEXT(pc); 353 } 338 354 } 339 355 … … 346 362 pc->buffer.in_BeginEnd = src->in_BeginEnd; 347 363 pc->buffer.holds_List |= src->holds_List; 364 CR_UNLOCK_PACKER_CONTEXT(pc); 348 365 } 349 366 … … 361 378 void *crPackAlloc( unsigned int size ) 362 379 { 363 GET_PACKER_CONTEXT(pc);380 CR_GET_PACKER_CONTEXT(pc); 364 381 unsigned char *data_ptr; 365 382 366 383 /* include space for the length and make the payload word-aligned */ 367 384 size = ( size + sizeof(unsigned int) + 0x3 ) & ~0x3; 385 386 CR_LOCK_PACKER_CONTEXT(pc); 368 387 369 388 if ( crPackCanHoldOpcode( pc, 1, size ) ) 370 389 { 371 390 /* 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 */ 373 392 } 374 393 else … … 378 397 if ( crPackCanHoldOpcode( pc, 1, size ) ) 379 398 { 380 GET_BUFFERED_POINTER(pc, size ); /* NOTE: this sets data_ptr */399 CR_GET_BUFFERED_POINTER_NOLOCK(pc, size ); /* NOTE: this sets data_ptr */ 381 400 } 382 401 else … … 445 464 void crHugePacket( CROpcode opcode, void *packet ) 446 465 { 447 GET_PACKER_CONTEXT(pc);466 CR_GET_PACKER_CONTEXT(pc); 448 467 #ifndef CHROMIUM_THREADSAFE 449 468 CRASSERT(sanityCheckPointer == packet); … … 459 478 void crPackFree( void *packet ) 460 479 { 461 GET_PACKER_CONTEXT(pc); 480 CR_GET_PACKER_CONTEXT(pc); 481 462 482 if ( IS_BUFFERED( packet ) ) 483 { 484 CR_UNLOCK_PACKER_CONTEXT(pc); 463 485 return; 486 } 487 488 CR_UNLOCK_PACKER_CONTEXT(pc); 464 489 465 490 /* the pointer passed in doesn't include the space for the single -
trunk/src/VBox/GuestHost/OpenGL/packer/pack_bufferobject.c
r21423 r33475 88 88 crPackGetBufferSubDataARB( GLenum target, GLintptrARB offset, GLsizeiptrARB size, void * data, int * writeback ) 89 89 { 90 GET_PACKER_CONTEXT(pc);90 CR_GET_PACKER_CONTEXT(pc); 91 91 unsigned char *data_ptr; 92 92 (void) pc; 93 GET_BUFFERED_POINTER( pc, 36 );93 CR_GET_BUFFERED_POINTER( pc, 36 ); 94 94 WRITE_DATA( 0, GLint, 36 ); 95 95 WRITE_DATA( 4, GLenum, CR_GETBUFFERSUBDATAARB_EXTEND_OPCODE ); … … 100 100 WRITE_NETWORK_POINTER( 28, (void *) writeback ); 101 101 WRITE_OPCODE( pc, CR_EXTEND_OPCODE ); 102 CR_UNLOCK_PACKER_CONTEXT(pc); 102 103 } 103 104 -
trunk/src/VBox/GuestHost/OpenGL/packer/pack_clipplane.c
r33457 r33475 10 10 void PACK_APIENTRY crPackClipPlane( GLenum plane, const GLdouble *equation ) 11 11 { 12 GET_PACKER_CONTEXT(pc);12 CR_GET_PACKER_CONTEXT(pc); 13 13 unsigned char *data_ptr; 14 14 int packet_length = sizeof( plane ) + 4*sizeof(*equation); 15 GET_BUFFERED_POINTER(pc, packet_length );15 CR_GET_BUFFERED_POINTER(pc, packet_length ); 16 16 WRITE_DATA( 0, GLenum, plane ); 17 17 WRITE_DOUBLE( 4, equation[0] ); … … 20 20 WRITE_DOUBLE( 28, equation[3] ); 21 21 WRITE_OPCODE( pc, CR_CLIPPLANE_OPCODE ); 22 CR_UNLOCK_PACKER_CONTEXT(pc); 22 23 } -
trunk/src/VBox/GuestHost/OpenGL/packer/pack_context.c
r15532 r33475 22 22 { 23 23 char displayName[DISPLAY_NAME_LEN]; 24 GET_PACKER_CONTEXT(pc);24 CR_GET_PACKER_CONTEXT(pc); 25 25 unsigned char *data_ptr; 26 26 int len = DISPLAY_NAME_LEN + 32; … … 37 37 } 38 38 39 GET_BUFFERED_POINTER(pc, len);39 CR_GET_BUFFERED_POINTER(pc, len); 40 40 WRITE_DATA( 0, GLint, len ); 41 41 WRITE_DATA( 4, GLenum, CR_CREATECONTEXT_EXTEND_OPCODE ); … … 46 46 WRITE_NETWORK_POINTER( DISPLAY_NAME_LEN + 24, (void *) writeback ); 47 47 WRITE_OPCODE( pc, CR_EXTEND_OPCODE ); 48 CR_UNLOCK_PACKER_CONTEXT(pc); 48 49 } 49 50 … … 53 54 { 54 55 char displayName[DISPLAY_NAME_LEN]; 55 GET_PACKER_CONTEXT(pc);56 CR_GET_PACKER_CONTEXT(pc); 56 57 unsigned char *data_ptr; 57 58 int len = DISPLAY_NAME_LEN + 32; … … 68 69 } 69 70 70 GET_BUFFERED_POINTER(pc, len);71 CR_GET_BUFFERED_POINTER(pc, len); 71 72 WRITE_DATA( 0, GLint, SWAP32(len) ); 72 73 WRITE_DATA( 4, GLenum, SWAP32(CR_CREATECONTEXT_EXTEND_OPCODE) ); … … 77 78 WRITE_NETWORK_POINTER( DISPLAY_NAME_LEN + 24, (void *) writeback ); 78 79 WRITE_OPCODE( pc, CR_EXTEND_OPCODE ); 80 CR_UNLOCK_PACKER_CONTEXT(pc); 79 81 } 80 82 … … 83 85 { 84 86 char displayName[DISPLAY_NAME_LEN]; 85 GET_PACKER_CONTEXT(pc);87 CR_GET_PACKER_CONTEXT(pc); 86 88 unsigned char *data_ptr; 87 89 … … 97 99 } 98 100 99 GET_BUFFERED_POINTER(pc, DISPLAY_NAME_LEN + 28 );101 CR_GET_BUFFERED_POINTER(pc, DISPLAY_NAME_LEN + 28 ); 100 102 WRITE_DATA( 0, GLint, 28 ); 101 103 WRITE_DATA( 4, GLenum, CR_WINDOWCREATE_EXTEND_OPCODE ); … … 105 107 WRITE_NETWORK_POINTER( DISPLAY_NAME_LEN + 20, (void *) writeback ); 106 108 WRITE_OPCODE( pc, CR_EXTEND_OPCODE ); 109 CR_UNLOCK_PACKER_CONTEXT(pc); 107 110 } 108 111 … … 110 113 { 111 114 char displayName[DISPLAY_NAME_LEN]; 112 GET_PACKER_CONTEXT(pc);115 CR_GET_PACKER_CONTEXT(pc); 113 116 unsigned char *data_ptr; 114 117 … … 124 127 } 125 128 126 GET_BUFFERED_POINTER(pc, DISPLAY_NAME_LEN + 28 );129 CR_GET_BUFFERED_POINTER(pc, DISPLAY_NAME_LEN + 28 ); 127 130 WRITE_DATA( 0, GLint, SWAP32(28) ); 128 131 WRITE_DATA( 4, GLenum, SWAP32(CR_WINDOWCREATE_EXTEND_OPCODE) ); … … 132 135 WRITE_NETWORK_POINTER( DISPLAY_NAME_LEN + 20, (void *) writeback ); 133 136 WRITE_OPCODE( pc, CR_EXTEND_OPCODE ); 137 CR_UNLOCK_PACKER_CONTEXT(pc); 134 138 } -
trunk/src/VBox/GuestHost/OpenGL/packer/pack_current.py
r15532 r33475 25 25 void crPackOffsetCurrentPointers( int offset ) 26 26 { 27 GET_PACKER_CONTEXT(pc);27 CR_GET_PACKER_CONTEXT(pc); 28 28 GLnormal_p *normal = &(pc->current.c.normal); 29 29 GLcolor_p *color = &(pc->current.c.color); … … 60 60 void crPackNullCurrentPointers( void ) 61 61 { 62 GET_PACKER_CONTEXT(pc);62 CR_GET_PACKER_CONTEXT(pc); 63 63 CRCurrentStateAttr *c = &(pc->current.c); 64 64 """ -
trunk/src/VBox/GuestHost/OpenGL/packer/pack_error.c
r33457 r33475 27 27 void __PackError( int line, const char *file, GLenum error, const char *info) 28 28 { 29 GET_PACKER_CONTEXT(pc);29 CR_GET_PACKER_CONTEXT(pc); 30 30 31 31 if (pc->Error) -
trunk/src/VBox/GuestHost/OpenGL/packer/pack_fog.c
r33457 r33475 10 10 static GLboolean __handleFogData( GLenum pname, const GLfloat *params ) 11 11 { 12 GET_PACKER_CONTEXT(pc);12 CR_GET_PACKER_CONTEXT(pc); 13 13 int params_length = 0; 14 14 int packet_length = sizeof( int ) + sizeof( pname ); … … 39 39 packet_length += params_length; 40 40 41 GET_BUFFERED_POINTER(pc, packet_length );41 CR_GET_BUFFERED_POINTER(pc, packet_length ); 42 42 WRITE_DATA( 0, int, packet_length ); 43 43 WRITE_DATA( 4, GLenum, pname ); … … 54 54 void PACK_APIENTRY crPackFogfv(GLenum pname, const GLfloat *params) 55 55 { 56 GET_PACKER_CONTEXT(pc);56 CR_GET_PACKER_CONTEXT(pc); 57 57 if (__handleFogData( pname, params )) 58 58 WRITE_OPCODE( pc, CR_FOGFV_OPCODE ); 59 CR_UNLOCK_PACKER_CONTEXT(pc); 59 60 } 60 61 61 62 void PACK_APIENTRY crPackFogiv(GLenum pname, const GLint *params) 62 63 { 63 GET_PACKER_CONTEXT(pc);64 CR_GET_PACKER_CONTEXT(pc); 64 65 /* floats and ints are the same size, so the packing should be the same */ 65 66 if (__handleFogData( pname, (const GLfloat *) params )) 66 67 WRITE_OPCODE( pc, CR_FOGIV_OPCODE ); 68 CR_UNLOCK_PACKER_CONTEXT(pc); 67 69 } -
trunk/src/VBox/GuestHost/OpenGL/packer/pack_init.c
r15532 r33475 24 24 if (!pc) 25 25 return NULL; 26 crInitMutex(&pc->mutex); 26 27 #else 27 28 GET_PACKER_CONTEXT(pc); … … 35 36 } 36 37 38 void crPackDeleteContext(CRPackContext *pc) 39 { 40 #ifdef CHROMIUM_THREADSAFE 41 crFreeMutex(&pc->mutex); 42 crFree(pc); 43 #endif 44 } 37 45 38 46 /* Set packing context for the calling thread */ -
trunk/src/VBox/GuestHost/OpenGL/packer/pack_lights.c
r33457 r33475 10 10 static GLboolean __handleLightData( GLenum light, GLenum pname, const GLfloat *params ) 11 11 { 12 GET_PACKER_CONTEXT(pc);12 CR_GET_PACKER_CONTEXT(pc); 13 13 unsigned int packet_length = sizeof( int ) + sizeof( light ) + sizeof( pname ); 14 14 unsigned int params_length = 0; … … 38 38 } 39 39 packet_length += params_length; 40 GET_BUFFERED_POINTER(pc, packet_length );40 CR_GET_BUFFERED_POINTER(pc, packet_length ); 41 41 WRITE_DATA( 0, int, packet_length ); 42 42 WRITE_DATA( sizeof( int ) + 0, GLenum, light ); … … 57 57 void PACK_APIENTRY crPackLightfv (GLenum light, GLenum pname, const GLfloat *params) 58 58 { 59 GET_PACKER_CONTEXT(pc);59 CR_GET_PACKER_CONTEXT(pc); 60 60 if (__handleLightData( light, pname, params )) 61 61 WRITE_OPCODE( pc, CR_LIGHTFV_OPCODE ); 62 CR_UNLOCK_PACKER_CONTEXT(pc); 62 63 } 63 64 … … 65 66 { 66 67 /* 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); 68 69 if (__handleLightData( light, pname, (const GLfloat *) params )) 69 70 WRITE_OPCODE( pc, CR_LIGHTIV_OPCODE ); 71 CR_UNLOCK_PACKER_CONTEXT(pc); 70 72 } 71 73 72 74 static GLboolean __handleLightModelData( GLenum pname, const GLfloat *params ) 73 75 { 74 GET_PACKER_CONTEXT(pc);76 CR_GET_PACKER_CONTEXT(pc); 75 77 unsigned int packet_length = sizeof( int ) + sizeof( pname ); 76 78 unsigned int params_length = 0; … … 91 93 } 92 94 packet_length += params_length; 93 GET_BUFFERED_POINTER(pc, packet_length );95 CR_GET_BUFFERED_POINTER(pc, packet_length ); 94 96 WRITE_DATA( 0, int, packet_length ); 95 97 WRITE_DATA( sizeof( int ) + 0, GLenum, pname ); … … 106 108 void PACK_APIENTRY crPackLightModelfv (GLenum pname, const GLfloat *params) 107 109 { 108 GET_PACKER_CONTEXT(pc);110 CR_GET_PACKER_CONTEXT(pc); 109 111 if (__handleLightModelData( pname, params )) 110 112 WRITE_OPCODE( pc, CR_LIGHTMODELFV_OPCODE ); 113 CR_UNLOCK_PACKER_CONTEXT(pc); 111 114 } 112 115 … … 114 117 { 115 118 /* 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); 117 120 if (__handleLightModelData( pname, (const GLfloat *) params )) 118 121 WRITE_OPCODE( pc, CR_LIGHTMODELIV_OPCODE ); 122 CR_UNLOCK_PACKER_CONTEXT(pc); 119 123 } -
trunk/src/VBox/GuestHost/OpenGL/packer/pack_lists.c
r33457 r33475 63 63 void PACK_APIENTRY crPackNewList( GLuint list, GLenum mode ) 64 64 { 65 GET_PACKER_CONTEXT(pc);65 CR_GET_PACKER_CONTEXT(pc); 66 66 unsigned char *data_ptr; 67 67 (void) pc; 68 GET_BUFFERED_POINTER( pc, 16 );68 CR_GET_BUFFERED_POINTER( pc, 16 ); 69 69 WRITE_DATA( 0, GLint, 16 ); 70 70 WRITE_DATA( 4, GLenum, CR_NEWLIST_EXTEND_OPCODE ); … … 74 74 pc->buffer.in_List = GL_TRUE; 75 75 pc->buffer.holds_List = GL_TRUE; 76 CR_UNLOCK_PACKER_CONTEXT(pc); 76 77 } 77 78 78 79 void PACK_APIENTRY crPackEndList( void ) 79 80 { 80 GET_PACKER_CONTEXT(pc);81 CR_GET_PACKER_CONTEXT(pc); 81 82 unsigned char *data_ptr; 82 GET_BUFFERED_POINTER( pc, 8 );83 CR_GET_BUFFERED_POINTER( pc, 8 ); 83 84 WRITE_DATA( 0, GLint, 8 ); 84 85 WRITE_DATA( 4, GLenum, CR_ENDLIST_EXTEND_OPCODE ); 85 86 WRITE_OPCODE( pc, CR_EXTEND_OPCODE ); 86 87 pc->buffer.in_List = GL_FALSE; 88 CR_UNLOCK_PACKER_CONTEXT(pc); 87 89 } -
trunk/src/VBox/GuestHost/OpenGL/packer/pack_materials.c
r33457 r33475 10 10 static void __handleMaterialData( GLenum face, GLenum pname, const GLfloat *params ) 11 11 { 12 GET_PACKER_CONTEXT(pc);12 CR_GET_PACKER_CONTEXT(pc); 13 13 unsigned int packet_length = sizeof( int ) + sizeof( face ) + sizeof( pname ); 14 14 unsigned int params_length = 0; … … 35 35 packet_length += params_length; 36 36 37 GET_BUFFERED_POINTER(pc, packet_length );37 CR_GET_BUFFERED_POINTER(pc, packet_length ); 38 38 WRITE_DATA( 0, int, packet_length ); 39 39 WRITE_DATA( sizeof( int ) + 0, GLenum, face ); … … 53 53 void PACK_APIENTRY crPackMaterialfv(GLenum face, GLenum pname, const GLfloat *params) 54 54 { 55 GET_PACKER_CONTEXT(pc);55 CR_GET_PACKER_CONTEXT(pc); 56 56 __handleMaterialData( face, pname, params ); 57 57 WRITE_OPCODE( pc, CR_MATERIALFV_OPCODE ); 58 CR_UNLOCK_PACKER_CONTEXT(pc); 58 59 } 59 60 … … 61 62 { 62 63 /* 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); 64 65 __handleMaterialData( face, pname, (const GLfloat *) params ); 65 66 WRITE_OPCODE( pc, CR_MATERIALIV_OPCODE ); 67 CR_UNLOCK_PACKER_CONTEXT(pc); 66 68 } -
trunk/src/VBox/GuestHost/OpenGL/packer/pack_matrices.c
r33457 r33475 10 10 void PACK_APIENTRY crPackMultMatrixd( const GLdouble *m ) 11 11 { 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 ); 16 16 WRITE_DOUBLE( 0*sizeof(double), m[ 0] ); 17 17 WRITE_DOUBLE( 1*sizeof(double), m[ 1] ); … … 31 31 WRITE_DOUBLE( 15*sizeof(double), m[15] ); 32 32 WRITE_OPCODE( pc, CR_MULTMATRIXD_OPCODE ); 33 CR_UNLOCK_PACKER_CONTEXT(pc); 33 34 } 34 35 35 36 void PACK_APIENTRY crPackMultMatrixf( const GLfloat *m ) 36 37 { 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 ); 41 42 WRITE_DATA( 0*sizeof(GLfloat), GLfloat, m[ 0] ); 42 43 WRITE_DATA( 1*sizeof(GLfloat), GLfloat, m[ 1] ); … … 56 57 WRITE_DATA( 15*sizeof(GLfloat), GLfloat, m[15] ); 57 58 WRITE_OPCODE( pc, CR_MULTMATRIXF_OPCODE ); 59 CR_UNLOCK_PACKER_CONTEXT(pc); 58 60 } 59 61 60 62 void PACK_APIENTRY crPackLoadMatrixd( const GLdouble *m ) 61 63 { 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 ); 66 68 WRITE_DOUBLE( 0*sizeof(double), m[ 0] ); 67 69 WRITE_DOUBLE( 1*sizeof(double), m[ 1] ); … … 81 83 WRITE_DOUBLE( 15*sizeof(double), m[15] ); 82 84 WRITE_OPCODE( pc, CR_LOADMATRIXD_OPCODE ); 85 CR_UNLOCK_PACKER_CONTEXT(pc); 83 86 } 84 87 85 88 void PACK_APIENTRY crPackLoadMatrixf( const GLfloat *m ) 86 89 { 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 ); 91 94 WRITE_DATA( 0*sizeof(GLfloat), GLfloat, m[ 0] ); 92 95 WRITE_DATA( 1*sizeof(GLfloat), GLfloat, m[ 1] ); … … 106 109 WRITE_DATA( 15*sizeof(GLfloat), GLfloat, m[15] ); 107 110 WRITE_OPCODE( pc, CR_LOADMATRIXF_OPCODE ); 111 CR_UNLOCK_PACKER_CONTEXT(pc); 108 112 } 109 113 110 114 void PACK_APIENTRY crPackMultTransposeMatrixdARB( const GLdouble *m ) 111 115 { 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 ); 116 120 WRITE_DATA( 0, GLint, packet_length ); 117 121 WRITE_DATA( 4, GLenum, CR_MULTTRANSPOSEMATRIXDARB_EXTEND_OPCODE ); … … 133 137 WRITE_DOUBLE( 8 + 15*sizeof(double), m[15] ); 134 138 WRITE_OPCODE( pc, CR_EXTEND_OPCODE ); 139 CR_UNLOCK_PACKER_CONTEXT(pc); 135 140 } 136 141 137 142 void PACK_APIENTRY crPackMultTransposeMatrixfARB( const GLfloat *m ) 138 143 { 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 ); 143 148 WRITE_DATA( 0, GLint, packet_length ); 144 149 WRITE_DATA( 4, GLenum, CR_MULTTRANSPOSEMATRIXFARB_EXTEND_OPCODE ); … … 160 165 WRITE_DATA( 8 + 15*sizeof(GLfloat), GLfloat, m[15] ); 161 166 WRITE_OPCODE( pc, CR_EXTEND_OPCODE ); 167 CR_UNLOCK_PACKER_CONTEXT(pc); 162 168 } 163 169 164 170 void PACK_APIENTRY crPackLoadTransposeMatrixdARB( const GLdouble *m ) 165 171 { 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 ); 170 176 WRITE_DATA( 0, GLint, packet_length ); 171 177 WRITE_DATA( 4, GLenum, CR_LOADTRANSPOSEMATRIXDARB_EXTEND_OPCODE ); … … 187 193 WRITE_DOUBLE( 8 + 15*sizeof(double), m[15] ); 188 194 WRITE_OPCODE( pc, CR_EXTEND_OPCODE ); 195 CR_UNLOCK_PACKER_CONTEXT(pc); 189 196 } 190 197 191 198 void PACK_APIENTRY crPackLoadTransposeMatrixfARB( const GLfloat *m ) 192 199 { 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 ); 197 204 WRITE_DATA( 0, GLint, packet_length ); 198 205 WRITE_DATA( 4, GLenum, CR_LOADTRANSPOSEMATRIXFARB_EXTEND_OPCODE ); … … 214 221 WRITE_DATA( 8 + 15*sizeof(GLfloat), GLfloat, m[15] ); 215 222 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 10 10 void PACK_APIENTRY crPackChromiumParametervCR(GLenum target, GLenum type, GLsizei count, const GLvoid *values) 11 11 { 12 GET_PACKER_CONTEXT(pc);12 CR_GET_PACKER_CONTEXT(pc); 13 13 unsigned int header_length = 2 * sizeof(int) + sizeof(target) + sizeof(type) + sizeof(count); 14 14 unsigned int packet_length; … … 46 46 packet_length = header_length + params_length; 47 47 48 GET_BUFFERED_POINTER(pc, packet_length );48 CR_GET_BUFFERED_POINTER(pc, packet_length ); 49 49 WRITE_DATA( 0, GLint, packet_length ); 50 50 WRITE_DATA( 4, GLenum, CR_CHROMIUMPARAMETERVCR_EXTEND_OPCODE ); … … 90 90 __PackError( __LINE__, __FILE__, GL_INVALID_ENUM, 91 91 "crPackChromiumParametervCR(bad type)" ); 92 CR_UNLOCK_PACKER_CONTEXT(pc); 92 93 return; 93 94 } 95 CR_UNLOCK_PACKER_CONTEXT(pc); 94 96 } 95 97 … … 98 100 unsigned char *data_ptr; 99 101 int packet_length = sizeof(GLenum)+sizeof(n)+n*sizeof(*ids); 100 GET_PACKER_CONTEXT(pc);101 102 if (!ids) return; 102 103 data_ptr = (unsigned char *) crPackAlloc(packet_length); -
trunk/src/VBox/GuestHost/OpenGL/packer/pack_pixels.c
r27983 r33475 64 64 int *writeback) 65 65 { 66 GET_PACKER_CONTEXT(pc);66 CR_GET_PACKER_CONTEXT(pc); 67 67 unsigned char *data_ptr; 68 68 GLint stride = 0; … … 89 89 } 90 90 91 GET_BUFFERED_POINTER(pc, 48 + sizeof(CRNetworkPointer) );91 CR_GET_BUFFERED_POINTER(pc, 48 + sizeof(CRNetworkPointer) ); 92 92 WRITE_DATA( 0, GLint, x ); 93 93 WRITE_DATA( 4, GLint, y ); … … 104 104 WRITE_NETWORK_POINTER( 48, (char *) pixels ); 105 105 WRITE_OPCODE( pc, CR_READPIXELS_OPCODE ); 106 CR_UNLOCK_PACKER_CONTEXT(pc); 106 107 } 107 108 … … 205 206 int * writeback ) 206 207 { 207 GET_PACKER_CONTEXT(pc);208 CR_GET_PACKER_CONTEXT(pc); 208 209 unsigned char *data_ptr; 209 210 (void) pc; 210 GET_BUFFERED_POINTER( pc, 40 );211 CR_GET_BUFFERED_POINTER( pc, 40 ); 211 212 WRITE_DATA( 0, GLint, 40 ); 212 213 WRITE_DATA( 4, GLenum, CR_GETTEXIMAGE_EXTEND_OPCODE ); … … 218 219 WRITE_NETWORK_POINTER( 32, (void *) writeback ); 219 220 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 13 13 static GLboolean __handlePointDataf( GLenum pname, const GLfloat *params ) 14 14 { 15 GET_PACKER_CONTEXT(pc);15 CR_GET_PACKER_CONTEXT(pc); 16 16 int params_length = 0; 17 17 int packet_length = 2 * sizeof( int ) + sizeof( pname ); … … 37 37 packet_length += params_length; 38 38 39 GET_BUFFERED_POINTER(pc, packet_length );39 CR_GET_BUFFERED_POINTER(pc, packet_length ); 40 40 WRITE_DATA( 0, GLint, packet_length ); 41 41 WRITE_DATA( 4, GLenum, CR_POINTPARAMETERFVARB_EXTEND_OPCODE ); … … 52 52 void PACK_APIENTRY crPackPointParameterfvARB(GLenum pname, const GLfloat *params) 53 53 { 54 GET_PACKER_CONTEXT(pc);54 CR_GET_PACKER_CONTEXT(pc); 55 55 if (__handlePointDataf( pname, params )) 56 56 WRITE_OPCODE( pc, CR_EXTEND_OPCODE ); 57 CR_UNLOCK_PACKER_CONTEXT(pc); 57 58 } 58 59 … … 61 62 static GLboolean __handlePointDatai( GLenum pname, const GLint *params ) 62 63 { 63 GET_PACKER_CONTEXT(pc);64 CR_GET_PACKER_CONTEXT(pc); 64 65 int params_length = 0; 65 66 int packet_length = 2 * sizeof( int ) + sizeof( pname ); … … 85 86 packet_length += params_length; 86 87 87 GET_BUFFERED_POINTER(pc, packet_length );88 CR_GET_BUFFERED_POINTER(pc, packet_length ); 88 89 WRITE_DATA( 0, GLint, packet_length ); 89 90 WRITE_DATA( 4, GLenum, CR_POINTPARAMETERIV_EXTEND_OPCODE ); … … 100 101 void PACK_APIENTRY crPackPointParameteriv(GLenum pname, const GLint *params) 101 102 { 102 GET_PACKER_CONTEXT(pc);103 CR_GET_PACKER_CONTEXT(pc); 103 104 if (__handlePointDatai( pname, params )) 104 105 WRITE_OPCODE( pc, CR_EXTEND_OPCODE ); 106 CR_UNLOCK_PACKER_CONTEXT(pc); 105 107 } -
trunk/src/VBox/GuestHost/OpenGL/packer/pack_program.c
r33457 r33475 17 17 void PACK_APIENTRY crPackProgramParameters4dvNV (GLenum target, GLuint index, GLuint num, const GLdouble * params) 18 18 { 19 GET_PACKER_CONTEXT(pc);19 CR_GET_PACKER_CONTEXT(pc); 20 20 unsigned char *data_ptr; 21 21 int packet_length = sizeof(int) + sizeof(target) + sizeof(index) + sizeof(num) + num * 4 * sizeof(GLdouble); 22 22 23 GET_BUFFERED_POINTER(pc, packet_length);23 CR_GET_BUFFERED_POINTER(pc, packet_length); 24 24 WRITE_DATA(0, int, packet_length); 25 25 WRITE_DATA(sizeof(int) + 0, GLenum, target); … … 29 29 30 30 WRITE_OPCODE(pc, CR_PROGRAMPARAMETERS4DVNV_EXTEND_OPCODE); 31 CR_UNLOCK_PACKER_CONTEXT(pc); 31 32 } 32 33 … … 34 35 void PACK_APIENTRY crPackProgramParameters4fvNV (GLenum target, GLuint index, GLuint num, const GLfloat * params) 35 36 { 36 GET_PACKER_CONTEXT(pc);37 CR_GET_PACKER_CONTEXT(pc); 37 38 unsigned char *data_ptr; 38 39 int packet_length = sizeof(int) + sizeof(target) + sizeof(index) + sizeof(num) + num * 4 * sizeof(GLfloat); 39 40 40 GET_BUFFERED_POINTER(pc, packet_length);41 CR_GET_BUFFERED_POINTER(pc, packet_length); 41 42 WRITE_DATA(0, int, packet_length); 42 43 WRITE_DATA(sizeof(int) + 0, GLenum, target); … … 46 47 47 48 WRITE_OPCODE(pc, CR_PROGRAMPARAMETERS4FVNV_EXTEND_OPCODE); 49 CR_UNLOCK_PACKER_CONTEXT(pc); 48 50 } 49 51 … … 161 163 const int packet_length = 32; 162 164 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); 166 168 WRITE_DATA(0, int, packet_length); 167 169 WRITE_DATA(4, GLenum, CR_EXECUTEPROGRAMNV_EXTEND_OPCODE); … … 173 175 WRITE_DATA(28, GLfloat, params[3] ); 174 176 WRITE_OPCODE(pc, CR_EXTEND_OPCODE); 177 CR_UNLOCK_PACKER_CONTEXT(pc); 175 178 } 176 179 … … 179 182 const int packet_length = 20 + len; 180 183 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); 184 187 WRITE_DATA(0, int, packet_length); 185 188 WRITE_DATA(4, GLenum, CR_LOADPROGRAMNV_EXTEND_OPCODE); … … 189 192 crMemcpy( (void *) (data_ptr + 20), program, len ); 190 193 WRITE_OPCODE(pc, CR_EXTEND_OPCODE); 194 CR_UNLOCK_PACKER_CONTEXT(pc); 191 195 } 192 196 193 197 void PACK_APIENTRY crPackRequestResidentProgramsNV( GLsizei n, const GLuint *ids ) 194 198 { 195 GET_PACKER_CONTEXT(pc);199 CR_GET_PACKER_CONTEXT(pc); 196 200 (void) pc; 197 201 (void) n; … … 203 207 void PACK_APIENTRY crPackProgramNamedParameter4fNV (GLuint id, GLsizei len, const GLubyte * name, GLfloat x, GLfloat y, GLfloat z, GLfloat w) 204 208 { 205 GET_PACKER_CONTEXT(pc);209 CR_GET_PACKER_CONTEXT(pc); 206 210 unsigned char *data_ptr; 207 211 int packet_length = 32 + len; 208 212 209 GET_BUFFERED_POINTER(pc, packet_length);213 CR_GET_BUFFERED_POINTER(pc, packet_length); 210 214 WRITE_DATA(0, GLint, packet_length); 211 215 WRITE_DATA(4, GLenum, CR_PROGRAMNAMEDPARAMETER4FNV_EXTEND_OPCODE); … … 218 222 crMemcpy( (void *) (data_ptr + 32), name, len ); 219 223 WRITE_OPCODE(pc, CR_EXTEND_OPCODE); 224 CR_UNLOCK_PACKER_CONTEXT(pc); 220 225 } 221 226 222 227 void PACK_APIENTRY crPackProgramNamedParameter4dNV (GLuint id, GLsizei len, const GLubyte * name, GLdouble x, GLdouble y, GLdouble z, GLdouble w) 223 228 { 224 GET_PACKER_CONTEXT(pc);229 CR_GET_PACKER_CONTEXT(pc); 225 230 unsigned char *data_ptr; 226 231 int packet_length = 48 + len; 227 232 228 GET_BUFFERED_POINTER(pc, packet_length);233 CR_GET_BUFFERED_POINTER(pc, packet_length); 229 234 WRITE_DATA(0, GLint, packet_length); 230 235 WRITE_DATA(4, GLenum, CR_PROGRAMNAMEDPARAMETER4DNV_EXTEND_OPCODE); … … 238 243 239 244 WRITE_OPCODE(pc, CR_EXTEND_OPCODE); 245 CR_UNLOCK_PACKER_CONTEXT(pc); 240 246 } 241 247 … … 256 262 int *writeback) 257 263 { 258 GET_PACKER_CONTEXT(pc);264 CR_GET_PACKER_CONTEXT(pc); 259 265 unsigned char *data_ptr; 260 266 int packet_length; … … 268 274 8 + 8; 269 275 270 GET_BUFFERED_POINTER(pc, packet_length);276 CR_GET_BUFFERED_POINTER(pc, packet_length); 271 277 WRITE_DATA(0, int, packet_length); 272 278 WRITE_DATA(4, GLenum, CR_AREPROGRAMSRESIDENTNV_EXTEND_OPCODE); … … 276 282 WRITE_NETWORK_POINTER(20 + n * sizeof(*programs), (void *) writeback); 277 283 WRITE_OPCODE(pc, CR_EXTEND_OPCODE); 284 CR_UNLOCK_PACKER_CONTEXT(pc); 278 285 } 279 286 … … 282 289 { 283 290 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 ); 287 294 WRITE_DATA( 0, GLint, packet_length ); 288 295 WRITE_DATA( 4, GLenum, CR_GETPROGRAMNAMEDPARAMETERFVNV_EXTEND_OPCODE ); … … 293 300 WRITE_NETWORK_POINTER( 16 + len + 8, (void *) writeback ); 294 301 WRITE_OPCODE( pc, CR_EXTEND_OPCODE ); 302 CR_UNLOCK_PACKER_CONTEXT(pc); 295 303 } 296 304 … … 298 306 { 299 307 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 ); 303 311 WRITE_DATA( 0, GLint, packet_length ); 304 312 WRITE_DATA( 4, GLenum, CR_GETPROGRAMNAMEDPARAMETERDVNV_EXTEND_OPCODE ); … … 309 317 WRITE_NETWORK_POINTER( 16 + len + 8, (void *) writeback ); 310 318 WRITE_OPCODE( pc, CR_EXTEND_OPCODE ); 319 CR_UNLOCK_PACKER_CONTEXT(pc); 311 320 } 312 321 … … 333 342 const int packet_length = 20 + len; 334 343 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); 338 347 WRITE_DATA(0, int, packet_length); 339 348 WRITE_DATA(4, GLenum, CR_PROGRAMSTRINGARB_EXTEND_OPCODE); … … 343 352 crMemcpy( (void *) (data_ptr + 20), string, len ); 344 353 WRITE_OPCODE(pc, CR_EXTEND_OPCODE); 354 CR_UNLOCK_PACKER_CONTEXT(pc); 345 355 } 346 356 … … 353 363 void PACK_APIENTRY crPackVertexAttrib4NbvARB( GLuint index, const GLbyte *v ) 354 364 { 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 ); 358 368 pc->current.c.vertexAttrib.b4[index] = data_ptr + 12; 359 369 pc->current.attribsUsedMask |= (1 << index); … … 364 374 WRITE_DATA( 7, GLbyte, v[3] ); 365 375 WRITE_OPCODE( pc, CR_VERTEXATTRIB4NBVARB_OPCODE ); 376 CR_UNLOCK_PACKER_CONTEXT(pc); 366 377 } 367 378 368 379 void PACK_APIENTRY crPackVertexAttrib4NivARB( GLuint index, const GLint *v ) 369 380 { 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 ); 373 384 pc->current.c.vertexAttrib.i4[index] = data_ptr + 12; 374 385 pc->current.attribsUsedMask |= (1 << index); … … 379 390 WRITE_DATA( 16, GLint, v[3] ); 380 391 WRITE_OPCODE( pc, CR_VERTEXATTRIB4NIVARB_OPCODE ); 392 CR_UNLOCK_PACKER_CONTEXT(pc); 381 393 } 382 394 383 395 void PACK_APIENTRY crPackVertexAttrib4NsvARB( GLuint index, const GLshort *v ) 384 396 { 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 ); 388 400 pc->current.c.vertexAttrib.s4[index] = data_ptr + 12; 389 401 pc->current.attribsUsedMask |= (1 << index); … … 394 406 WRITE_DATA( 10, GLshort, v[3] ); 395 407 WRITE_OPCODE( pc, CR_VERTEXATTRIB4NSVARB_OPCODE ); 408 CR_UNLOCK_PACKER_CONTEXT(pc); 396 409 } 397 410 398 411 void PACK_APIENTRY crPackVertexAttrib4NubvARB(GLuint index, const GLubyte * v) 399 412 { 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 ); 403 416 pc->current.c.vertexAttrib.ub4[index] = data_ptr + 12; 404 417 pc->current.attribsUsedMask |= (1 << index); … … 409 422 WRITE_DATA( 7, GLubyte, v[3] ); 410 423 WRITE_OPCODE( pc, CR_VERTEXATTRIB4NUBVARB_OPCODE ); 424 CR_UNLOCK_PACKER_CONTEXT(pc); 411 425 } 412 426 413 427 void PACK_APIENTRY crPackVertexAttrib4NuivARB(GLuint index, const GLuint * v) 414 428 { 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 ); 418 432 pc->current.c.vertexAttrib.ui4[index] = data_ptr + 12; 419 433 pc->current.attribsUsedMask |= (1 << index); … … 424 438 WRITE_DATA( 16, GLuint, v[3] ); 425 439 WRITE_OPCODE( pc, CR_VERTEXATTRIB4NUIVARB_OPCODE ); 440 CR_UNLOCK_PACKER_CONTEXT(pc); 426 441 } 427 442 428 443 void PACK_APIENTRY crPackVertexAttrib4NusvARB(GLuint index, const GLushort * v) 429 444 { 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 ); 433 448 pc->current.c.vertexAttrib.s4[index] = data_ptr + 12; 434 449 pc->current.attribsUsedMask |= (1 << index); … … 439 454 WRITE_DATA( 10, GLushort, v[3] ); 440 455 WRITE_OPCODE( pc, CR_VERTEXATTRIB4NUSVARB_OPCODE ); 456 CR_UNLOCK_PACKER_CONTEXT(pc); 441 457 } 442 458 443 459 void PACK_APIENTRY crPackVertexAttrib4bvARB(GLuint index, const GLbyte * v) 444 460 { 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 ); 448 464 pc->current.c.vertexAttrib.b4[index] = data_ptr + 12; 449 465 pc->current.attribsUsedMask |= (1 << index); … … 454 470 WRITE_DATA( 7, GLbyte, v[3] ); 455 471 WRITE_OPCODE( pc, CR_VERTEXATTRIB4BVARB_OPCODE ); 472 CR_UNLOCK_PACKER_CONTEXT(pc); 456 473 } 457 474 458 475 void PACK_APIENTRY crPackVertexAttrib4ivARB(GLuint index, const GLint * v) 459 476 { 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 ); 463 480 pc->current.c.vertexAttrib.i4[index] = data_ptr + 12; 464 481 pc->current.attribsUsedMask |= (1 << index); … … 469 486 WRITE_DATA( 16, GLint, v[3] ); 470 487 WRITE_OPCODE( pc, CR_VERTEXATTRIB4IVARB_OPCODE ); 488 CR_UNLOCK_PACKER_CONTEXT(pc); 471 489 } 472 490 473 491 void PACK_APIENTRY crPackVertexAttrib4uivARB(GLuint index, const GLuint * v) 474 492 { 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 ); 478 496 pc->current.c.vertexAttrib.ui4[index] = data_ptr + 12; 479 497 pc->current.attribsUsedMask |= (1 << index); … … 484 502 WRITE_DATA( 16, GLuint, v[3] ); 485 503 WRITE_OPCODE( pc, CR_VERTEXATTRIB4UIVARB_OPCODE ); 504 CR_UNLOCK_PACKER_CONTEXT(pc); 486 505 } 487 506 488 507 void PACK_APIENTRY crPackVertexAttrib4usvARB(GLuint index, const GLushort * v) 489 508 { 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 ); 493 512 pc->current.c.vertexAttrib.s4[index] = data_ptr + 12; 494 513 pc->current.attribsUsedMask |= (1 << index); … … 499 518 WRITE_DATA( 10, GLushort, v[3] ); 500 519 WRITE_OPCODE( pc, CR_VERTEXATTRIB4USVARB_OPCODE ); 520 CR_UNLOCK_PACKER_CONTEXT(pc); 501 521 } 502 522 … … 504 524 void PACK_APIENTRY crPackVertexAttrib4ubvARB(GLuint index, const GLubyte * v) 505 525 { 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 ); 509 529 pc->current.c.vertexAttrib.ub4[index] = data_ptr + 12; 510 530 pc->current.attribsUsedMask |= (1 << index); … … 515 535 WRITE_DATA( 7, GLubyte, v[3] ); 516 536 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 10 10 static GLboolean __handleCombinerParameterData( GLenum pname, const GLfloat *params, GLenum extended_opcode ) 11 11 { 12 GET_PACKER_CONTEXT(pc);12 CR_GET_PACKER_CONTEXT(pc); 13 13 unsigned int params_length = 0; 14 14 unsigned int packet_length = sizeof( int ) + sizeof( extended_opcode ) + sizeof( pname ); … … 32 32 } 33 33 packet_length += params_length; 34 GET_BUFFERED_POINTER(pc, packet_length );34 CR_GET_BUFFERED_POINTER(pc, packet_length ); 35 35 WRITE_DATA( 0, int, packet_length ); 36 36 WRITE_DATA( sizeof( int ) + 0, GLenum, extended_opcode ); … … 49 49 void PACK_APIENTRY crPackCombinerParameterfvNV( GLenum pname, const GLfloat *params ) 50 50 { 51 GET_PACKER_CONTEXT(pc);51 CR_GET_PACKER_CONTEXT(pc); 52 52 if (__handleCombinerParameterData( pname, params, CR_COMBINERPARAMETERFVNV_EXTEND_OPCODE )) 53 53 WRITE_OPCODE( pc, CR_EXTEND_OPCODE ); 54 CR_UNLOCK_PACKER_CONTEXT(pc); 54 55 } 55 56 … … 57 58 { 58 59 /* 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); 60 61 if (__handleCombinerParameterData( pname, (const GLfloat *) params, CR_COMBINERPARAMETERIVNV_EXTEND_OPCODE )) 61 62 WRITE_OPCODE( pc, CR_EXTEND_OPCODE ); 63 CR_UNLOCK_PACKER_CONTEXT(pc); 62 64 } 63 65 64 66 void PACK_APIENTRY crPackCombinerStageParameterfvNV( GLenum stage, GLenum pname, const GLfloat *params ) 65 67 { 66 GET_PACKER_CONTEXT(pc);68 CR_GET_PACKER_CONTEXT(pc); 67 69 unsigned char *data_ptr; 68 70 69 GET_BUFFERED_POINTER(pc, 32 );71 CR_GET_BUFFERED_POINTER(pc, 32 ); 70 72 WRITE_DATA( 0, GLint, 32 ); 71 73 WRITE_DATA( 4, GLenum, CR_COMBINERSTAGEPARAMETERFVNV_EXTEND_OPCODE ); … … 77 79 WRITE_DATA( 28, GLfloat, params[3] ); 78 80 WRITE_OPCODE( pc, CR_EXTEND_OPCODE ); 81 CR_UNLOCK_PACKER_CONTEXT(pc); 79 82 } -
trunk/src/VBox/GuestHost/OpenGL/packer/pack_shaders.c
r28800 r33475 23 23 void PACK_APIENTRY crPackBindAttribLocation(GLuint program, GLuint index, const char *name) 24 24 { 25 GET_PACKER_CONTEXT(pc);25 CR_GET_PACKER_CONTEXT(pc); 26 26 unsigned char *data_ptr; 27 27 int cbName = crStrlen(name)+1; 28 28 int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(program)+sizeof(index) + cbName*sizeof(*name); 29 29 30 GET_BUFFERED_POINTER(pc, packet_length);30 CR_GET_BUFFERED_POINTER(pc, packet_length); 31 31 WRITE_DATA_AI(int, packet_length); 32 32 WRITE_DATA_AI(GLenum, CR_BINDATTRIBLOCATION_EXTEND_OPCODE); … … 35 35 crMemcpy(data_ptr, name, cbName*sizeof(*name)); 36 36 WRITE_OPCODE(pc, CR_EXTEND_OPCODE); 37 CR_UNLOCK_PACKER_CONTEXT(pc); 37 38 } 38 39 39 40 void PACK_APIENTRY crPackShaderSource(GLuint shader, GLsizei count, const char **string, const GLint *length) 40 41 { 41 GET_PACKER_CONTEXT(pc);42 CR_GET_PACKER_CONTEXT(pc); 42 43 unsigned char *data_ptr; 43 44 GLint *pLocalLength; … … 61 62 } 62 63 63 GET_BUFFERED_POINTER(pc, packet_length);64 CR_GET_BUFFERED_POINTER(pc, packet_length); 64 65 WRITE_DATA_AI(int, packet_length); 65 66 WRITE_DATA_AI(GLenum, CR_SHADERSOURCE_EXTEND_OPCODE); … … 82 83 } 83 84 WRITE_OPCODE(pc, CR_EXTEND_OPCODE); 85 CR_UNLOCK_PACKER_CONTEXT(pc); 84 86 85 87 crFree(pLocalLength); … … 88 90 void PACK_APIENTRY crPackUniform1fv(GLint location, GLsizei count, const GLfloat *value) 89 91 { 90 GET_PACKER_CONTEXT(pc);92 CR_GET_PACKER_CONTEXT(pc); 91 93 unsigned char *data_ptr; 92 94 int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(location)+sizeof(count) + count*sizeof(*value); 93 95 94 GET_BUFFERED_POINTER(pc, packet_length);96 CR_GET_BUFFERED_POINTER(pc, packet_length); 95 97 WRITE_DATA_AI(int, packet_length); 96 98 WRITE_DATA_AI(GLenum, CR_UNIFORM1FV_EXTEND_OPCODE); … … 99 101 crMemcpy(data_ptr, value, count*sizeof(*value)); 100 102 WRITE_OPCODE(pc, CR_EXTEND_OPCODE); 103 CR_UNLOCK_PACKER_CONTEXT(pc); 101 104 } 102 105 103 106 void PACK_APIENTRY crPackUniform1iv(GLint location, GLsizei count, const GLint *value) 104 107 { 105 GET_PACKER_CONTEXT(pc);108 CR_GET_PACKER_CONTEXT(pc); 106 109 unsigned char *data_ptr; 107 110 int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(location)+sizeof(count) + count*sizeof(*value); 108 111 109 GET_BUFFERED_POINTER(pc, packet_length);112 CR_GET_BUFFERED_POINTER(pc, packet_length); 110 113 WRITE_DATA_AI(int, packet_length); 111 114 WRITE_DATA_AI(GLenum, CR_UNIFORM1IV_EXTEND_OPCODE); … … 114 117 crMemcpy(data_ptr, value, count*sizeof(*value)); 115 118 WRITE_OPCODE(pc, CR_EXTEND_OPCODE); 119 CR_UNLOCK_PACKER_CONTEXT(pc); 116 120 } 117 121 118 122 void PACK_APIENTRY crPackUniform2fv(GLint location, GLsizei count, const GLfloat *value) 119 123 { 120 GET_PACKER_CONTEXT(pc);124 CR_GET_PACKER_CONTEXT(pc); 121 125 unsigned char *data_ptr; 122 126 int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(location)+sizeof(count) + 2*count*sizeof(*value); 123 127 124 GET_BUFFERED_POINTER(pc, packet_length);128 CR_GET_BUFFERED_POINTER(pc, packet_length); 125 129 WRITE_DATA_AI(int, packet_length); 126 130 WRITE_DATA_AI(GLenum, CR_UNIFORM2FV_EXTEND_OPCODE); … … 129 133 crMemcpy(data_ptr, value, 2*count*sizeof(*value)); 130 134 WRITE_OPCODE(pc, CR_EXTEND_OPCODE); 135 CR_UNLOCK_PACKER_CONTEXT(pc); 131 136 } 132 137 133 138 void PACK_APIENTRY crPackUniform2iv(GLint location, GLsizei count, const GLint *value) 134 139 { 135 GET_PACKER_CONTEXT(pc);140 CR_GET_PACKER_CONTEXT(pc); 136 141 unsigned char *data_ptr; 137 142 int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(location)+sizeof(count) + 2*count*sizeof(*value); 138 143 139 GET_BUFFERED_POINTER(pc, packet_length);144 CR_GET_BUFFERED_POINTER(pc, packet_length); 140 145 WRITE_DATA_AI(int, packet_length); 141 146 WRITE_DATA_AI(GLenum, CR_UNIFORM2IV_EXTEND_OPCODE); … … 144 149 crMemcpy(data_ptr, value, 2*count*sizeof(*value)); 145 150 WRITE_OPCODE(pc, CR_EXTEND_OPCODE); 151 CR_UNLOCK_PACKER_CONTEXT(pc); 146 152 } 147 153 148 154 void PACK_APIENTRY crPackUniform3fv(GLint location, GLsizei count, const GLfloat *value) 149 155 { 150 GET_PACKER_CONTEXT(pc);156 CR_GET_PACKER_CONTEXT(pc); 151 157 unsigned char *data_ptr; 152 158 int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(location)+sizeof(count) + 3*count*sizeof(*value); 153 159 154 GET_BUFFERED_POINTER(pc, packet_length);160 CR_GET_BUFFERED_POINTER(pc, packet_length); 155 161 WRITE_DATA_AI(int, packet_length); 156 162 WRITE_DATA_AI(GLenum, CR_UNIFORM3FV_EXTEND_OPCODE); … … 159 165 crMemcpy(data_ptr, value, 3*count*sizeof(*value)); 160 166 WRITE_OPCODE(pc, CR_EXTEND_OPCODE); 167 CR_UNLOCK_PACKER_CONTEXT(pc); 161 168 } 162 169 163 170 void PACK_APIENTRY crPackUniform3iv(GLint location, GLsizei count, const GLint *value) 164 171 { 165 GET_PACKER_CONTEXT(pc);172 CR_GET_PACKER_CONTEXT(pc); 166 173 unsigned char *data_ptr; 167 174 int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(location)+sizeof(count) + 3*count*sizeof(*value); 168 175 169 GET_BUFFERED_POINTER(pc, packet_length);176 CR_GET_BUFFERED_POINTER(pc, packet_length); 170 177 WRITE_DATA_AI(int, packet_length); 171 178 WRITE_DATA_AI(GLenum, CR_UNIFORM3IV_EXTEND_OPCODE); … … 174 181 crMemcpy(data_ptr, value, 3*count*sizeof(*value)); 175 182 WRITE_OPCODE(pc, CR_EXTEND_OPCODE); 183 CR_UNLOCK_PACKER_CONTEXT(pc); 176 184 } 177 185 178 186 void PACK_APIENTRY crPackUniform4fv(GLint location, GLsizei count, const GLfloat *value) 179 187 { 180 GET_PACKER_CONTEXT(pc);188 CR_GET_PACKER_CONTEXT(pc); 181 189 unsigned char *data_ptr; 182 190 int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(location)+sizeof(count) + 4*count*sizeof(*value); 183 191 184 GET_BUFFERED_POINTER(pc, packet_length);192 CR_GET_BUFFERED_POINTER(pc, packet_length); 185 193 WRITE_DATA_AI(int, packet_length); 186 194 WRITE_DATA_AI(GLenum, CR_UNIFORM4FV_EXTEND_OPCODE); … … 189 197 crMemcpy(data_ptr, value, 4*count*sizeof(*value)); 190 198 WRITE_OPCODE(pc, CR_EXTEND_OPCODE); 199 CR_UNLOCK_PACKER_CONTEXT(pc); 191 200 } 192 201 193 202 void PACK_APIENTRY crPackUniform4iv(GLint location, GLsizei count, const GLint *value) 194 203 { 195 GET_PACKER_CONTEXT(pc);204 CR_GET_PACKER_CONTEXT(pc); 196 205 unsigned char *data_ptr; 197 206 int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(location)+sizeof(count) + 4*count*sizeof(*value); 198 207 199 GET_BUFFERED_POINTER(pc, packet_length);208 CR_GET_BUFFERED_POINTER(pc, packet_length); 200 209 WRITE_DATA_AI(int, packet_length); 201 210 WRITE_DATA_AI(GLenum, CR_UNIFORM4IV_EXTEND_OPCODE); … … 204 213 crMemcpy(data_ptr, value, 4*count*sizeof(*value)); 205 214 WRITE_OPCODE(pc, CR_EXTEND_OPCODE); 215 CR_UNLOCK_PACKER_CONTEXT(pc); 206 216 } 207 217 208 218 void PACK_APIENTRY crPackUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) 209 219 { 210 GET_PACKER_CONTEXT(pc);220 CR_GET_PACKER_CONTEXT(pc); 211 221 unsigned char *data_ptr; 212 222 int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(location)+sizeof(count)+sizeof(transpose) + 2*2*count*sizeof(*value); 213 223 214 GET_BUFFERED_POINTER(pc, packet_length);224 CR_GET_BUFFERED_POINTER(pc, packet_length); 215 225 WRITE_DATA_AI(int, packet_length); 216 226 WRITE_DATA_AI(GLenum, CR_UNIFORMMATRIX2FV_EXTEND_OPCODE); … … 220 230 crMemcpy(data_ptr, value, 2*2*count*sizeof(*value)); 221 231 WRITE_OPCODE(pc, CR_EXTEND_OPCODE); 232 CR_UNLOCK_PACKER_CONTEXT(pc); 222 233 } 223 234 224 235 void PACK_APIENTRY crPackUniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) 225 236 { 226 GET_PACKER_CONTEXT(pc);237 CR_GET_PACKER_CONTEXT(pc); 227 238 unsigned char *data_ptr; 228 239 int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(location)+sizeof(count)+sizeof(transpose) + 3*3*count*sizeof(*value); 229 240 230 GET_BUFFERED_POINTER(pc, packet_length);241 CR_GET_BUFFERED_POINTER(pc, packet_length); 231 242 WRITE_DATA_AI(int, packet_length); 232 243 WRITE_DATA_AI(GLenum, CR_UNIFORMMATRIX3FV_EXTEND_OPCODE); … … 236 247 crMemcpy(data_ptr, value, 3*3*count*sizeof(*value)); 237 248 WRITE_OPCODE(pc, CR_EXTEND_OPCODE); 249 CR_UNLOCK_PACKER_CONTEXT(pc); 238 250 } 239 251 240 252 void PACK_APIENTRY crPackUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) 241 253 { 242 GET_PACKER_CONTEXT(pc);254 CR_GET_PACKER_CONTEXT(pc); 243 255 unsigned char *data_ptr; 244 256 int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(location)+sizeof(count)+sizeof(transpose) + 4*4*count*sizeof(*value); 245 257 246 GET_BUFFERED_POINTER(pc, packet_length);258 CR_GET_BUFFERED_POINTER(pc, packet_length); 247 259 WRITE_DATA_AI(int, packet_length); 248 260 WRITE_DATA_AI(GLenum, CR_UNIFORMMATRIX4FV_EXTEND_OPCODE); … … 252 264 crMemcpy(data_ptr, value, 4*4*count*sizeof(*value)); 253 265 WRITE_OPCODE(pc, CR_EXTEND_OPCODE); 266 CR_UNLOCK_PACKER_CONTEXT(pc); 254 267 } 255 268 256 269 void PACK_APIENTRY crPackUniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) 257 270 { 258 GET_PACKER_CONTEXT(pc);271 CR_GET_PACKER_CONTEXT(pc); 259 272 unsigned char *data_ptr; 260 273 int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(location)+sizeof(count)+sizeof(transpose) 261 274 + 2*3*count*sizeof(*value); 262 275 263 GET_BUFFERED_POINTER(pc, packet_length);276 CR_GET_BUFFERED_POINTER(pc, packet_length); 264 277 WRITE_DATA_AI(int, packet_length); 265 278 WRITE_DATA_AI(GLenum, CR_UNIFORMMATRIX2X3FV_EXTEND_OPCODE); … … 269 282 crMemcpy(data_ptr, value, 2*3*count*sizeof(*value)); 270 283 WRITE_OPCODE(pc, CR_EXTEND_OPCODE); 284 CR_UNLOCK_PACKER_CONTEXT(pc); 271 285 } 272 286 273 287 void PACK_APIENTRY crPackUniformMatrix3x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) 274 288 { 275 GET_PACKER_CONTEXT(pc);289 CR_GET_PACKER_CONTEXT(pc); 276 290 unsigned char *data_ptr; 277 291 int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(location)+sizeof(count)+sizeof(transpose) 278 292 + 3*2*count*sizeof(*value); 279 293 280 GET_BUFFERED_POINTER(pc, packet_length);294 CR_GET_BUFFERED_POINTER(pc, packet_length); 281 295 WRITE_DATA_AI(int, packet_length); 282 296 WRITE_DATA_AI(GLenum, CR_UNIFORMMATRIX3X2FV_EXTEND_OPCODE); … … 286 300 crMemcpy(data_ptr, value, 3*2*count*sizeof(*value)); 287 301 WRITE_OPCODE(pc, CR_EXTEND_OPCODE); 302 CR_UNLOCK_PACKER_CONTEXT(pc); 288 303 } 289 304 290 305 void PACK_APIENTRY crPackUniformMatrix2x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) 291 306 { 292 GET_PACKER_CONTEXT(pc);307 CR_GET_PACKER_CONTEXT(pc); 293 308 unsigned char *data_ptr; 294 309 int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(location)+sizeof(count)+sizeof(transpose) 295 310 + 2*4*count*sizeof(*value); 296 311 297 GET_BUFFERED_POINTER(pc, packet_length);312 CR_GET_BUFFERED_POINTER(pc, packet_length); 298 313 WRITE_DATA_AI(int, packet_length); 299 314 WRITE_DATA_AI(GLenum, CR_UNIFORMMATRIX2X4FV_EXTEND_OPCODE); … … 303 318 crMemcpy(data_ptr, value, 2*4*count*sizeof(*value)); 304 319 WRITE_OPCODE(pc, CR_EXTEND_OPCODE); 320 CR_UNLOCK_PACKER_CONTEXT(pc); 305 321 } 306 322 307 323 void PACK_APIENTRY crPackUniformMatrix4x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) 308 324 { 309 GET_PACKER_CONTEXT(pc);325 CR_GET_PACKER_CONTEXT(pc); 310 326 unsigned char *data_ptr; 311 327 int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(location)+sizeof(count)+sizeof(transpose) 312 328 + 4*2*count*sizeof(*value); 313 329 314 GET_BUFFERED_POINTER(pc, packet_length);330 CR_GET_BUFFERED_POINTER(pc, packet_length); 315 331 WRITE_DATA_AI(int, packet_length); 316 332 WRITE_DATA_AI(GLenum, CR_UNIFORMMATRIX4X2FV_EXTEND_OPCODE); … … 320 336 crMemcpy(data_ptr, value, 4*2*count*sizeof(*value)); 321 337 WRITE_OPCODE(pc, CR_EXTEND_OPCODE); 338 CR_UNLOCK_PACKER_CONTEXT(pc); 322 339 } 323 340 324 341 void PACK_APIENTRY crPackUniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) 325 342 { 326 GET_PACKER_CONTEXT(pc);343 CR_GET_PACKER_CONTEXT(pc); 327 344 unsigned char *data_ptr; 328 345 int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(location)+sizeof(count)+sizeof(transpose) 329 346 + 3*4*count*sizeof(*value); 330 347 331 GET_BUFFERED_POINTER(pc, packet_length);348 CR_GET_BUFFERED_POINTER(pc, packet_length); 332 349 WRITE_DATA_AI(int, packet_length); 333 350 WRITE_DATA_AI(GLenum, CR_UNIFORMMATRIX3X4FV_EXTEND_OPCODE); … … 337 354 crMemcpy(data_ptr, value, 3*4*count*sizeof(*value)); 338 355 WRITE_OPCODE(pc, CR_EXTEND_OPCODE); 356 CR_UNLOCK_PACKER_CONTEXT(pc); 339 357 } 340 358 341 359 void PACK_APIENTRY crPackUniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) 342 360 { 343 GET_PACKER_CONTEXT(pc);361 CR_GET_PACKER_CONTEXT(pc); 344 362 unsigned char *data_ptr; 345 363 int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(location)+sizeof(count)+sizeof(transpose) 346 364 + 4*3*count*sizeof(*value); 347 365 348 GET_BUFFERED_POINTER(pc, packet_length);366 CR_GET_BUFFERED_POINTER(pc, packet_length); 349 367 WRITE_DATA_AI(int, packet_length); 350 368 WRITE_DATA_AI(GLenum, CR_UNIFORMMATRIX4X3FV_EXTEND_OPCODE); … … 354 372 crMemcpy(data_ptr, value, 4*3*count*sizeof(*value)); 355 373 WRITE_OPCODE(pc, CR_EXTEND_OPCODE); 374 CR_UNLOCK_PACKER_CONTEXT(pc); 356 375 } 357 376 358 377 void PACK_APIENTRY crPackDrawBuffers(GLsizei n, const GLenum *bufs) 359 378 { 360 GET_PACKER_CONTEXT(pc);379 CR_GET_PACKER_CONTEXT(pc); 361 380 unsigned char *data_ptr; 362 381 int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(n) + n*sizeof(*bufs); 363 382 364 GET_BUFFERED_POINTER(pc, packet_length);383 CR_GET_BUFFERED_POINTER(pc, packet_length); 365 384 WRITE_DATA_AI(int, packet_length); 366 385 WRITE_DATA_AI(GLenum, CR_DRAWBUFFERS_EXTEND_OPCODE); … … 368 387 crMemcpy(data_ptr, bufs, n*sizeof(*bufs)); 369 388 WRITE_OPCODE(pc, CR_EXTEND_OPCODE); 389 CR_UNLOCK_PACKER_CONTEXT(pc); 370 390 } 371 391 … … 376 396 void PACK_APIENTRY crPackGetActiveAttrib(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, char * name, int * writeback) 377 397 { 378 GET_PACKER_CONTEXT(pc);398 CR_GET_PACKER_CONTEXT(pc); 379 399 unsigned char *data_ptr; 380 400 (void) pc; … … 382 402 (void) type; 383 403 (void) name; 384 GET_BUFFERED_POINTER(pc, 36);404 CR_GET_BUFFERED_POINTER(pc, 36); 385 405 WRITE_DATA(0, GLint, 36); 386 406 WRITE_DATA(4, GLenum, CR_GETACTIVEATTRIB_EXTEND_OPCODE); … … 391 411 WRITE_NETWORK_POINTER(28, (void *) writeback); 392 412 WRITE_OPCODE(pc, CR_EXTEND_OPCODE); 413 CR_UNLOCK_PACKER_CONTEXT(pc); 393 414 } 394 415 395 416 void PACK_APIENTRY crPackGetActiveUniform(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, char * name, int * writeback) 396 417 { 397 GET_PACKER_CONTEXT(pc);418 CR_GET_PACKER_CONTEXT(pc); 398 419 unsigned char *data_ptr; 399 420 (void) pc; … … 401 422 (void) type; 402 423 (void) name; 403 GET_BUFFERED_POINTER(pc, 36);424 CR_GET_BUFFERED_POINTER(pc, 36); 404 425 WRITE_DATA(0, GLint, 36); 405 426 WRITE_DATA(4, GLenum, CR_GETACTIVEUNIFORM_EXTEND_OPCODE); … … 410 431 WRITE_NETWORK_POINTER(28, (void *) writeback); 411 432 WRITE_OPCODE(pc, CR_EXTEND_OPCODE); 433 CR_UNLOCK_PACKER_CONTEXT(pc); 412 434 } 413 435 414 436 void PACK_APIENTRY crPackGetAttachedShaders(GLuint program, GLsizei maxCount, GLsizei * count, GLuint * shaders, int * writeback) 415 437 { 416 GET_PACKER_CONTEXT(pc);438 CR_GET_PACKER_CONTEXT(pc); 417 439 unsigned char *data_ptr; 418 440 (void) pc; 419 441 (void) shaders; 420 GET_BUFFERED_POINTER(pc, 32);442 CR_GET_BUFFERED_POINTER(pc, 32); 421 443 WRITE_DATA(0, GLint, 32); 422 444 WRITE_DATA(4, GLenum, CR_GETATTACHEDSHADERS_EXTEND_OPCODE); … … 426 448 WRITE_NETWORK_POINTER(24, (void *) writeback); 427 449 WRITE_OPCODE(pc, CR_EXTEND_OPCODE); 450 CR_UNLOCK_PACKER_CONTEXT(pc); 428 451 } 429 452 430 453 void PACK_APIENTRY crPackGetAttachedObjectsARB(GLhandleARB containerObj, GLsizei maxCount, GLsizei * count, GLhandleARB * obj, int * writeback) 431 454 { 432 GET_PACKER_CONTEXT(pc);455 CR_GET_PACKER_CONTEXT(pc); 433 456 unsigned char *data_ptr; 434 457 (void) pc; 435 GET_BUFFERED_POINTER(pc, 32);458 CR_GET_BUFFERED_POINTER(pc, 32); 436 459 WRITE_DATA(0, GLint, 32); 437 460 WRITE_DATA(4, GLenum, CR_GETATTACHEDOBJECTSARB_EXTEND_OPCODE); … … 441 464 WRITE_NETWORK_POINTER(24, (void *) writeback); 442 465 WRITE_OPCODE(pc, CR_EXTEND_OPCODE); 466 CR_UNLOCK_PACKER_CONTEXT(pc); 443 467 } 444 468 445 469 void PACK_APIENTRY crPackGetInfoLogARB(GLhandleARB obj, GLsizei maxLength, GLsizei * length, GLcharARB * infoLog, int * writeback) 446 470 { 447 GET_PACKER_CONTEXT(pc);471 CR_GET_PACKER_CONTEXT(pc); 448 472 unsigned char *data_ptr; 449 473 (void) pc; 450 GET_BUFFERED_POINTER(pc, 32);474 CR_GET_BUFFERED_POINTER(pc, 32); 451 475 WRITE_DATA(0, GLint, 32); 452 476 WRITE_DATA(4, GLenum, CR_GETINFOLOGARB_EXTEND_OPCODE); … … 456 480 WRITE_NETWORK_POINTER(24, (void *) writeback); 457 481 WRITE_OPCODE(pc, CR_EXTEND_OPCODE); 482 CR_UNLOCK_PACKER_CONTEXT(pc); 458 483 } 459 484 460 485 void PACK_APIENTRY crPackGetProgramInfoLog(GLuint program, GLsizei bufSize, GLsizei * length, char * infoLog, int * writeback) 461 486 { 462 GET_PACKER_CONTEXT(pc);487 CR_GET_PACKER_CONTEXT(pc); 463 488 unsigned char *data_ptr; 464 489 (void) pc; 465 490 (void) infoLog; 466 GET_BUFFERED_POINTER(pc, 32);491 CR_GET_BUFFERED_POINTER(pc, 32); 467 492 WRITE_DATA(0, GLint, 32); 468 493 WRITE_DATA(4, GLenum, CR_GETPROGRAMINFOLOG_EXTEND_OPCODE); … … 472 497 WRITE_NETWORK_POINTER(24, (void *) writeback); 473 498 WRITE_OPCODE(pc, CR_EXTEND_OPCODE); 499 CR_UNLOCK_PACKER_CONTEXT(pc); 474 500 } 475 501 476 502 void PACK_APIENTRY crPackGetShaderInfoLog(GLuint shader, GLsizei bufSize, GLsizei * length, char * infoLog, int * writeback) 477 503 { 478 GET_PACKER_CONTEXT(pc);504 CR_GET_PACKER_CONTEXT(pc); 479 505 unsigned char *data_ptr; 480 506 (void) pc; 481 507 (void) infoLog; 482 GET_BUFFERED_POINTER(pc, 32);508 CR_GET_BUFFERED_POINTER(pc, 32); 483 509 WRITE_DATA(0, GLint, 32); 484 510 WRITE_DATA(4, GLenum, CR_GETSHADERINFOLOG_EXTEND_OPCODE); … … 488 514 WRITE_NETWORK_POINTER(24, (void *) writeback); 489 515 WRITE_OPCODE(pc, CR_EXTEND_OPCODE); 516 CR_UNLOCK_PACKER_CONTEXT(pc); 490 517 } 491 518 492 519 void PACK_APIENTRY crPackGetShaderSource(GLuint shader, GLsizei bufSize, GLsizei * length, char * source, int * writeback) 493 520 { 494 GET_PACKER_CONTEXT(pc);521 CR_GET_PACKER_CONTEXT(pc); 495 522 unsigned char *data_ptr; 496 523 (void) pc; 497 524 (void) source; 498 GET_BUFFERED_POINTER(pc, 32);525 CR_GET_BUFFERED_POINTER(pc, 32); 499 526 WRITE_DATA(0, GLint, 32); 500 527 WRITE_DATA(4, GLenum, CR_GETSHADERSOURCE_EXTEND_OPCODE); … … 504 531 WRITE_NETWORK_POINTER(24, (void *) writeback); 505 532 WRITE_OPCODE(pc, CR_EXTEND_OPCODE); 533 CR_UNLOCK_PACKER_CONTEXT(pc); 506 534 } 507 535 508 536 void PACK_APIENTRY crPackGetUniformsLocations(GLuint program, GLsizei maxcbData, GLsizei * cbData, GLvoid * pData, int * writeback) 509 537 { 510 GET_PACKER_CONTEXT(pc);538 CR_GET_PACKER_CONTEXT(pc); 511 539 unsigned char *data_ptr; 512 540 (void) pData; 513 GET_BUFFERED_POINTER(pc, 32);541 CR_GET_BUFFERED_POINTER(pc, 32); 514 542 WRITE_DATA(0, GLint, 32); 515 543 WRITE_DATA(4, GLenum, CR_GETUNIFORMSLOCATIONS_EXTEND_OPCODE); … … 519 547 WRITE_NETWORK_POINTER(24, (void *) writeback); 520 548 WRITE_OPCODE(pc, CR_EXTEND_OPCODE); 549 CR_UNLOCK_PACKER_CONTEXT(pc); 521 550 } 522 551 523 552 void PACK_APIENTRY crPackGetAttribLocation(GLuint program, const char * name, GLint * return_value, int * writeback) 524 553 { 525 GET_PACKER_CONTEXT(pc);554 CR_GET_PACKER_CONTEXT(pc); 526 555 unsigned char *data_ptr; 527 556 int cbName = crStrlen(name)+1; 528 557 int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(program)+cbName*sizeof(*name)+16; 529 558 530 GET_BUFFERED_POINTER(pc, packet_length);559 CR_GET_BUFFERED_POINTER(pc, packet_length); 531 560 WRITE_DATA_AI(int, packet_length); 532 561 WRITE_DATA_AI(GLenum, CR_GETATTRIBLOCATION_EXTEND_OPCODE); … … 537 566 WRITE_NETWORK_POINTER(8, (void *) writeback); 538 567 WRITE_OPCODE(pc, CR_EXTEND_OPCODE); 568 CR_UNLOCK_PACKER_CONTEXT(pc); 539 569 } 540 570 541 571 void PACK_APIENTRY crPackGetUniformLocation(GLuint program, const char * name, GLint * return_value, int * writeback) 542 572 { 543 GET_PACKER_CONTEXT(pc);573 CR_GET_PACKER_CONTEXT(pc); 544 574 unsigned char *data_ptr; 545 575 int cbName = crStrlen(name)+1; 546 576 int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(program)+cbName*sizeof(*name)+16; 547 577 548 GET_BUFFERED_POINTER(pc, packet_length);578 CR_GET_BUFFERED_POINTER(pc, packet_length); 549 579 WRITE_DATA_AI(int, packet_length); 550 580 WRITE_DATA_AI(GLenum, CR_GETUNIFORMLOCATION_EXTEND_OPCODE); … … 555 585 WRITE_NETWORK_POINTER(8, (void *) writeback); 556 586 WRITE_OPCODE(pc, CR_EXTEND_OPCODE); 587 CR_UNLOCK_PACKER_CONTEXT(pc); 557 588 } 558 589 559 590 void PACK_APIENTRY crPackBindAttribLocationSWAP(GLuint program, GLuint index, const char *name) 560 591 { 561 GET_PACKER_CONTEXT(pc);592 CR_GET_PACKER_CONTEXT(pc); 562 593 (void)program; 563 594 (void)index; … … 569 600 void PACK_APIENTRY crPackShaderSourceSWAP(GLuint shader, GLsizei count, const char **string, const GLint *length) 570 601 { 571 GET_PACKER_CONTEXT(pc);602 CR_GET_PACKER_CONTEXT(pc); 572 603 (void)shader; 573 604 (void)count; … … 580 611 void PACK_APIENTRY crPackUniform1fvSWAP(GLint location, GLsizei count, const GLfloat *value) 581 612 { 582 GET_PACKER_CONTEXT(pc);613 CR_GET_PACKER_CONTEXT(pc); 583 614 (void)location; 584 615 (void)count; … … 591 622 void PACK_APIENTRY crPackUniform1ivSWAP(GLint location, GLsizei count, const GLint *value) 592 623 { 593 GET_PACKER_CONTEXT(pc);624 CR_GET_PACKER_CONTEXT(pc); 594 625 (void)location; 595 626 (void)count; … … 601 632 void PACK_APIENTRY crPackUniform2fvSWAP(GLint location, GLsizei count, const GLfloat *value) 602 633 { 603 GET_PACKER_CONTEXT(pc);634 CR_GET_PACKER_CONTEXT(pc); 604 635 (void)location; 605 636 (void)count; … … 611 642 void PACK_APIENTRY crPackUniform2ivSWAP(GLint location, GLsizei count, const GLint * value) 612 643 { 613 GET_PACKER_CONTEXT(pc);644 CR_GET_PACKER_CONTEXT(pc); 614 645 (void)location; 615 646 (void)count; … … 621 652 void PACK_APIENTRY crPackUniform3fvSWAP(GLint location, GLsizei count, const GLfloat *value) 622 653 { 623 GET_PACKER_CONTEXT(pc);654 CR_GET_PACKER_CONTEXT(pc); 624 655 (void)location; 625 656 (void)count; … … 631 662 void PACK_APIENTRY crPackUniform3ivSWAP(GLint location, GLsizei count, const GLint *value) 632 663 { 633 GET_PACKER_CONTEXT(pc);664 CR_GET_PACKER_CONTEXT(pc); 634 665 (void)location; 635 666 (void)count; … … 641 672 void PACK_APIENTRY crPackUniform4fvSWAP(GLint location, GLsizei count, const GLfloat *value) 642 673 { 643 GET_PACKER_CONTEXT(pc);674 CR_GET_PACKER_CONTEXT(pc); 644 675 (void)location; 645 676 (void)count; … … 651 682 void PACK_APIENTRY crPackUniform4ivSWAP(GLint location, GLsizei count, const GLint *value) 652 683 { 653 GET_PACKER_CONTEXT(pc);684 CR_GET_PACKER_CONTEXT(pc); 654 685 (void)location; 655 686 (void)count; … … 661 692 void PACK_APIENTRY crPackUniformMatrix2fvSWAP(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) 662 693 { 663 GET_PACKER_CONTEXT(pc);694 CR_GET_PACKER_CONTEXT(pc); 664 695 (void)location; 665 696 (void)count; … … 672 703 void PACK_APIENTRY crPackUniformMatrix3fvSWAP(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) 673 704 { 674 GET_PACKER_CONTEXT(pc);705 CR_GET_PACKER_CONTEXT(pc); 675 706 (void)location; 676 707 (void)count; … … 683 714 void PACK_APIENTRY crPackUniformMatrix4fvSWAP(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) 684 715 { 685 GET_PACKER_CONTEXT(pc);716 CR_GET_PACKER_CONTEXT(pc); 686 717 (void)location; 687 718 (void)count; … … 694 725 void PACK_APIENTRY crPackUniformMatrix2x3fvSWAP(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) 695 726 { 696 GET_PACKER_CONTEXT(pc);727 CR_GET_PACKER_CONTEXT(pc); 697 728 (void)location; 698 729 (void)count; … … 705 736 void PACK_APIENTRY crPackUniformMatrix3x2fvSWAP(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) 706 737 { 707 GET_PACKER_CONTEXT(pc);738 CR_GET_PACKER_CONTEXT(pc); 708 739 (void)location; 709 740 (void)count; … … 716 747 void PACK_APIENTRY crPackUniformMatrix2x4fvSWAP(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) 717 748 { 718 GET_PACKER_CONTEXT(pc);749 CR_GET_PACKER_CONTEXT(pc); 719 750 (void)location; 720 751 (void)count; … … 727 758 void PACK_APIENTRY crPackUniformMatrix4x2fvSWAP(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) 728 759 { 729 GET_PACKER_CONTEXT(pc);760 CR_GET_PACKER_CONTEXT(pc); 730 761 (void)location; 731 762 (void)count; … … 738 769 void PACK_APIENTRY crPackUniformMatrix3x4fvSWAP(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) 739 770 { 740 GET_PACKER_CONTEXT(pc);771 CR_GET_PACKER_CONTEXT(pc); 741 772 (void)location; 742 773 (void)count; … … 749 780 void PACK_APIENTRY crPackUniformMatrix4x3fvSWAP(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) 750 781 { 751 GET_PACKER_CONTEXT(pc);782 CR_GET_PACKER_CONTEXT(pc); 752 783 (void)location; 753 784 (void)count; … … 760 791 void PACK_APIENTRY crPackDrawBuffersSWAP(GLsizei n, const GLenum *bufs) 761 792 { 762 GET_PACKER_CONTEXT(pc);793 CR_GET_PACKER_CONTEXT(pc); 763 794 (void)n; 764 795 (void)bufs; … … 769 800 void PACK_APIENTRY crPackGetAttribLocationSWAP(GLuint program, const char * name, GLint * return_value, int * writeback) 770 801 { 771 GET_PACKER_CONTEXT(pc);802 CR_GET_PACKER_CONTEXT(pc); 772 803 (void)program; 773 804 (void)name; … … 780 811 void PACK_APIENTRY crPackGetUniformLocationSWAP(GLuint program, const char * name, GLint * return_value, int * writeback) 781 812 { 782 GET_PACKER_CONTEXT(pc);813 CR_GET_PACKER_CONTEXT(pc); 783 814 (void)program; 784 815 (void)name; -
trunk/src/VBox/GuestHost/OpenGL/packer/pack_stipple.c
r27983 r33475 12 12 void PACK_APIENTRY crPackPolygonStipple( const GLubyte *mask ) 13 13 { 14 GET_PACKER_CONTEXT(pc);14 CR_GET_PACKER_CONTEXT(pc); 15 15 unsigned char *data_ptr; 16 16 int nodata = crStateIsBufferBound(GL_PIXEL_UNPACK_BUFFER_ARB); … … 22 22 packet_length += 32*32/8; 23 23 24 GET_BUFFERED_POINTER(pc, packet_length );24 CR_GET_BUFFERED_POINTER(pc, packet_length ); 25 25 WRITE_DATA_AI(int, nodata); 26 26 if (nodata) … … 33 33 } 34 34 WRITE_OPCODE( pc, CR_POLYGONSTIPPLE_OPCODE ); 35 CR_UNLOCK_PACKER_CONTEXT(pc); 35 36 } -
trunk/src/VBox/GuestHost/OpenGL/packer/pack_swap_lists.c
r33457 r33475 87 87 void PACK_APIENTRY crPackNewListSWAP( GLuint list, GLenum mode ) 88 88 { 89 GET_PACKER_CONTEXT(pc);89 CR_GET_PACKER_CONTEXT(pc); 90 90 unsigned char *data_ptr; 91 91 (void) pc; 92 GET_BUFFERED_POINTER( pc, 16 );92 CR_GET_BUFFERED_POINTER( pc, 16 ); 93 93 WRITE_DATA( 0, GLint, SWAP32(16) ); 94 94 WRITE_DATA( 4, GLenum, SWAP32(CR_NEWLIST_EXTEND_OPCODE) ); … … 98 98 pc->buffer.in_List = GL_TRUE; 99 99 pc->buffer.holds_List = GL_TRUE; 100 CR_UNLOCK_PACKER_CONTEXT(pc); 100 101 } 101 102 … … 103 104 void PACK_APIENTRY crPackEndListSWAP( void ) 104 105 { 105 GET_PACKER_CONTEXT(pc);106 CR_GET_PACKER_CONTEXT(pc); 106 107 unsigned char *data_ptr; 107 108 (void) pc; 108 GET_BUFFERED_POINTER( pc, 8 );109 CR_GET_BUFFERED_POINTER( pc, 8 ); 109 110 WRITE_DATA( 0, GLint, SWAP32(8) ); 110 111 WRITE_DATA( 4, GLenum, SWAP32(CR_ENDLIST_EXTEND_OPCODE) ); 111 112 WRITE_OPCODE( pc, CR_EXTEND_OPCODE ); 112 113 pc->buffer.in_List = GL_FALSE; 114 CR_UNLOCK_PACKER_CONTEXT(pc); 113 115 } -
trunk/src/VBox/GuestHost/OpenGL/packer/pack_swap_texture.c
r33457 r33475 285 285 static void __handleTexEnvData( GLenum target, GLenum pname, const GLfloat *params ) 286 286 { 287 GET_PACKER_CONTEXT(pc);287 CR_GET_PACKER_CONTEXT(pc); 288 288 unsigned char *data_ptr; 289 289 int num_params; … … 303 303 packet_length += num_params*sizeof(*params); 304 304 305 GET_BUFFERED_POINTER(pc, packet_length );305 CR_GET_BUFFERED_POINTER(pc, packet_length ); 306 306 WRITE_DATA( 0, int, SWAP32(packet_length) ); 307 307 WRITE_DATA( sizeof( int ) + 0, GLenum, SWAP32(target) ); … … 317 317 const GLfloat *params ) 318 318 { 319 GET_PACKER_CONTEXT(pc);319 CR_GET_PACKER_CONTEXT(pc); 320 320 __handleTexEnvData( target, pname, params ); 321 321 WRITE_OPCODE( pc, CR_TEXENVFV_OPCODE ); 322 CR_UNLOCK_PACKER_CONTEXT(pc); 322 323 } 323 324 … … 326 327 { 327 328 /* 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); 329 330 __handleTexEnvData( target, pname, (const GLfloat *) params ); 330 331 WRITE_OPCODE( pc, CR_TEXENVIV_OPCODE ); 332 CR_UNLOCK_PACKER_CONTEXT(pc); 331 333 } 332 334 … … 370 372 int sizeof_param, const GLvoid *params ) 371 373 { 372 GET_PACKER_CONTEXT(pc);374 CR_GET_PACKER_CONTEXT(pc); 373 375 unsigned char *data_ptr; 374 376 int packet_length = sizeof( int ) + sizeof( coord ) + sizeof( pname ); … … 381 383 packet_length += num_params * sizeof_param; 382 384 383 GET_BUFFERED_POINTER(pc, packet_length );385 CR_GET_BUFFERED_POINTER(pc, packet_length ); 384 386 WRITE_DATA( 0, int, SWAP32(packet_length) ); 385 387 WRITE_DATA( sizeof( int ) + 0, GLenum, SWAP32(coord) ); … … 394 396 const GLdouble *params ) 395 397 { 396 GET_PACKER_CONTEXT(pc);398 CR_GET_PACKER_CONTEXT(pc); 397 399 __handleTexGenData( coord, pname, sizeof( *params ), params ); 398 400 WRITE_OPCODE( pc, CR_TEXGENDV_OPCODE ); 401 CR_UNLOCK_PACKER_CONTEXT(pc); 399 402 } 400 403 … … 402 405 const GLfloat *params ) 403 406 { 404 GET_PACKER_CONTEXT(pc);407 CR_GET_PACKER_CONTEXT(pc); 405 408 __handleTexGenData( coord, pname, sizeof( *params ), params ); 406 409 WRITE_OPCODE( pc, CR_TEXGENFV_OPCODE ); 410 CR_UNLOCK_PACKER_CONTEXT(pc); 407 411 } 408 412 … … 410 414 const GLint *params ) 411 415 { 412 GET_PACKER_CONTEXT(pc);416 CR_GET_PACKER_CONTEXT(pc); 413 417 __handleTexGenData( coord, pname, sizeof( *params ), params ); 414 418 WRITE_OPCODE( pc, CR_TEXGENIV_OPCODE ); 419 CR_UNLOCK_PACKER_CONTEXT(pc); 415 420 } 416 421 … … 432 437 static GLboolean __handleTexParameterData( GLenum target, GLenum pname, const GLfloat *params ) 433 438 { 434 GET_PACKER_CONTEXT(pc);439 CR_GET_PACKER_CONTEXT(pc); 435 440 unsigned char *data_ptr; 436 441 int packet_length = sizeof( int ) + sizeof( target ) + sizeof( pname ); … … 495 500 packet_length += num_params * sizeof(*params); 496 501 497 GET_BUFFERED_POINTER(pc, packet_length );502 CR_GET_BUFFERED_POINTER(pc, packet_length ); 498 503 WRITE_DATA( 0, int, SWAP32(packet_length) ); 499 504 WRITE_DATA( sizeof( int ) + 0, GLenum, SWAP32(target) ); … … 509 514 const GLfloat *params ) 510 515 { 511 GET_PACKER_CONTEXT(pc);516 CR_GET_PACKER_CONTEXT(pc); 512 517 if (__handleTexParameterData( target, pname, params )) 513 518 WRITE_OPCODE( pc, CR_TEXPARAMETERFV_OPCODE ); 519 CR_UNLOCK_PACKER_CONTEXT(pc); 514 520 } 515 521 … … 517 523 const GLint *params ) 518 524 { 519 GET_PACKER_CONTEXT(pc);525 CR_GET_PACKER_CONTEXT(pc); 520 526 if (__handleTexParameterData( target, pname, (GLfloat *) params )) 521 527 WRITE_OPCODE( pc, CR_TEXPARAMETERIV_OPCODE ); 528 CR_UNLOCK_PACKER_CONTEXT(pc); 522 529 } 523 530 … … 654 661 void PACK_APIENTRY crPackAreTexturesResidentSWAP( GLsizei n, const GLuint *textures, GLboolean *residences, GLboolean *return_val, int *writeback ) 655 662 { 656 GET_PACKER_CONTEXT(pc);663 CR_GET_PACKER_CONTEXT(pc); 657 664 unsigned char *data_ptr; 658 665 int packet_length; … … 666 673 8 + 8 + 8; /* return pointers */ 667 674 668 GET_BUFFERED_POINTER(pc, packet_length);675 CR_GET_BUFFERED_POINTER(pc, packet_length); 669 676 WRITE_DATA( 0, int, SWAP32(packet_length) ); 670 677 WRITE_DATA( sizeof( int ) + 0, GLenum, SWAP32(CR_ARETEXTURESRESIDENT_EXTEND_OPCODE) ); … … 678 685 WRITE_NETWORK_POINTER( sizeof( int ) + 24 + n*sizeof( *textures ), (void *) writeback ); 679 686 WRITE_OPCODE( pc, CR_EXTEND_OPCODE ); 687 CR_UNLOCK_PACKER_CONTEXT(pc); 680 688 } 681 689 … … 963 971 void PACK_APIENTRY crPackGetCompressedTexImageARBSWAP( GLenum target, GLint level, GLvoid *img, int *writeback ) 964 972 { 965 GET_PACKER_CONTEXT(pc);973 CR_GET_PACKER_CONTEXT(pc); 966 974 crError ( "GetCompressedTexImageARB needs to be special cased!"); 967 975 (void) pc; -
trunk/src/VBox/GuestHost/OpenGL/packer/pack_texture.c
r27983 r33475 298 298 __handleTexEnvData(GLenum target, GLenum pname, const GLfloat * params) 299 299 { 300 GET_PACKER_CONTEXT(pc);300 CR_GET_PACKER_CONTEXT(pc); 301 301 unsigned char *data_ptr; 302 302 int params_length; … … 318 318 packet_length += params_length; 319 319 320 GET_BUFFERED_POINTER(pc, packet_length);320 CR_GET_BUFFERED_POINTER(pc, packet_length); 321 321 WRITE_DATA(0, int, packet_length); 322 322 WRITE_DATA(sizeof(int) + 0, GLenum, target); … … 329 329 crPackTexEnvfv(GLenum target, GLenum pname, const GLfloat * params) 330 330 { 331 GET_PACKER_CONTEXT(pc);331 CR_GET_PACKER_CONTEXT(pc); 332 332 __handleTexEnvData(target, pname, params); 333 333 WRITE_OPCODE(pc, CR_TEXENVFV_OPCODE); 334 CR_UNLOCK_PACKER_CONTEXT(pc); 334 335 } 335 336 … … 338 339 { 339 340 /* 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); 341 342 __handleTexEnvData(target, pname, (const GLfloat *) params); 342 343 WRITE_OPCODE(pc, CR_TEXENVIV_OPCODE); 344 CR_UNLOCK_PACKER_CONTEXT(pc); 343 345 } 344 346 … … 380 382 int sizeof_param, const GLvoid * params) 381 383 { 382 GET_PACKER_CONTEXT(pc);384 CR_GET_PACKER_CONTEXT(pc); 383 385 unsigned char *data_ptr; 384 386 int packet_length = … … 391 393 } 392 394 393 GET_BUFFERED_POINTER(pc, packet_length);395 CR_GET_BUFFERED_POINTER(pc, packet_length); 394 396 WRITE_DATA(0, int, packet_length); 395 397 WRITE_DATA(sizeof(int) + 0, GLenum, coord); … … 401 403 crPackTexGendv(GLenum coord, GLenum pname, const GLdouble * params) 402 404 { 403 GET_PACKER_CONTEXT(pc);405 CR_GET_PACKER_CONTEXT(pc); 404 406 __handleTexGenData(coord, pname, sizeof(*params), params); 405 407 WRITE_OPCODE(pc, CR_TEXGENDV_OPCODE); 408 CR_UNLOCK_PACKER_CONTEXT(pc); 406 409 } 407 410 … … 409 412 crPackTexGenfv(GLenum coord, GLenum pname, const GLfloat * params) 410 413 { 411 GET_PACKER_CONTEXT(pc);414 CR_GET_PACKER_CONTEXT(pc); 412 415 __handleTexGenData(coord, pname, sizeof(*params), params); 413 416 WRITE_OPCODE(pc, CR_TEXGENFV_OPCODE); 417 CR_UNLOCK_PACKER_CONTEXT(pc); 414 418 } 415 419 … … 417 421 crPackTexGeniv(GLenum coord, GLenum pname, const GLint * params) 418 422 { 419 GET_PACKER_CONTEXT(pc);423 CR_GET_PACKER_CONTEXT(pc); 420 424 __handleTexGenData(coord, pname, sizeof(*params), params); 421 425 WRITE_OPCODE(pc, CR_TEXGENIV_OPCODE); 426 CR_UNLOCK_PACKER_CONTEXT(pc); 422 427 } 423 428 … … 443 448 __handleTexParameterData(GLenum target, GLenum pname, const GLfloat * params) 444 449 { 445 GET_PACKER_CONTEXT(pc);450 CR_GET_PACKER_CONTEXT(pc); 446 451 unsigned char *data_ptr; 447 452 int packet_length = sizeof(int) + sizeof(target) + sizeof(pname); … … 504 509 packet_length += num_params * sizeof(*params); 505 510 506 GET_BUFFERED_POINTER(pc, packet_length);511 CR_GET_BUFFERED_POINTER(pc, packet_length); 507 512 WRITE_DATA(0, int, packet_length); 508 513 WRITE_DATA(sizeof(int) + 0, GLenum, target); … … 515 520 crPackTexParameterfv(GLenum target, GLenum pname, const GLfloat * params) 516 521 { 517 GET_PACKER_CONTEXT(pc);522 CR_GET_PACKER_CONTEXT(pc); 518 523 if (__handleTexParameterData(target, pname, params)) 519 524 WRITE_OPCODE(pc, CR_TEXPARAMETERFV_OPCODE); 525 CR_UNLOCK_PACKER_CONTEXT(pc); 520 526 } 521 527 … … 523 529 crPackTexParameteriv(GLenum target, GLenum pname, const GLint * params) 524 530 { 525 GET_PACKER_CONTEXT(pc);531 CR_GET_PACKER_CONTEXT(pc); 526 532 if (__handleTexParameterData(target, pname, (GLfloat *) params)) 527 533 WRITE_OPCODE(pc, CR_TEXPARAMETERIV_OPCODE); 534 CR_UNLOCK_PACKER_CONTEXT(pc); 528 535 } 529 536 … … 688 695 int *writeback) 689 696 { 690 GET_PACKER_CONTEXT(pc);697 CR_GET_PACKER_CONTEXT(pc); 691 698 unsigned char *data_ptr; 692 699 int packet_length; … … 700 707 8 + 8; 701 708 702 GET_BUFFERED_POINTER(pc, packet_length);709 CR_GET_BUFFERED_POINTER(pc, packet_length); 703 710 WRITE_DATA(0, int, packet_length); 704 711 WRITE_DATA(4, GLenum, CR_ARETEXTURESRESIDENT_EXTEND_OPCODE); … … 708 715 WRITE_NETWORK_POINTER(20 + n * sizeof(*textures), (void *) writeback); 709 716 WRITE_OPCODE(pc, CR_EXTEND_OPCODE); 717 CR_UNLOCK_PACKER_CONTEXT(pc); 710 718 } 711 719 … … 1002 1010 void PACK_APIENTRY crPackGetCompressedTexImageARB( GLenum target, GLint level, GLvoid *img, int *writeback ) 1003 1011 { 1004 GET_PACKER_CONTEXT(pc);1012 CR_GET_PACKER_CONTEXT(pc); 1005 1013 int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(target)+sizeof(level)+2*8; 1006 1014 unsigned char *data_ptr; 1007 GET_BUFFERED_POINTER( pc, packet_length );1015 CR_GET_BUFFERED_POINTER( pc, packet_length ); 1008 1016 1009 1017 WRITE_DATA_AI(int, packet_length); … … 1014 1022 WRITE_NETWORK_POINTER(8, (void *) writeback ); 1015 1023 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 27 27 GLint i, size, cnt; 28 28 29 GET_PACKER_CONTEXT(pc);29 CR_GET_PACKER_CONTEXT(pc); 30 30 unsigned char *data_ptr; 31 31 (void) pc; 32 32 size = 16 + cRects * 4 * sizeof(GLint); 33 GET_BUFFERED_POINTER( pc, size );33 CR_GET_BUFFERED_POINTER( pc, size ); 34 34 WRITE_DATA( 0, GLint, size ); 35 35 WRITE_DATA( 4, GLenum, CR_WINDOWVISIBLEREGION_EXTEND_OPCODE ); … … 47 47 } 48 48 WRITE_OPCODE( pc, CR_EXTEND_OPCODE ); 49 CR_UNLOCK_PACKER_CONTEXT(pc); 49 50 } 50 51 -
trunk/src/VBox/GuestHost/OpenGL/packer/packer.py
r20815 r33475 118 118 print 'void PACK_APIENTRY crPack%s( %s )' % (func_name, apiutil.MakeDeclarationString(params)) 119 119 print '{' 120 print '\t GET_PACKER_CONTEXT(pc);'120 print '\tCR_GET_PACKER_CONTEXT(pc);' 121 121 122 122 # Save original function name … … 168 168 169 169 if packet_length == 0 and not is_extended: 170 print "\t GET_BUFFERED_POINTER_NO_ARGS( pc );"170 print "\tCR_GET_BUFFERED_POINTER_NO_ARGS( pc );" 171 171 elif func_name[:9] == "Translate" or func_name[:5] == "Color": 172 172 # XXX WTF is the purpose of this? 173 173 if is_extended: 174 174 packet_length += 8 175 print "\t GET_BUFFERED_POINTER_NO_BEGINEND_FLUSH( pc, %d);" % packet_length175 print "\tCR_GET_BUFFERED_POINTER_NO_BEGINEND_FLUSH( pc, %d, GL_TRUE );" % packet_length 176 176 else: 177 177 if is_extended: 178 178 packet_length += 8 179 print "\t GET_BUFFERED_POINTER( pc, %d );" % packet_length179 print "\tCR_GET_BUFFERED_POINTER( pc, %d );" % packet_length 180 180 UpdateCurrentPointer( func_name ) 181 181 … … 209 209 else: 210 210 print "\tWRITE_OPCODE( pc, %s );" % apiutil.OpcodeName( func_name ) 211 212 print '\tCR_UNLOCK_PACKER_CONTEXT(pc);' 211 213 print '}\n' 212 214 -
trunk/src/VBox/GuestHost/OpenGL/packer/packer_bbox.py
r15532 r33475 167 167 168 168 169 print "\t GET_PACKER_CONTEXT(pc);"169 print "\tCR_GET_PACKER_CONTEXT(pc);" 170 170 print "\tunsigned char *data_ptr;" 171 171 … … 195 195 print "\tCREATE_%dD_FLOATS();" % num_coords 196 196 197 print "\t GET_BUFFERED%s_POINTER( pc, %d );" % (countSuffix, packet_length)197 print "\tCR_GET_BUFFERED%s_POINTER( pc, %d );" % (countSuffix, packet_length) 198 198 199 199 # Bounding box code … … 260 260 else: 261 261 print "\tWRITE_OPCODE( pc, %s );" % apiutil.OpcodeName( func_name ) 262 263 print "\tCR_UNLOCK_PACKER_CONTEXT(pc);" 264 262 265 263 266 print '}\n'
Note:
See TracChangeset
for help on using the changeset viewer.