Changeset 81431 in vbox
- Timestamp:
- Oct 21, 2019 7:54:52 PM (5 years ago)
- Location:
- trunk/src/VBox/Devices/Graphics
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-internal.h
r81360 r81431 587 587 /** Event query inserted after each GPU operation that updates or uses this surface. */ 588 588 IDirect3DQuery9 *pQuery; 589 /* The type of actually created D3D resource. */ 589 /** The context id where the query has been created. */ 590 uint32_t idQueryContext; 591 /** The type of actually created D3D resource. */ 590 592 VMSVGA3DD3DRESTYPE enmD3DResType; 591 593 union … … 1116 1118 D3DMULTISAMPLE_TYPE vmsvga3dMultipeSampleCount2D3D(uint32_t multisampleCount); 1117 1119 DECLCALLBACK(int) vmsvga3dSharedSurfaceDestroyTree(PAVLU32NODECORE pNode, void *pvParam); 1118 int vmsvga3dSurfaceFlush(PV GASTATE pThis, PVMSVGA3DSURFACE pSurface);1120 int vmsvga3dSurfaceFlush(PVMSVGA3DSURFACE pSurface); 1119 1121 #endif /* VMSVGA3D_DIRECT3D */ 1120 1122 -
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-win.cpp
r81360 r81431 1317 1317 LogFunc(("track usage of sid=%x (cid=%d) for cid=%d, pQuery %p\n", pSurface->id, pSurface->idAssociatedContext, pContext->id, pSurface->pQuery)); 1318 1318 1319 /* Release the previous query object. */ 1320 D3D_RELEASE(pSurface->pQuery); 1321 1322 /* Use the context where the texture has been created. */ 1323 int rc = vmsvga3dContextFromCid(pState, pSurface->idAssociatedContext, &pContext); 1324 AssertRCReturn(rc, rc); 1319 if (pSurface->idQueryContext == pContext->id) 1320 { 1321 /* Release the previous query object, if any. */ 1322 D3D_RELEASE(pSurface->pQuery); 1323 } 1324 else 1325 { 1326 /* Different context. There must be no pending drawing operations. If there are any, then a flush is missing. */ 1327 if (pSurface->pQuery) 1328 { 1329 /* Should not happen. */ 1330 AssertFailed(); 1331 1332 /* Make sure that all drawing has completed. */ 1333 vmsvga3dSurfaceFlush(pSurface); 1334 } 1335 pSurface->idQueryContext = pContext->id; 1336 } 1325 1337 1326 1338 HRESULT hr = pContext->pDevice->CreateQuery(D3DQUERYTYPE_EVENT, &pSurface->pQuery); … … 1355 1367 1356 1368 /* Wait for all drawing, that uses this surface, to finish. */ 1357 int vmsvga3dSurfaceFlush(PV GASTATE pThis, PVMSVGA3DSURFACE pSurface)1369 int vmsvga3dSurfaceFlush(PVMSVGA3DSURFACE pSurface) 1358 1370 { 1359 RT_NOREF(pThis);1360 1371 #ifndef VBOX_VMSVGA3D_WITH_WINE_OPENGL 1361 1372 HRESULT hr; … … 1376 1387 RTThreadSleep(1); 1377 1388 } 1389 1390 D3D_RELEASE(pSurface->pQuery); 1391 1378 1392 AssertMsgReturn(hr == S_OK, ("vmsvga3dSurfaceFinishDrawing: GetData failed with %x\n", hr), VERR_INTERNAL_ERROR); 1379 1380 D3D_RELEASE(pSurface->pQuery);1381 1393 #endif /* !VBOX_VMSVGA3D_WITH_WINE_OPENGL */ 1382 1394 … … 1519 1531 1520 1532 /* Must flush the other context's 3d pipeline to make sure all drawing is complete for the surface we're about to use. */ 1521 vmsvga3dSurfaceFlush(p This, pSurfaceSrc);1522 vmsvga3dSurfaceFlush(p This, pSurfaceDest);1533 vmsvga3dSurfaceFlush(pSurfaceSrc); 1534 vmsvga3dSurfaceFlush(pSurfaceDest); 1523 1535 1524 1536 IDirect3DSurface9 *pSrc; … … 1645 1657 { 1646 1658 /* Can lock both. */ 1647 vmsvga3dSurfaceFlush(p This, pSurfaceSrc);1648 vmsvga3dSurfaceFlush(p This, pSurfaceDest);1659 vmsvga3dSurfaceFlush(pSurfaceSrc); 1660 vmsvga3dSurfaceFlush(pSurfaceDest); 1649 1661 1650 1662 D3DLOCKED_RECT LockedSrcRect; … … 1779 1791 { 1780 1792 /* Must flush the context's 3d pipeline to make sure all drawing is complete for the surface we're about to use. */ 1781 vmsvga3dSurfaceFlush(p This, pSurfaceSrc);1793 vmsvga3dSurfaceFlush(pSurfaceSrc); 1782 1794 1783 1795 hr = pD3DSurf->LockRect(&LockedSrcRect, &RectSrc, D3DLOCK_READONLY); … … 1801 1813 { 1802 1814 /* Must flush the context's 3d pipeline to make sure all drawing is complete for the surface we're about to use. */ 1803 vmsvga3dSurfaceFlush(p This, pSurfaceDest);1815 vmsvga3dSurfaceFlush(pSurfaceDest); 1804 1816 1805 1817 hr = pD3DSurf->LockRect(&LockedDestRect, &RectDest, 0); … … 1850 1862 #endif 1851 1863 AssertMsg(hr2 == D3D_OK, ("UpdateTexture failed with %x\n", hr2)); RT_NOREF(hr2); 1864 1865 /* Track the UpdateTexture operation. */ 1866 vmsvga3dSurfaceTrackUsage(pState, pContext, pSurfaceDest); 1852 1867 } 1853 1868 … … 2255 2270 pSurface->pMipmapLevels[i].pSurfaceData = NULL; 2256 2271 } 2272 2273 /* Track the UpdateTexture operation. */ 2274 vmsvga3dSurfaceTrackUsage(pState, pContext, pSurface); 2257 2275 } 2258 2276 pSurface->fDirty = false; … … 2288 2306 SVGA3dStretchBltMode enmMode, PVMSVGA3DCONTEXT pContext) 2289 2307 { 2308 RT_NOREF(pThis); 2309 2290 2310 HRESULT hr; 2291 2311 int rc; … … 2295 2315 2296 2316 /* Flush the drawing pipeline for this surface as it could be used in a shared context. */ 2297 vmsvga3dSurfaceFlush(p This, pSrcSurface);2298 vmsvga3dSurfaceFlush(p This, pDstSurface);2317 vmsvga3dSurfaceFlush(pSrcSurface); 2318 vmsvga3dSurfaceFlush(pDstSurface); 2299 2319 2300 2320 RECT RectSrc; … … 4180 4200 4181 4201 /* Must flush the other context's 3d pipeline to make sure all drawing is complete for the surface we're about to use. */ 4182 vmsvga3dSurfaceFlush(p This, pRenderTarget);4202 vmsvga3dSurfaceFlush(pRenderTarget); 4183 4203 4184 4204 if (pRenderTarget->surfaceFlags & SVGA3D_SURFACE_HINT_TEXTURE) … … 4453 4473 || pSurface->enmD3DResType == VMSVGA3D_D3DRESTYPE_VOLUME_TEXTURE); 4454 4474 /* Must flush the other context's 3d pipeline to make sure all drawing is complete for the surface we're about to use. */ 4455 vmsvga3dSurfaceFlush(p This, pSurface);4475 vmsvga3dSurfaceFlush(pSurface); 4456 4476 } 4457 4477 -
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d.cpp
r81360 r81431 509 509 #ifdef VMSVGA3D_DIRECT3D 510 510 /* Flush the drawing pipeline for this surface as it could be used in a shared context. */ 511 vmsvga3dSurfaceFlush(p This, pSurface);511 vmsvga3dSurfaceFlush(pSurface); 512 512 513 513 #else /* VMSVGA3D_OPENGL */
Note:
See TracChangeset
for help on using the changeset viewer.