Changeset 99856 in vbox for trunk/src/VBox/Additions/WINNT
- Timestamp:
- May 19, 2023 8:54:11 AM (23 months ago)
- svn:sync-xref-src-repo-rev:
- 157494
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/dx/VBoxDX.cpp
r99855 r99856 276 276 pPatchLocation->SplitOffset = pDevice->cbCommandBuffer; 277 277 ++pDevice->cPatchLocations; 278 } 279 280 281 static bool dxIsAllocationInUse(PVBOXDX_DEVICE pDevice, D3DKMT_HANDLE hAllocation) 282 { 283 if (!hAllocation) 284 return false; 285 286 /* Find the same hAllocation */ 287 int idxAllocation = -1; 288 for (unsigned i = 0; i < pDevice->cAllocations; ++i) 289 { 290 D3DDDI_ALLOCATIONLIST *p = &pDevice->pAllocationList[i]; 291 if (p->hAllocation == hAllocation) 292 { 293 idxAllocation = i; 294 break; 295 } 296 } 297 298 return idxAllocation >= 0; 278 299 } 279 300 … … 2399 2420 Assert(pResource->uMap == 0); /* Must not be already mapped */ 2400 2421 2422 if ( RT_BOOL(Flags & D3D10_DDI_MAP_FLAG_DONOTWAIT) 2423 && dxIsAllocationInUse(pDevice, vboxDXGetAllocation(pResource))) 2424 { 2425 vboxDXFlush(pDevice, true); 2426 vboxDXDeviceSetError(pDevice, DXGI_DDI_ERR_WASSTILLDRAWING); 2427 return; 2428 } 2429 2401 2430 HRESULT hr; 2402 2431 D3DDDICB_LOCK ddiLock; … … 2406 2435 ddiLock.hAllocation = vboxDXGetAllocation(pResource); 2407 2436 ddiLock.Flags.ReadOnly = DDIMap == D3D10_DDI_MAP_READ; 2408 ddiLock.Flags.WriteOnly = 0 /** @todo Is it? DDIMap == D3D10_DDI_MAP_WRITE */2437 ddiLock.Flags.WriteOnly = DDIMap == D3D10_DDI_MAP_WRITE 2409 2438 || DDIMap == D3D10_DDI_MAP_WRITE_DISCARD 2410 2439 || DDIMap == D3D10_DDI_MAP_WRITE_NOOVERWRITE; … … 2417 2446 hr = pDevice->pRTCallbacks->pfnLockCb(pDevice->hRTDevice.handle, &ddiLock); 2418 2447 if (hr == D3DERR_WASSTILLDRAWING) 2448 { 2449 if (RT_BOOL(Flags & D3D10_DDI_MAP_FLAG_DONOTWAIT)) 2450 { 2451 vboxDXDeviceSetError(pDevice, DXGI_DDI_ERR_WASSTILLDRAWING); 2452 return; 2453 } 2454 2419 2455 RTThreadYield(); 2456 } 2420 2457 } while (hr == D3DERR_WASSTILLDRAWING); 2421 2458
Note:
See TracChangeset
for help on using the changeset viewer.