Changeset 82650 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Dec 24, 2019 12:19:23 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-win.cpp
r82609 r82650 2661 2661 2662 2662 /* Cleanup the device runtime state. */ 2663 if (pContext->pDevice) 2664 pContext->pDevice->SetVertexDeclaration(NULL); 2663 2665 D3D_RELEASE(pContext->d3dState.pVertexDecl); 2664 2666 … … 2938 2940 #endif /* #ifdef VMSVGA3D_DIRECT3D9_RESET */ 2939 2941 2942 AssertReturn(pContext->pDevice, VERR_INTERNAL_ERROR); 2943 2940 2944 /* Cleanup the device runtime state. */ 2945 pContext->pDevice->SetVertexDeclaration(NULL); 2941 2946 D3D_RELEASE(pContext->d3dState.pVertexDecl); 2942 2947 2943 AssertReturn(pContext->pDevice, VERR_INTERNAL_ERROR);2944 2948 hr = pContext->pDevice->GetViewport(&viewportOrg); 2945 2949 AssertMsgReturn(hr == D3D_OK, ("vmsvga3dChangeMode: GetViewport failed with %x\n", hr), VERR_INTERNAL_ERROR); … … 5180 5184 else 5181 5185 { 5186 /* Create and set the vertex declaration. */ 5187 IDirect3DVertexDeclaration9 *pVertexDecl; 5188 hr = pContext->pDevice->CreateVertexDeclaration(&aVertexElements[0], &pVertexDecl); 5189 AssertMsgReturn(hr == D3D_OK, ("CreateVertexDeclaration failed with %x\n", hr), VERR_INTERNAL_ERROR); 5190 5191 hr = pContext->pDevice->SetVertexDeclaration(pVertexDecl); 5192 AssertMsgReturnStmt(hr == D3D_OK, ("SetVertexDeclaration failed with %x\n", hr), 5193 D3D_RELEASE(pVertexDecl), 5194 VERR_INTERNAL_ERROR); 5195 5196 /* The new vertex declaration has been successfully set. Delete the old one. */ 5182 5197 D3D_RELEASE(pContext->d3dState.pVertexDecl); 5183 5198 5199 /* Remember the new vertext declaration. */ 5200 pContext->d3dState.pVertexDecl = pVertexDecl; 5184 5201 pContext->d3dState.cVertexElements = numVertexDecls + 1; 5185 5202 memcpy(pContext->d3dState.aVertexElements, 5186 5203 aVertexElements, 5187 5204 pContext->d3dState.cVertexElements * sizeof(aVertexElements[0])); 5188 5189 /* Create and set the vertex declaration. */5190 hr = pContext->pDevice->CreateVertexDeclaration(&aVertexElements[0], &pContext->d3dState.pVertexDecl);5191 AssertMsgReturn(hr == D3D_OK, ("CreateVertexDeclaration failed with %x\n", hr), VERR_INTERNAL_ERROR);5192 5193 hr = pContext->pDevice->SetVertexDeclaration(pContext->d3dState.pVertexDecl);5194 AssertMsgReturnStmt(hr == D3D_OK, ("SetVertexDeclaration failed with %x\n", hr),5195 D3D_RELEASE(pContext->d3dState.pVertexDecl),5196 VERR_INTERNAL_ERROR);5197 5205 } 5198 5206 … … 5300 5308 /* Cleanup. */ 5301 5309 uint32_t i; 5302 /* Clear streams above 1 as they might accidentally be reused in the future. */ 5303 for (i = 1; i < iCurrentStreamId; ++i) 5310 /* Clear all streams, because they are set at the beginning of this function anyway. 5311 * Now the vertex buffers can be safely deleted/recreated if necessary. 5312 */ 5313 for (i = 0; i < iCurrentStreamId; ++i) 5304 5314 { 5305 5315 LogFunc(("clear stream %d\n", i));
Note:
See TracChangeset
for help on using the changeset viewer.