Changeset 39265 in vbox for trunk/src/VBox/GuestHost/OpenGL
- Timestamp:
- Nov 10, 2011 3:40:22 PM (13 years ago)
- Location:
- trunk/src/VBox/GuestHost/OpenGL
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/OpenGL/include/cr_pack.h
r33475 r39265 51 51 typedef void (*CRPackErrorHandlerFunc)(int line, const char *file, GLenum error, const char *info); 52 52 53 53 typedef enum 54 { 55 CRPackBeginEndStateNone = 0, /* not in begin end */ 56 CRPackBeginEndStateStarted, /* begin issued */ 57 CRPackBeginEndStateFlushDone /* begin issued & buffer flash is done thus part of commands is issued to host */ 58 } CRPackBeginEndState; 54 59 /** 55 60 * Packer context … … 63 68 CRPackErrorHandlerFunc Error; 64 69 CRCurrentStatePointers current; 70 CRPackBeginEndState enmBeginEndState; 65 71 GLvectorf bounds_min, bounds_max; 66 72 int updateBBOX; … … 203 209 pc->Flush( pc->flush_arg ); \ 204 210 CRASSERT(crPackCanHoldOpcode( pc, 1, (len) ) ); \ 211 if (pc->enmBeginEndState == CRPackBeginEndStateStarted) { \ 212 pc->enmBeginEndState = CRPackBeginEndStateFlushDone; \ 213 } \ 205 214 } \ 206 215 data_ptr = pc->buffer.data_current; \ … … 218 227 CRASSERT( pc->currentBuffer ); \ 219 228 if ( pc->buffer.holds_BeginEnd && !pc->buffer.in_BeginEnd ) { \ 229 CRASSERT( 0 ); /* should never be here currently */ \ 220 230 pc->Flush( pc->flush_arg ); \ 221 231 pc->buffer.holds_BeginEnd = 0; \ … … 231 241 CRASSERT( pc->currentBuffer ); \ 232 242 if ( pc->buffer.holds_BeginEnd && !pc->buffer.in_BeginEnd ) { \ 243 CRASSERT( 0 ); /* should never be here currently */ \ 233 244 pc->Flush( pc->flush_arg ); \ 234 245 pc->buffer.holds_BeginEnd = 0; \ … … 248 259 pc->Flush( pc->flush_arg ); \ 249 260 CRASSERT( crPackCanHoldOpcode( pc, 1, (len) ) ); \ 261 if (pc->enmBeginEndState == CRPackBeginEndStateStarted) { \ 262 pc->enmBeginEndState = CRPackBeginEndStateFlushDone; \ 263 } \ 250 264 } \ 251 265 data_ptr = pc->buffer.data_current; \ -
trunk/src/VBox/GuestHost/OpenGL/packer/pack_beginend.c
r33475 r39265 21 21 } 22 22 CR_GET_BUFFERED_POINTER( pc, 4 ); 23 CRASSERT(pc->enmBeginEndState == CRPackBeginEndStateNone); 24 pc->enmBeginEndState = CRPackBeginEndStateStarted; 23 25 pc->current.begin_data = data_ptr; 24 26 pc->current.begin_op = pc->buffer.opcode_current; … … 42 44 } 43 45 CR_GET_BUFFERED_POINTER( pc, 4 ); 46 CRASSERT(pc->enmBeginEndState == CRPackBeginEndStateNone); 47 pc->enmBeginEndState = CRPackBeginEndStateStarted; 44 48 pc->current.begin_data = data_ptr; 45 49 pc->current.begin_op = pc->buffer.opcode_current; … … 58 62 WRITE_OPCODE( pc, CR_END_OPCODE ); 59 63 pc->buffer.in_BeginEnd = 0; 64 CRASSERT(pc->enmBeginEndState == CRPackBeginEndStateStarted 65 || pc->enmBeginEndState == CRPackBeginEndStateFlushDone); 66 if (pc->enmBeginEndState == CRPackBeginEndStateFlushDone) 67 { 68 pc->Flush( pc->flush_arg ); 69 } 70 pc->enmBeginEndState = CRPackBeginEndStateNone; 60 71 CR_UNLOCK_PACKER_CONTEXT(pc); 61 72 } … … 69 80 WRITE_OPCODE( pc, CR_END_OPCODE ); 70 81 pc->buffer.in_BeginEnd = 0; 82 CRASSERT(pc->enmBeginEndState == CRPackBeginEndStateStarted 83 || pc->enmBeginEndState == CRPackBeginEndStateFlushDone); 84 if (pc->enmBeginEndState == CRPackBeginEndStateFlushDone) 85 { 86 pc->Flush( pc->flush_arg ); 87 } 71 88 CR_UNLOCK_PACKER_CONTEXT(pc); 72 89 } -
trunk/src/VBox/GuestHost/OpenGL/packer/pack_init.c
r33475 r39265 29 29 crMemZero( pc, sizeof(CRPackContext)); 30 30 #endif 31 pc->enmBeginEndState = CRPackBeginEndStateNone; 31 32 pc->swapping = swapping; 32 33 pc->Flush = NULL;
Note:
See TracChangeset
for help on using the changeset viewer.