Changeset 37986 in vbox for trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_misc.c
- Timestamp:
- Jul 15, 2011 3:14:35 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_misc.c
r37760 r37986 104 104 } 105 105 106 #define PACK_FORCED_SYNC 107 106 108 void PACKSPU_APIENTRY packspu_Flush( void ) 107 109 { 108 110 GET_THREAD(thread); 109 111 int writeback = 1; 112 int found=0; 110 113 111 114 if (!thread->bInjectThread) … … 126 129 crLockMutex(&_PackMutex); 127 130 128 /*Make sure we process commands in order they should appear, so flush thread being injectedfirst*/131 /*Make sure we process commands in order they should appear, so flush other threads first*/ 129 132 for (i=0; i<MAX_THREADS; ++i) 130 133 { 131 134 if (pack_spu.thread[i].inUse 132 135 && (thread != &pack_spu.thread[i]) && pack_spu.thread[i].netServer.conn 133 && (pack_spu.thread[i].netServer.conn->u32ClientID == thread->netServer.conn->u32InjectClientID)134 136 && pack_spu.thread[i].packer && pack_spu.thread[i].packer->currentBuffer) 135 137 { 138 #ifdef PACK_FORCED_SYNC 139 CRPackContext *pc = pack_spu.thread[i].packer; 140 unsigned char *data_ptr; 141 142 CR_GET_BUFFERED_POINTER( pc, 16 ); 143 WRITE_DATA( 0, GLint, 16 ); 144 WRITE_DATA( 4, GLenum, CR_WRITEBACK_EXTEND_OPCODE ); 145 WRITE_NETWORK_POINTER( 8, (void *) &writeback ); 146 WRITE_OPCODE( pc, CR_EXTEND_OPCODE ); 147 CR_UNLOCK_PACKER_CONTEXT(pc); 148 #endif 136 149 packspuFlush((void *) &pack_spu.thread[i]); 137 break; 150 151 if (pack_spu.thread[i].netServer.conn->u32ClientID == thread->netServer.conn->u32InjectClientID) 152 { 153 found=1; 154 } 155 156 #ifdef PACK_FORCED_SYNC 157 while (writeback) 158 crNetRecv(); 159 #endif 138 160 } 139 161 } 140 162 141 if ( i>=MAX_THREADS)163 if (!found) 142 164 { 143 165 /*Thread we're supposed to inject commands for has been detached, … … 147 169 } 148 170 171 #ifdef PACK_FORCED_SYNC 172 writeback = 1; 173 crPackWriteback(&writeback); 174 #endif 175 packspuFlush((void *) thread); 176 177 #ifdef PACK_FORCED_SYNC 178 while (writeback) 179 crNetRecv(); 180 #endif 149 181 crUnlockMutex(&_PackMutex); 150 151 packspuFlush((void *) thread);152 182 } 153 183 }
Note:
See TracChangeset
for help on using the changeset viewer.