void PACKSPU_APIENTRY packspu_Finish( void ) { GET_THREAD(thread); GLint writeback = pack_spu.thread[pack_spu.idxThreadInUse].netServer.conn->actual_network; if (pack_spu.swap) { crPackFinishSWAP(); } else { crPackFinish(); } if (packspuSyncOnFlushes()) { if (writeback) { if (pack_spu.swap) crPackWritebackSWAP(&writeback); else crPackWriteback(&writeback); packspuFlush( (void *) thread ); while (writeback) crNetRecv(); } } }
void PACKSPU_APIENTRY packspu_Finish( void ) { GET_THREAD(thread); GLint writeback = CRPACKSPU_IS_WDDM_CRHGSMI() ? 1 : pack_spu.thread[pack_spu.idxThreadInUse].netServer.conn->actual_network; if (pack_spu.swap) { crPackFinishSWAP(); } else { crPackFinish(); } if (packspuSyncOnFlushes()) { if (writeback) { if (pack_spu.swap) crPackWritebackSWAP(&writeback); else crPackWriteback(&writeback); packspuFlush( (void *) thread ); CRPACKSPU_WRITEBACK_WAIT(thread, writeback); } } }
/** * Implementation of glFinish for tilesorter */ void TILESORTSPU_APIENTRY tilesortspu_Finish(void) { GET_THREAD(thread); GLint writeback = tilesort_spu.num_servers; tilesortspuFlush( thread ); if (tilesort_spu.swap) { crPackFinishSWAP( ); } else { crPackFinish( ); } if (tilesort_spu.syncOnFinish) { if (tilesort_spu.swap) { crPackWritebackSWAP( &writeback ); } else { crPackWriteback( &writeback ); } } tilesortspuBroadcastGeom(0); tilesortspuShipBuffers(); if (tilesort_spu.syncOnFinish) { while(writeback) { crNetRecv(); } } }
void REPLICATESPU_APIENTRY replicatespu_Finish( void ) { unsigned int i; GET_THREAD(thread); replicatespuFlushAll( (void *) thread ); for (i = 0; i < CR_MAX_REPLICANTS; i++) { int writeback = 1; if (!IS_CONNECTED(replicate_spu.rserver[i].conn)) continue; if (replicate_spu.swap) { crPackFinishSWAP(); crPackWritebackSWAP( &writeback ); } else { crPackFinish(); crPackWriteback( &writeback ); } replicatespuFlushOne(thread, i); while (writeback) crNetRecv(); } }
void PACKSPU_APIENTRY packspu_Finish( void ) { GET_THREAD(thread); GLint writeback = pack_spu.thread[0].netServer.conn->actual_network; if (pack_spu.swap) { crPackFinishSWAP( ); if (writeback) crPackWritebackSWAP( &writeback ); } else { crPackFinish( ); if (writeback) crPackWriteback( &writeback ); } packspuFlush( (void *) thread ); while (writeback) crNetRecv(); }
/** * Implementation of SwapBuffers for tilesorter * * \param window * \param flags */ void TILESORTSPU_APIENTRY tilesortspu_SwapBuffers( GLint window, GLint flags ) { GET_THREAD(thread); GLint writeback = tilesort_spu.num_servers; WindowInfo *winInfo; int serverWindow; tilesortspuFlush( thread ); winInfo = tilesortspuGetWindowInfo(window, 0); CRASSERT(winInfo); /* NOTE: winInfo->server[n].window should be the same for all n! */ serverWindow = winInfo->server[0].window; /* Here's where we force quad-buffered stereo rendering. * We use an X trick to make the app draw each frame twice. */ if (winInfo->forceQuadBuffering) { if (winInfo->parity == 0) { /* we're swapping after drawing an even-numbered frame. * Even frames are for left eye, odd frames are for right eye. * Now, switch draw buffer to the right. */ /* crDebug("Swap: done with left. Send expose to 0x%x", (int) winInfo->xwin); */ tilesortspu_DrawBuffer(GL_BACK_RIGHT); /* * Trigger drawing the right view by sending an expose event to * the app to trick it into redrawing. */ #ifdef WINDOWS /** XXX \todo is there a Window equivalent here??? */ #elif defined(Darwin) /** XXX \todo is there a Darwin equivalent here??? */ #else CRASSERT(winInfo->dpy); CRASSERT(winInfo->xwin); XClearArea( winInfo->dpy, winInfo->xwin, 0, 0, winInfo->lastWidth, winInfo->lastHeight, True ); XSync(winInfo->dpy, 0); #endif } else { /* crDebug("Swap: done with right, now left"); */ /* We're swapping after drawing an odd frame. * Now, switch draw buffer back to the left. */ tilesortspu_DrawBuffer(GL_BACK_LEFT); } /* flip parity bit for next frame */ winInfo->parity = !winInfo->parity; /* only swap prior to even (left) frames */ if (winInfo->parity) return; } if (tilesort_spu.swap) crPackSwapBuffersSWAP( serverWindow, flags ); else crPackSwapBuffers( serverWindow, flags ); if (tilesort_spu.syncOnSwap) { if (tilesort_spu.swap) crPackWritebackSWAP( &writeback ); else crPackWriteback( &writeback ); } tilesortspuBroadcastGeom(0); tilesortspuShipBuffers(); if (tilesort_spu.syncOnSwap) { while(writeback) crNetRecv(); } /* want to emit a parameteri here */ if (tilesort_spu.emit_GATHER_POST_SWAPBUFFERS) { if (tilesort_spu.swap) crPackChromiumParameteriCRSWAP(GL_GATHER_POST_SWAPBUFFERS_CR, serverWindow); else crPackChromiumParameteriCR(GL_GATHER_POST_SWAPBUFFERS_CR, serverWindow); } }