Changeset 69965 in vbox for trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-win.cpp
- Timestamp:
- Dec 6, 2017 11:48:53 PM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 119468
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-win.cpp
r69922 r69965 1189 1189 1190 1190 /* Get the shared surface copy or create a new one. */ 1191 static PVMSVGA3DSHAREDSURFACE vmsvga3dSurfaceGetSharedCopy(PVMSVGA3D CONTEXT pContext, PVMSVGA3DSURFACE pSurface)1191 static PVMSVGA3DSHAREDSURFACE vmsvga3dSurfaceGetSharedCopy(PVMSVGA3DSTATE pState, PVMSVGA3DCONTEXT pContext, PVMSVGA3DSURFACE pSurface) 1192 1192 { 1193 1193 Assert(pSurface->hSharedObject); … … 1255 1255 1256 1256 if (RT_LIKELY(hr == D3D_OK)) 1257 /* likely */; 1257 { 1258 /* Make sure that the created shared copy has the same content as the original. */ 1259 PVMSVGA3DCONTEXT pAssociatedContext; 1260 int rc = vmsvga3dContextFromCid(pState, pSurface->idAssociatedContext, &pAssociatedContext); 1261 if (RT_SUCCESS(rc)) 1262 { 1263 IDirect3DQuery9 *pQuery; 1264 hr = pAssociatedContext->pDevice->CreateQuery(D3DQUERYTYPE_EVENT, &pQuery); 1265 if (hr == D3D_OK) 1266 { 1267 hr = pQuery->Issue(D3DISSUE_END); 1268 if (hr == D3D_OK) 1269 { 1270 do 1271 { 1272 hr = pQuery->GetData(NULL, 0, D3DGETDATA_FLUSH); 1273 } while (hr == S_FALSE); 1274 } 1275 1276 D3D_RELEASE(pQuery); 1277 } 1278 } 1279 else 1280 AssertMsgFailed(("idAssociatedContext cid = %d, sid = %d\n", pSurface->idAssociatedContext, pSurface->id)); 1281 } 1258 1282 else 1259 1283 { … … 1347 1371 /** Get IDirect3DSurface9 for the given face and mipmap. 1348 1372 */ 1349 int vmsvga3dGetD3DSurface(PVMSVGA3DCONTEXT pContext, 1373 int vmsvga3dGetD3DSurface(PVMSVGA3DSTATE pState, 1374 PVMSVGA3DCONTEXT pContext, 1350 1375 PVMSVGA3DSURFACE pSurface, 1351 1376 uint32_t face, … … 1376 1401 pSurface->id, pSurface->idAssociatedContext, pContext->id)); 1377 1402 1378 PVMSVGA3DSHAREDSURFACE pSharedSurface = vmsvga3dSurfaceGetSharedCopy(p Context, pSurface);1403 PVMSVGA3DSHAREDSURFACE pSharedSurface = vmsvga3dSurfaceGetSharedCopy(pState, pContext, pSurface); 1379 1404 AssertReturn(pSharedSurface, VERR_INTERNAL_ERROR); 1380 1405 … … 1481 1506 1482 1507 IDirect3DSurface9 *pSrc; 1483 rc = vmsvga3dGetD3DSurface(p ContextDst, pSurfaceSrc, src.face, src.mipmap, false, &pSrc);1508 rc = vmsvga3dGetD3DSurface(pState, pContextDst, pSurfaceSrc, src.face, src.mipmap, false, &pSrc); 1484 1509 AssertRCReturn(rc, rc); 1485 1510 1486 1511 IDirect3DSurface9 *pDest; 1487 rc = vmsvga3dGetD3DSurface(p ContextDst, pSurfaceDest, dest.face, dest.mipmap, false, &pDest);1512 rc = vmsvga3dGetD3DSurface(pState, pContextDst, pSurfaceDest, dest.face, dest.mipmap, false, &pDest); 1488 1513 AssertRCReturnStmt(rc, D3D_RELEASE(pSrc), rc); 1489 1514 … … 1556 1581 AssertRCReturn(rc, rc); 1557 1582 1558 rc = vmsvga3dGetD3DSurface(p Context, pSurfaceSrc, src.face, src.mipmap, true, &pD3DSurf);1583 rc = vmsvga3dGetD3DSurface(pState, pContext, pSurfaceSrc, src.face, src.mipmap, true, &pD3DSurf); 1559 1584 AssertRCReturn(rc, rc); 1560 1585 } … … 1566 1591 AssertRCReturn(rc, rc); 1567 1592 1568 rc = vmsvga3dGetD3DSurface(p Context, pSurfaceDest, dest.face, dest.mipmap, true, &pD3DSurf);1593 rc = vmsvga3dGetD3DSurface(pState, pContext, pSurfaceDest, dest.face, dest.mipmap, true, &pD3DSurf); 1569 1594 AssertRCReturn(rc, rc); 1570 1595 } … … 2111 2136 2112 2137 IDirect3DSurface9 *pSrc; 2113 rc = vmsvga3dGetD3DSurface(p Context, pSrcSurface, uSrcFace, uSrcMipmap, false, &pSrc);2138 rc = vmsvga3dGetD3DSurface(pState, pContext, pSrcSurface, uSrcFace, uSrcMipmap, false, &pSrc); 2114 2139 AssertRCReturn(rc, rc); 2115 2140 2116 2141 IDirect3DSurface9 *pDst; 2117 rc = vmsvga3dGetD3DSurface(p Context, pDstSurface, uDstFace, uDstMipmap, false, &pDst);2142 rc = vmsvga3dGetD3DSurface(pState, pContext, pDstSurface, uDstFace, uDstMipmap, false, &pDst); 2118 2143 AssertRCReturn(rc, rc); 2119 2144 … … 2190 2215 /* Get the surface involved in the transfer. */ 2191 2216 IDirect3DSurface9 *pSurf; 2192 rc = vmsvga3dGetD3DSurface(p Context, pSurface, uHostFace, uHostMipmap, true, &pSurf);2217 rc = vmsvga3dGetD3DSurface(pState, pContext, pSurface, uHostFace, uHostMipmap, true, &pSurf); 2193 2218 AssertRCReturn(rc, rc); 2194 2219 … … 2206 2231 /* Source is the texture, destination is the bounce texture. */ 2207 2232 IDirect3DSurface9 *pSrc; 2208 rc = vmsvga3dGetD3DSurface(p Context, pSurface, uHostFace, uHostMipmap, false, &pSrc);2233 rc = vmsvga3dGetD3DSurface(pState, pContext, pSurface, uHostFace, uHostMipmap, false, &pSrc); 2209 2234 AssertRCReturn(rc, rc); 2210 2235 … … 2562 2587 AssertMsgReturn(hr == D3D_OK, ("GetBackBuffer failed with %x\n", hr), VERR_INTERNAL_ERROR); 2563 2588 2564 rc = vmsvga3dGetD3DSurface(p Context, pSurface, 0, 0, false, &pSurfaceD3D);2589 rc = vmsvga3dGetD3DSurface(pState, pContext, pSurface, 0, 0, false, &pSurfaceD3D); 2565 2590 AssertRCReturn(rc, rc); 2566 2591 … … 4345 4370 } 4346 4371 4347 rc = vmsvga3dGetD3DSurface(p Context, pRenderTarget, target.face, target.mipmap, false, &pSurface);4372 rc = vmsvga3dGetD3DSurface(pState, pContext, pRenderTarget, target.face, target.mipmap, false, &pSurface); 4348 4373 AssertRCReturn(rc, rc); 4349 4374 } … … 4612 4637 LogFunc(("Using texture sid=%x created for another context (%d vs %d)\n", sid, pSurface->idAssociatedContext, cid)); 4613 4638 4614 PVMSVGA3DSHAREDSURFACE pSharedSurface = vmsvga3dSurfaceGetSharedCopy(p Context, pSurface);4639 PVMSVGA3DSHAREDSURFACE pSharedSurface = vmsvga3dSurfaceGetSharedCopy(pState, pContext, pSurface); 4615 4640 AssertReturn(pSharedSurface, VERR_INTERNAL_ERROR); 4616 4641
Note:
See TracChangeset
for help on using the changeset viewer.