/* * Called via unpacker module. * Note: when there's a tilesort SPU upstream, the viewport dimensions * will typically match the mural size. That is, the viewport dimensions * probably won't be the same values that the application issues. */ void SERVER_DISPATCH_APIENTRY crServerDispatchViewport( GLint x, GLint y, GLsizei width, GLsizei height ) { CRMuralInfo *mural = cr_server.curClient->currentMural; CRContext *ctx = crStateGetCurrent(); if (ctx->viewport.viewportX != x || ctx->viewport.viewportY != y || ctx->viewport.viewportW != width || ctx->viewport.viewportH != height) { /* Note -- If there are tiles, this will be overridden in the * process of decoding the BoundsInfo packet, so no worries. */ crStateViewport( x, y, width, height ); mural->viewportValidated = GL_FALSE; } if (mural->numExtents == 0) { /* non-tiling arrangment */ cr_server.head_spu->dispatch_table.Viewport(x, y, width, height); } else { if (!mural->viewportValidated) { CRViewportState *vp = &(cr_server.curClient->currentCtx->viewport); crServerComputeViewportBounds(vp, mural); crServerSetOutputBounds(mural, 0); } } }
/* * Called via unpacker module. * Note: when there's a tilesort SPU upstream, the viewport dimensions * will typically match the mural size. That is, the viewport dimensions * probably won't be the same values that the application issues. */ void SERVER_DISPATCH_APIENTRY crServerDispatchViewport( GLint x, GLint y, GLsizei width, GLsizei height ) { CRMuralInfo *mural = cr_server.curClient->currentMural; CRContext *ctx = crStateGetCurrent(); if (ctx->viewport.viewportX != x || ctx->viewport.viewportY != y || ctx->viewport.viewportW != width || ctx->viewport.viewportH != height) { /* Note -- If there are tiles, this will be overridden in the * process of decoding the BoundsInfo packet, so no worries. */ crStateViewport( x, y, width, height ); } /* always dispatch to be safe */ cr_server.head_spu->dispatch_table.Viewport( x, y, width, height ); }
void FEEDBACKSPU_APIENTRY feedbackspu_Viewport( GLint x, GLint y, GLsizei width, GLsizei height ) { crStateViewport( x, y, width, height ); feedback_spu.super.Viewport( x, y, width, height ); }
int32_t crVBoxServerClientWrite(uint32_t u32ClientID, uint8_t *pBuffer, uint32_t cbBuffer) { CRClient *pClient = NULL; int32_t i; #ifdef VBOXCR_LOGFPS uint64_t tstart, tend; #endif /*crDebug("=>crServer: ClientWrite u32ClientID=%d", u32ClientID);*/ for (i = 0; i < cr_server.numClients; i++) { if (cr_server.clients[i] && cr_server.clients[i]->conn && cr_server.clients[i]->conn->u32ClientID==u32ClientID) { pClient = cr_server.clients[i]; break; } } if (!pClient) return VERR_INVALID_PARAMETER; if (!pClient->conn->vMajor) return VERR_NOT_SUPPORTED; #ifdef VBOXCR_LOGFPS tstart = RTTimeNanoTS(); #endif CRASSERT(pBuffer); /* This should never fire unless we start to multithread */ CRASSERT(pClient->conn->pBuffer==NULL && pClient->conn->cbBuffer==0); /* Check if there's a blocker in queue and it's not this client */ if (cr_server.run_queue->client != pClient && crServerClientInBeginEnd(cr_server.run_queue->client)) { crDebug("crServer: client %d blocked, allow_redir_ptr = 0", u32ClientID); pClient->conn->allow_redir_ptr = 0; } else { pClient->conn->allow_redir_ptr = 1; } pClient->conn->pBuffer = pBuffer; pClient->conn->cbBuffer = cbBuffer; crNetRecv(); CRASSERT(pClient->conn->pBuffer==NULL && pClient->conn->cbBuffer==0); crServerServiceClients(); #if 0 if (pClient->currentMural) { crStateViewport( 0, 0, 500, 500 ); pClient->currentMural->viewportValidated = GL_FALSE; cr_server.head_spu->dispatch_table.Viewport( 0, 0, 500, 500 ); crStateViewport( 0, 0, 600, 600 ); pClient->currentMural->viewportValidated = GL_FALSE; cr_server.head_spu->dispatch_table.Viewport( 0, 0, 600, 600 ); crStateMatrixMode(GL_PROJECTION); cr_server.head_spu->dispatch_table.MatrixMode(GL_PROJECTION); crServerDispatchLoadIdentity(); crStateFrustum(-0.6, 0.6, -0.5, 0.5, 1.5, 150.0); cr_server.head_spu->dispatch_table.Frustum(-0.6, 0.6, -0.5, 0.5, 1.5, 150.0); crServerDispatchLoadIdentity(); crStateFrustum(-0.5, 0.5, -0.5, 0.5, 1.5, 150.0); cr_server.head_spu->dispatch_table.Frustum(-0.5, 0.5, -0.5, 0.5, 1.5, 150.0); crStateMatrixMode(GL_MODELVIEW); cr_server.head_spu->dispatch_table.MatrixMode(GL_MODELVIEW); crServerDispatchLoadIdentity(); crStateFrustum(-0.5, 0.5, -0.5, 0.5, 1.5, 150.0); cr_server.head_spu->dispatch_table.Frustum(-0.5, 0.5, -0.5, 0.5, 1.5, 150.0); crServerDispatchLoadIdentity(); } #endif crStateResetCurrentPointers(&cr_server.current); CRASSERT(!pClient->conn->allow_redir_ptr || crNetNumMessages(pClient->conn)==0); #ifdef VBOXCR_LOGFPS tend = RTTimeNanoTS(); pClient->timeUsed += tend-tstart; #endif /*crDebug("<=crServer: ClientWrite u32ClientID=%d", u32ClientID);*/ return VINF_SUCCESS; }