Changeset 25216 in vbox
- Timestamp:
- Dec 7, 2009 4:42:26 PM (15 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_bufferobject.c
r23123 r25216 785 785 { 786 786 CRClientPointer *cp; 787 GLboolean locked = toCtx->client.array.locked; 787 788 788 789 crHashtableWalk(to->buffers, crStateBufferObjectSyncCB, to); … … 791 792 /*@todo, move to state_client.c*/ 792 793 794 795 /*@todo, patch dirty bits after snapshot loading instead*/ 796 if (toCtx->client.array.v.enabled) 797 { 798 diff_api.EnableClientState(GL_VERTEX_ARRAY); 799 } 800 793 801 cp = &toCtx->client.array.v; 794 if (cp->buffer->name )802 if (cp->buffer->name || locked) 795 803 { 796 804 diff_api.BindBufferARB(GL_ARRAY_BUFFER_ARB, cp->buffer->name); … … 799 807 800 808 cp = &toCtx->client.array.c; 801 if (cp->buffer->name )809 if (cp->buffer->name || locked) 802 810 { 803 811 diff_api.BindBufferARB(GL_ARRAY_BUFFER_ARB, cp->buffer->name); … … 806 814 807 815 cp = &toCtx->client.array.f; 808 if (cp->buffer->name )816 if (cp->buffer->name || locked) 809 817 { 810 818 diff_api.BindBufferARB(GL_ARRAY_BUFFER_ARB, cp->buffer->name); … … 813 821 814 822 cp = &toCtx->client.array.s; 815 if (cp->buffer->name )823 if (cp->buffer->name || locked) 816 824 { 817 825 diff_api.BindBufferARB(GL_ARRAY_BUFFER_ARB, cp->buffer->name); … … 820 828 821 829 cp = &toCtx->client.array.e; 822 if (cp->buffer->name )830 if (cp->buffer->name || locked) 823 831 { 824 832 diff_api.BindBufferARB(GL_ARRAY_BUFFER_ARB, cp->buffer->name); … … 827 835 828 836 cp = &toCtx->client.array.i; 829 if (cp->buffer->name )837 if (cp->buffer->name || locked) 830 838 { 831 839 diff_api.BindBufferARB(GL_ARRAY_BUFFER_ARB, cp->buffer->name); … … 834 842 835 843 cp = &toCtx->client.array.n; 836 if (cp->buffer->name )844 if (cp->buffer->name || locked) 837 845 { 838 846 diff_api.BindBufferARB(GL_ARRAY_BUFFER_ARB, cp->buffer->name); … … 843 851 { 844 852 cp = &toCtx->client.array.t[i]; 845 if (cp->buffer->name )853 if (cp->buffer->name || locked) 846 854 { 847 855 if (diff_api.ActiveTextureARB) … … 859 867 { 860 868 cp = &toCtx->client.array.a[i]; 861 if (cp->buffer->name )869 if (cp->buffer->name || locked) 862 870 { 863 871 diff_api.BindBufferARB(GL_ARRAY_BUFFER_ARB, cp->buffer->name); -
trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_snapshot.c
r25155 r25216 852 852 } 853 853 854 static int32_t crStateSaveClientPointer(CRVertexArrays *pArrays, int32_t index, PSSMHANDLE pSSM) 855 { 856 int32_t rc; 857 CRClientPointer *cp; 858 859 cp = crStateGetClientPointerByIndex(index, pArrays); 860 861 rc = SSMR3PutU32(pSSM, cp->buffer->name); 862 AssertRCReturn(rc, rc); 863 864 #ifdef CR_EXT_compiled_vertex_array 865 if (cp->locked) 866 { 867 CRASSERT(cp->p); 868 rc = SSMR3PutMem(pSSM, cp->p, cp->stride*(pArrays->lockFirst+pArrays->lockCount)); 869 AssertRCReturn(rc, rc); 870 } 871 #endif 872 873 return VINF_SUCCESS; 874 } 875 876 static int32_t crStateLoadClientPointer(CRVertexArrays *pArrays, int32_t index, CRContext *pContext, PSSMHANDLE pSSM) 877 { 878 int32_t rc; 879 uint32_t ui; 880 CRClientPointer *cp; 881 882 cp = crStateGetClientPointerByIndex(index, pArrays); 883 884 rc = SSMR3GetU32(pSSM, &ui); 885 AssertRCReturn(rc, rc); 886 cp->buffer = ui==0 ? pContext->bufferobject.nullBuffer : crHashtableSearch(pContext->bufferobject.buffers, ui); 887 888 #ifdef CR_EXT_compiled_vertex_array 889 if (cp->locked) 890 { 891 rc = crStateAllocAndSSMR3GetMem(pSSM, &cp->p, cp->stride*(pArrays->lockFirst+pArrays->lockCount)); 892 AssertRCReturn(rc, rc); 893 } 894 #endif 895 896 return VINF_SUCCESS; 897 } 898 854 899 int32_t crStateSaveContext(CRContext *pContext, PSSMHANDLE pSSM) 855 900 { … … 1027 1072 rc = SSMR3PutU32(pSSM, pContext->bufferobject.elementsBuffer->name); 1028 1073 AssertRCReturn(rc, rc); 1029 /* Save bound array buffers*/ /*@todo vertexArrayStack*/ 1030 rc = SSMR3PutU32(pSSM, pContext->client.array.v.buffer->name); 1031 AssertRCReturn(rc, rc); 1032 rc = SSMR3PutU32(pSSM, pContext->client.array.c.buffer->name); 1033 AssertRCReturn(rc, rc); 1034 rc = SSMR3PutU32(pSSM, pContext->client.array.f.buffer->name); 1035 AssertRCReturn(rc, rc); 1036 rc = SSMR3PutU32(pSSM, pContext->client.array.s.buffer->name); 1037 AssertRCReturn(rc, rc); 1038 rc = SSMR3PutU32(pSSM, pContext->client.array.e.buffer->name); 1039 AssertRCReturn(rc, rc); 1040 rc = SSMR3PutU32(pSSM, pContext->client.array.i.buffer->name); 1041 AssertRCReturn(rc, rc); 1042 rc = SSMR3PutU32(pSSM, pContext->client.array.n.buffer->name); 1043 AssertRCReturn(rc, rc); 1044 for (i = 0; i < CR_MAX_TEXTURE_UNITS; i++) 1045 { 1046 rc = SSMR3PutU32(pSSM, pContext->client.array.t[i].buffer->name); 1047 AssertRCReturn(rc, rc); 1048 } 1049 # ifdef CR_NV_vertex_program 1050 for (i = 0; i < CR_MAX_VERTEX_ATTRIBS; i++) 1051 { 1052 rc = SSMR3PutU32(pSSM, pContext->client.array.a[i].buffer->name); 1053 AssertRCReturn(rc, rc); 1054 } 1055 # endif 1074 /* Save clint pointers and buffer bindings*/ 1075 for (i=0; i<CRSTATECLIENT_MAX_VERTEXARRAYS; ++i) 1076 { 1077 rc = crStateSaveClientPointer(&pContext->client.array, i, pSSM); 1078 AssertRCReturn(rc, rc); 1079 } 1080 1081 crDebug("client.vertexArrayStackDepth %i", pContext->client.vertexArrayStackDepth); 1082 for (i=0; i<pContext->client.vertexArrayStackDepth; ++i) 1083 { 1084 CRVertexArrays *pArray = &pContext->client.vertexArrayStack[i]; 1085 for (j=0; j<CRSTATECLIENT_MAX_VERTEXARRAYS; ++j) 1086 { 1087 rc = crStateSaveClientPointer(pArray, j, pSSM); 1088 AssertRCReturn(rc, rc); 1089 } 1090 } 1056 1091 #endif /*CR_ARB_vertex_buffer_object*/ 1057 1092 … … 1531 1566 AssertRCReturn(rc, rc); 1532 1567 pContext->bufferobject.elementsBuffer = CRS_GET_BO(ui); 1533 1534 /* Load bound array buffers*/1535 rc = SSMR3GetU32(pSSM, &ui);1536 AssertRCReturn(rc, rc);1537 pContext->client.array.v.buffer = CRS_GET_BO(ui);1538 1539 rc = SSMR3GetU32(pSSM, &ui);1540 AssertRCReturn(rc, rc);1541 pContext->client.array.c.buffer = CRS_GET_BO(ui);1542 1543 rc = SSMR3GetU32(pSSM, &ui);1544 AssertRCReturn(rc, rc);1545 pContext->client.array.f.buffer = CRS_GET_BO(ui);1546 1547 rc = SSMR3GetU32(pSSM, &ui);1548 AssertRCReturn(rc, rc);1549 pContext->client.array.s.buffer = CRS_GET_BO(ui);1550 1551 rc = SSMR3GetU32(pSSM, &ui);1552 AssertRCReturn(rc, rc);1553 pContext->client.array.e.buffer = CRS_GET_BO(ui);1554 1555 rc = SSMR3GetU32(pSSM, &ui);1556 AssertRCReturn(rc, rc);1557 pContext->client.array.i.buffer = CRS_GET_BO(ui);1558 1559 rc = SSMR3GetU32(pSSM, &ui);1560 AssertRCReturn(rc, rc);1561 pContext->client.array.n.buffer = CRS_GET_BO(ui);1562 1563 for (i = 0; i < CR_MAX_TEXTURE_UNITS; i++)1564 {1565 rc = SSMR3GetU32(pSSM, &ui);1566 AssertRCReturn(rc, rc);1567 pContext->client.array.t[i].buffer = CRS_GET_BO(ui);1568 }1569 # ifdef CR_NV_vertex_program1570 for (i = 0; i < CR_MAX_VERTEX_ATTRIBS; i++)1571 {1572 rc = SSMR3GetU32(pSSM, &ui);1573 AssertRCReturn(rc, rc);1574 pContext->client.array.a[i].buffer = CRS_GET_BO(ui);1575 }1576 # endif1577 1568 #undef CRS_GET_BO 1569 1570 /* Load client pointers and array buffer bindings*/ 1571 for (i=0; i<CRSTATECLIENT_MAX_VERTEXARRAYS; ++i) 1572 { 1573 rc = crStateLoadClientPointer(&pContext->client.array, i, pContext, pSSM); 1574 AssertRCReturn(rc, rc); 1575 } 1576 for (j=0; j<pContext->client.vertexArrayStackDepth; ++j) 1577 { 1578 CRVertexArrays *pArray = &pContext->client.vertexArrayStack[j]; 1579 for (i=0; i<CRSTATECLIENT_MAX_VERTEXARRAYS; ++i) 1580 { 1581 rc = crStateLoadClientPointer(pArray, i, pContext, pSSM); 1582 AssertRCReturn(rc, rc); 1583 } 1584 } 1578 1585 1579 1586 pContext->bufferobject.bResyncNeeded = GL_TRUE; -
trunk/src/VBox/HostServices/SharedOpenGL/crserver/crservice.cpp
r25155 r25216 71 71 72 72 static const char* gszVBoxOGLSSMMagic = "***OpenGL state data***"; 73 #define SHCROGL_SSM_VERSION 1 273 #define SHCROGL_SSM_VERSION 13 74 74 75 75 typedef struct
Note:
See TracChangeset
for help on using the changeset viewer.