Changeset 53166 in vbox
- Timestamp:
- Oct 29, 2014 6:19:16 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_main.c
r53103 r53166 1412 1412 } 1413 1413 1414 static int crVBoxServerFBImageDataInit(CRFBData *pData, CRContextInfo *pCtxInfo, CRMuralInfo *pMural, GLboolean fWrite)1415 {1416 return crVBoxServerFBImageDataInitEx(pData, pCtxInfo, pMural, fWrite, SHCROGL_SSM_VERSION, 0, 0);1417 }1418 1419 1414 static int crVBoxServerSaveFBImage(PSSMHANDLE pSSM) 1420 1415 { … … 1436 1431 pMural = pCtxInfo->currentMural; 1437 1432 1438 rc = crVBoxServerFBImageDataInit (&Data.data, pCtxInfo, pMural, GL_FALSE);1433 rc = crVBoxServerFBImageDataInitEx(&Data.data, pCtxInfo, pMural, GL_FALSE, SHCROGL_SSM_VERSION, 0, 0); 1439 1434 if (!RT_SUCCESS(rc)) 1440 1435 { … … 1563 1558 pContextInfo->currentMural = pContextCurrentMural; 1564 1559 } 1565 1566 #if 01567 typedef struct CR_SERVER_CHECK_BUFFERS1568 {1569 CRBufferObject *obj;1570 CRContext *ctx;1571 }CR_SERVER_CHECK_BUFFERS, *PCR_SERVER_CHECK_BUFFERS;1572 1573 static void crVBoxServerCheckConsistencyContextBuffersCB(unsigned long key, void *data1, void *data2)1574 {1575 CRContextInfo* pContextInfo = (CRContextInfo*)data1;1576 CRContext *ctx = pContextInfo->pContext;1577 PCR_SERVER_CHECK_BUFFERS pBuffers = (PCR_SERVER_CHECK_BUFFERS)data2;1578 CRBufferObject *obj = pBuffers->obj;1579 CRBufferObjectState *b = &(ctx->bufferobject);1580 int j, k;1581 1582 if (obj == b->arrayBuffer)1583 {1584 Assert(!pBuffers->ctx || pBuffers->ctx == ctx);1585 pBuffers->ctx = ctx;1586 }1587 if (obj == b->elementsBuffer)1588 {1589 Assert(!pBuffers->ctx || pBuffers->ctx == ctx);1590 pBuffers->ctx = ctx;1591 }1592 #ifdef CR_ARB_pixel_buffer_object1593 if (obj == b->packBuffer)1594 {1595 Assert(!pBuffers->ctx || pBuffers->ctx == ctx);1596 pBuffers->ctx = ctx;1597 }1598 if (obj == b->unpackBuffer)1599 {1600 Assert(!pBuffers->ctx || pBuffers->ctx == ctx);1601 pBuffers->ctx = ctx;1602 }1603 #endif1604 1605 #ifdef CR_ARB_vertex_buffer_object1606 for (j=0; j<CRSTATECLIENT_MAX_VERTEXARRAYS; ++j)1607 {1608 CRClientPointer *cp = crStateGetClientPointerByIndex(j, &ctx->client.array);1609 if (obj == cp->buffer)1610 {1611 Assert(!pBuffers->ctx || pBuffers->ctx == ctx);1612 pBuffers->ctx = ctx;1613 }1614 }1615 1616 for (k=0; k<ctx->client.vertexArrayStackDepth; ++k)1617 {1618 CRVertexArrays *pArray = &ctx->client.vertexArrayStack[k];1619 for (j=0; j<CRSTATECLIENT_MAX_VERTEXARRAYS; ++j)1620 {1621 CRClientPointer *cp = crStateGetClientPointerByIndex(j, pArray);1622 if (obj == cp->buffer)1623 {1624 Assert(!pBuffers->ctx || pBuffers->ctx == ctx);1625 pBuffers->ctx = ctx;1626 }1627 }1628 }1629 #endif1630 }1631 1632 static void crVBoxServerCheckConsistencyBuffersCB(unsigned long key, void *data1, void *data2)1633 {1634 CRBufferObject *obj = (CRBufferObject *)data1;1635 CR_SERVER_CHECK_BUFFERS Buffers = {0};1636 Buffers.obj = obj;1637 crHashtableWalk(cr_server.contextTable, crVBoxServerCheckConsistencyContextBuffersCB, (void*)&Buffers);1638 }1639 1640 //static void crVBoxServerCheckConsistency2CB(unsigned long key, void *data1, void *data2)1641 //{1642 // CRContextInfo* pContextInfo1 = (CRContextInfo*)data1;1643 // CRContextInfo* pContextInfo2 = (CRContextInfo*)data2;1644 //1645 // CRASSERT(pContextInfo1->pContext);1646 // CRASSERT(pContextInfo2->pContext);1647 //1648 // if (pContextInfo1 == pContextInfo2)1649 // {1650 // CRASSERT(pContextInfo1->pContext == pContextInfo2->pContext);1651 // return;1652 // }1653 //1654 // CRASSERT(pContextInfo1->pContext != pContextInfo2->pContext);1655 // CRASSERT(pContextInfo1->pContext->shared);1656 // CRASSERT(pContextInfo2->pContext->shared);1657 // CRASSERT(pContextInfo1->pContext->shared == pContextInfo2->pContext->shared);1658 // if (pContextInfo1->pContext->shared != pContextInfo2->pContext->shared)1659 // return;1660 //1661 // crHashtableWalk(pContextInfo1->pContext->shared->buffersTable, crVBoxServerCheckConsistencyBuffersCB, pContextInfo2);1662 //}1663 static void crVBoxServerCheckSharedCB(unsigned long key, void *data1, void *data2)1664 {1665 CRContextInfo* pContextInfo = (CRContextInfo*)data1;1666 void **ppShared = (void**)data2;1667 if (!*ppShared)1668 *ppShared = pContextInfo->pContext->shared;1669 else1670 Assert(pContextInfo->pContext->shared == *ppShared);1671 }1672 1673 static void crVBoxServerCheckConsistency()1674 {1675 CRSharedState *pShared = NULL;1676 crHashtableWalk(cr_server.contextTable, crVBoxServerCheckSharedCB, (void*)&pShared);1677 Assert(pShared);1678 if (pShared)1679 {1680 crHashtableWalk(pShared->buffersTable, crVBoxServerCheckConsistencyBuffersCB, NULL);1681 }1682 }1683 #endif1684 1560 1685 1561 static uint32_t g_hackVBoxServerSaveLoadCallsLeft = 0; … … 2172 2048 } 2173 2049 2174 #if 02175 if (muralInfo.pVisibleRects)2176 {2177 int j;2178 int cRects = RT_MIN(muralInfo.cVisibleRects, RT_ELEMENTS(LaBuf.aVisRects));2179 CRASSERT(cRects);2180 for (j = 0; j < cRects; ++j)2181 {2182 PRTRECT pRect = &LaBuf.aVisRects[j];2183 if (pRect->xLeft >= pRect->xRight)2184 break;2185 if (pRect->yTop >= pRect->yBottom)2186 break;2187 if (pRect->xLeft < 0 || pRect->xRight < 02188 || pRect->yTop < 0 || pRect->yBottom < 0)2189 break;2190 if (pRect->xLeft > (GLint)muralInfo.width2191 || pRect->xRight > (GLint)muralInfo.width)2192 break;2193 if (pRect->yTop > (GLint)muralInfo.height2194 || pRect->yBottom > (GLint)muralInfo.height)2195 break;2196 }2197 2198 if (j < cRects)2199 {2200 fBuggyMuralData = true;2201 break;2202 }2203 }2204 2205 if (muralInfo.pVisibleRects)2206 {2207 /* @todo: do we actually need any further checks here? */2208 fBuggyMuralData = true;2209 break;2210 }2211 2212 /* no visible regions*/2213 2214 if (ui == uiNumElems - 1)2215 {2216 /* this is the last mural, next it goes idsPool, whose content can not match the above template again */2217 fBuggyMuralData = true;2218 break;2219 }2220 2221 /* next it goes a next mural info */2222 // if (!fExpectPtr)2223 // {2224 // CRMuralInfo *pNextSpuWindowInfoMural = (CRMuralInfo*)((void*)&LaBuf);2225 // if (!pNextSpuWindowInfoMural->spuWindow)2226 // fBuggyMuralData = true;2227 //2228 // break;2229 // }2230 #endif2231 2050 /* fExpectPtr == true, the valid pointer values should not match possible mural width/height/position */ 2232 2051 fBuggyMuralData = true; … … 2680 2499 /* Restore client active context and window */ 2681 2500 crServerDispatchMakeCurrent(winID, 0, ctxID); 2682 2683 if (0) 2684 { 2685 // CRContext *tmpCtx; 2686 // CRCreateInfo_t *createInfo; 2687 GLfloat one[4] = { 1, 1, 1, 1 }; 2688 GLfloat amb[4] = { 0.4f, 0.4f, 0.4f, 1.0f }; 2689 2690 crServerDispatchMakeCurrent(winID, 0, ctxID); 2691 2692 crHashtableWalk(client.currentCtxInfo->pContext->shared->textureTable, crVBoxServerSyncTextureCB, client.currentCtxInfo->pContext); 2693 2694 crStateTextureObjectDiff(client.currentCtxInfo->pContext, NULL, NULL, &client.currentCtxInfo->pContext->texture.base1D, GL_TRUE); 2695 crStateTextureObjectDiff(client.currentCtxInfo->pContext, NULL, NULL, &client.currentCtxInfo->pContext->texture.base2D, GL_TRUE); 2696 crStateTextureObjectDiff(client.currentCtxInfo->pContext, NULL, NULL, &client.currentCtxInfo->pContext->texture.base3D, GL_TRUE); 2697 #ifdef CR_ARB_texture_cube_map 2698 crStateTextureObjectDiff(client.currentCtxInfo->pContext, NULL, NULL, &client.currentCtxInfo->pContext->texture.baseCubeMap, GL_TRUE); 2699 #endif 2700 #ifdef CR_NV_texture_rectangle 2701 //@todo this doesn't work as expected 2702 //crStateTextureObjectDiff(client.currentCtxInfo->pContext, NULL, NULL, &client.currentCtxInfo->pContext->texture.baseRect, GL_TRUE); 2703 #endif 2704 /*cr_server.head_spu->dispatch_table.Materialfv(GL_FRONT_AND_BACK, GL_AMBIENT, amb); 2705 cr_server.head_spu->dispatch_table.LightModelfv(GL_LIGHT_MODEL_AMBIENT, amb); 2706 cr_server.head_spu->dispatch_table.Lightfv(GL_LIGHT1, GL_DIFFUSE, one); 2707 2708 cr_server.head_spu->dispatch_table.Enable(GL_LIGHTING); 2709 cr_server.head_spu->dispatch_table.Enable(GL_LIGHT0); 2710 cr_server.head_spu->dispatch_table.Enable(GL_LIGHT1); 2711 2712 cr_server.head_spu->dispatch_table.Enable(GL_CULL_FACE); 2713 cr_server.head_spu->dispatch_table.Enable(GL_TEXTURE_2D);*/ 2714 2715 //crStateViewport( 0, 0, 600, 600 ); 2716 //pClient->currentMural->viewportValidated = GL_FALSE; 2717 //cr_server.head_spu->dispatch_table.Viewport( 0, 0, 600, 600 ); 2718 2719 //crStateMatrixMode(GL_PROJECTION); 2720 //cr_server.head_spu->dispatch_table.MatrixMode(GL_PROJECTION); 2721 2722 //crStateLoadIdentity(); 2723 //cr_server.head_spu->dispatch_table.LoadIdentity(); 2724 2725 //crStateFrustum(-0.5, 0.5, -0.5, 0.5, 1.5, 150.0); 2726 //cr_server.head_spu->dispatch_table.Frustum(-0.5, 0.5, -0.5, 0.5, 1.5, 150.0); 2727 2728 //crStateMatrixMode(GL_MODELVIEW); 2729 //cr_server.head_spu->dispatch_table.MatrixMode(GL_MODELVIEW); 2730 //crServerDispatchLoadIdentity(); 2731 //crStateFrustum(-0.5, 0.5, -0.5, 0.5, 1.5, 150.0); 2732 //cr_server.head_spu->dispatch_table.Frustum(-0.5, 0.5, -0.5, 0.5, 1.5, 150.0); 2733 //crServerDispatchLoadIdentity(); 2734 2735 /*createInfo = (CRCreateInfo_t *) crHashtableSearch(cr_server.pContextCreateInfoTable, ctxID); 2736 CRASSERT(createInfo); 2737 tmpCtx = crStateCreateContext(NULL, createInfo->visualBits, NULL); 2738 CRASSERT(tmpCtx); 2739 crStateDiffContext(tmpCtx, client.currentCtxInfo->pContext); 2740 crStateDestroyContext(tmpCtx);*/ 2741 } 2742 } 2743 } 2744 2745 //crServerDispatchMakeCurrent(-1, 0, -1); 2501 } 2502 } 2746 2503 2747 2504 cr_server.curClient = NULL; … … 2760 2517 2761 2518 cr_server.bIsInLoadingState = GL_FALSE; 2762 2763 #if 02764 crVBoxServerCheckConsistency();2765 #endif2766 2519 2767 2520 #ifdef DEBUG_misha
Note:
See TracChangeset
for help on using the changeset viewer.