Changeset 39130 in vbox for trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm
- Timestamp:
- Oct 27, 2011 4:36:48 PM (13 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispD3D.cpp
r39044 r39130 1512 1512 } 1513 1513 1514 staticHRESULT vboxWddmLockRect(PVBOXWDDMDISP_RESOURCE pRc, UINT iAlloc,1514 HRESULT vboxWddmLockRect(PVBOXWDDMDISP_RESOURCE pRc, UINT iAlloc, 1515 1515 D3DLOCKED_RECT * pLockedRect, 1516 1516 CONST RECT *pRect, … … 1576 1576 } 1577 1577 1578 staticHRESULT vboxWddmUnlockRect(PVBOXWDDMDISP_RESOURCE pRc, UINT iAlloc)1578 HRESULT vboxWddmUnlockRect(PVBOXWDDMDISP_RESOURCE pRc, UINT iAlloc) 1579 1579 { 1580 1580 HRESULT hr = S_OK; … … 2223 2223 /* bad, @todo: correct the swapchain by either removing the Rt and adding it to another swapchain 2224 2224 * or by removing the pBbAlloc out of it */ 2225 Assert(0);2225 //@todo: Assert(0); 2226 2226 2227 2227 PVBOXWDDMDISP_RENDERTGT pRt = vboxWddmSwapchainRtForAlloc(pSwapchain, pBbAlloc); … … 3037 3037 } 3038 3038 3039 Assert(!pSwapchain->fFlags.bChanged);3039 //@todo: Assert(!pSwapchain->fFlags.bChanged); 3040 3040 Assert(pSwapchain->pSwapChainIf); 3041 3041 hr = vboxWddmSwapchainChkCreateIf(pDevice, pSwapchain); … … 3047 3047 } 3048 3048 3049 Assert(vboxWddmSwapchainGetBb(pSwapchain)->pAlloc == pAlloc || iRt != 0);3049 //@todo: Assert(vboxWddmSwapchainGetBb(pSwapchain)->pAlloc == pAlloc || iRt != 0); 3050 3050 IDirect3DSurface9 *pSurf; 3051 3051 hr = vboxWddmSwapchainSurfGet(pDevice, pSwapchain, pAlloc, &pSurf); … … 4187 4187 VBOXVDBG_CHECK_SMSYNC(pSrcRc); 4188 4188 4189 VBOXVDBG_DUMP_TEXBLT_ENTER(pSrcRc, &pData->SrcRect, pDstRc, &pData->DstPoint);4190 4191 4189 if (pSrcRc->aAllocations[0].D3DWidth == pDstRc->aAllocations[0].D3DWidth 4192 4190 && pSrcRc->aAllocations[0].SurfDesc.height == pDstRc->aAllocations[0].SurfDesc.height … … 4205 4203 Assert(pD3DIfSrcTex); 4206 4204 Assert(pD3DIfDstTex); 4207 hr = pDevice9If->UpdateTexture(pD3DIfSrcTex, pD3DIfDstTex); 4208 Assert(hr == S_OK); 4205 VBOXVDBG_CHECK_TEXBLT( 4206 hr = pDevice9If->UpdateTexture(pD3DIfSrcTex, pD3DIfDstTex); Assert(hr == S_OK), 4207 pSrcRc, 4208 &pData->SrcRect, 4209 pDstRc, 4210 &pData->DstPoint); 4209 4211 } 4210 4212 else … … 4226 4228 Assert(vboxWddmRectIsCoveres(&tstRect, &DstRect)); 4227 4229 #endif 4228 hr = pDevice9If->StretchRect(pSrcSurfIf, &pData->SrcRect, pDstSurfIf, &DstRect, D3DTEXF_NONE); 4229 Assert(hr == S_OK); 4230 VBOXVDBG_CHECK_TEXBLT( 4231 hr = pDevice9If->StretchRect(pSrcSurfIf, &pData->SrcRect, pDstSurfIf, &DstRect, D3DTEXF_NONE); Assert(hr == S_OK), 4232 pSrcRc, 4233 &pData->SrcRect, 4234 pDstRc, 4235 &pData->DstPoint); 4230 4236 pSrcSurfIf->Release(); 4231 4237 } … … 4245 4251 vboxWddmDalCheckAdd(pDevice, pDAlloc, FALSE); 4246 4252 } 4247 4248 VBOXVDBG_DUMP_TEXBLT_LEAVE(pSrcRc, &pData->SrcRect, pDstRc, &pData->DstPoint);4249 4253 4250 4254 vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p), hr(0x%x)\n", hDevice, hr)); … … 6391 6395 VBOXVDBG_BREAK_SHARED(pSrcRc); 6392 6396 VBOXVDBG_BREAK_SHARED(pDstRc); 6393 VBOXVDBG_DUMP_BLT_ENTER(pSrcAlloc, pSrcSurfIf, &pData->SrcRect, pDstAlloc, pDstSurfIf, &pData->DstRect);6394 6397 6395 6398 /* we support only Point & Linear, we ignore [Begin|Continue|End]PresentToDwm */ 6396 6399 Assert((pData->Flags.Value & (~(0x00000100 | 0x00000200 | 0x00000400 | 0x00000001 | 0x00000002))) == 0); 6397 hr = pDevice9If->StretchRect(pSrcSurfIf, 6398 &pData->SrcRect, 6399 pDstSurfIf, 6400 &pData->DstRect, 6401 vboxDDI2D3DBltFlags(pData->Flags)); 6402 Assert(hr == S_OK); 6403 6404 VBOXVDBG_DUMP_BLT_LEAVE(pSrcAlloc, pSrcSurfIf, &pData->SrcRect, pDstAlloc, pDstSurfIf, &pData->DstRect); 6400 VBOXVDBG_CHECK_BLT(hr = pDevice9If->StretchRect(pSrcSurfIf, &pData->SrcRect, pDstSurfIf, &pData->DstRect, vboxDDI2D3DBltFlags(pData->Flags)); Assert(hr == S_OK), 6401 pSrcAlloc, pSrcSurfIf, &pData->SrcRect, pDstAlloc, pDstSurfIf, &pData->DstRect); 6405 6402 6406 6403 pSrcSurfIf->Release(); -
trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispD3D.h
r38983 r39130 33 33 /* maximum number of direct render targets to be used before 34 34 * switching to offscreen rendering */ 35 #ifdef DEBUG_misha 36 #define VBOXWDDMDISP_MAX_DIRECT_RTS 0 37 #else 35 38 #define VBOXWDDMDISP_MAX_DIRECT_RTS 3 39 #endif 36 40 37 41 #define VBOXWDDMDISP_IS_TEXTURE(_f) ((_f).Texture || (_f).Value == 0) … … 382 386 } 383 387 388 HRESULT vboxWddmLockRect(PVBOXWDDMDISP_RESOURCE pRc, UINT iAlloc, 389 D3DLOCKED_RECT * pLockedRect, 390 CONST RECT *pRect, 391 DWORD fLockFlags); 392 HRESULT vboxWddmUnlockRect(PVBOXWDDMDISP_RESOURCE pRc, UINT iAlloc); 393 384 394 #define VBOXDISPMODE_IS_3D(_p) (!!((_p)->pD3D9If)) 385 395 #ifdef VBOXDISP_EARLYCREATEDEVICE -
trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispDbg.cpp
r38982 r39130 65 65 66 66 DWORD g_VBoxVDbgFCheckSysMemSync = 0; 67 DWORD g_VBoxVDbgFCheckBlt = 0; 68 DWORD g_VBoxVDbgFCheckTexBlt = 0; 69 70 DWORD g_VBoxVDbgFSkipCheckTexBltDwmWndUpdate = 1; 67 71 68 72 DWORD g_VBoxVDbgFLogRel = 1; 69 73 DWORD g_VBoxVDbgFLog = 1; 70 74 DWORD g_VBoxVDbgFLogFlow = 0; 75 76 DWORD g_VBoxVDbgFIsModuleNameInited = 0; 77 char g_VBoxVDbgModuleName[MAX_PATH]; 78 79 LONG g_VBoxVDbgFIsDwm = -1; 71 80 72 81 DWORD g_VBoxVDbgPid = 0; … … 189 198 } 190 199 191 VOID vboxVDbgDoPrintDumpCmd(const void *pvData, uint32_t width, uint32_t height, uint32_t bpp, uint32_t pitch) 192 { 193 vboxVDbgPrint(("<?dml?><exec cmd=\"!vbvdbg.ms 0x%p 0n%d 0n%d 0n%d 0n%d\">surface info</exec>, ( !vbvdbg.ms 0x%p 0n%d 0n%d 0n%d 0n%d )\n", 194 pvData, width, height, bpp, pitch, 195 pvData, width, height, bpp, pitch)); 200 VOID vboxVDbgDoPrintDmlCmd(const char* pszDesc, const char* pszCmd) 201 { 202 vboxVDbgPrint(("<?dml?><exec cmd=\"%s\">%s</exec>, ( %s )\n", pszCmd, pszDesc, pszCmd)); 203 } 204 205 VOID vboxVDbgDoPrintDumpCmd(const char* pszDesc, const void *pvData, uint32_t width, uint32_t height, uint32_t bpp, uint32_t pitch) 206 { 207 char Cmd[1024]; 208 sprintf(Cmd, "!vbvdbg.ms 0x%p 0n%d 0n%d 0n%d 0n%d", pvData, width, height, bpp, pitch); 209 vboxVDbgDoPrintDmlCmd(pszDesc, Cmd); 210 } 211 212 VOID vboxVDbgDoPrintLopLastCmd(const char* pszDesc) 213 { 214 vboxVDbgDoPrintDmlCmd(pszDesc, "ed @@(&vboxVDbgLoop) 0"); 196 215 } 197 216 … … 226 245 { 227 246 UINT bpp = vboxWddmCalcBitsPerPixel(pAlloc->SurfDesc.format); 228 vboxVDbgDoPrintDumpCmd( LockData.pData, pAlloc->D3DWidth, pAlloc->SurfDesc.height, bpp, pAlloc->SurfDesc.pitch);247 vboxVDbgDoPrintDumpCmd("Surf Info", LockData.pData, pAlloc->D3DWidth, pAlloc->SurfDesc.height, bpp, pAlloc->SurfDesc.pitch); 229 248 if (pRect) 230 249 { … … 232 251 Assert(pRect->bottom > pRect->top); 233 252 vboxVDbgDoPrintRect("rect: ", pRect, "\n"); 234 vboxVDbgDoPrintDumpCmd( ((uint8_t*)LockData.pData) + (pRect->top * pAlloc->SurfDesc.pitch) + ((pRect->left * bpp) >> 3),253 vboxVDbgDoPrintDumpCmd("Rect Info", ((uint8_t*)LockData.pData) + (pRect->top * pAlloc->SurfDesc.pitch) + ((pRect->left * bpp) >> 3), 235 254 pRect->right - pRect->left, pRect->bottom - pRect->top, bpp, pAlloc->SurfDesc.pitch); 236 255 } … … 284 303 { 285 304 UINT bpp = vboxWddmCalcBitsPerPixel((D3DDDIFORMAT)Desc.Format); 286 vboxVDbgDoPrintDumpCmd( Lr.pBits, Desc.Width, Desc.Height, bpp, Lr.Pitch);305 vboxVDbgDoPrintDumpCmd("Surf Info", Lr.pBits, Desc.Width, Desc.Height, bpp, Lr.Pitch); 287 306 if (pRect) 288 307 { … … 290 309 Assert(pRect->bottom > pRect->top); 291 310 vboxVDbgDoPrintRect("rect: ", pRect, "\n"); 292 vboxVDbgDoPrintDumpCmd( ((uint8_t*)Lr.pBits) + (pRect->top * Lr.Pitch) + ((pRect->left * bpp) >> 3),311 vboxVDbgDoPrintDumpCmd("Rect Info", ((uint8_t*)Lr.pBits) + (pRect->top * Lr.Pitch) + ((pRect->left * bpp) >> 3), 293 312 pRect->right - pRect->left, pRect->bottom - pRect->top, bpp, Lr.Pitch); 294 313 } … … 499 518 vboxVDbgPrint(("pRc(0x%p) iAlloc(%d), type(%d), cLocks(%d)\n", pAlloc->pRc, pAlloc->iAlloc, pAlloc->enmD3DIfType, pAlloc->LockInfo.cLocks)); 500 519 501 vboxVDbgDoPrintDumpCmd( pvData, width, height, bpp, pitch);520 vboxVDbgDoPrintDumpCmd("Surf Info", pvData, width, height, bpp, pitch); 502 521 503 522 if (fBreak) … … 526 545 const PVBOXWDDMDISP_ALLOCATION pAlloc = &pRc->aAllocations[pData->SubResourceIndex]; 527 546 vboxVDbgDoDumpLockUnlockSurfTex(pPrefix, pAlloc, pSuffix, fBreak); 547 } 548 549 BOOL vboxVDbgDoCheckLRects(D3DLOCKED_RECT *pDstLRect, const RECT *pDstRect, D3DLOCKED_RECT *pSrcLRect, const RECT *pSrcRect, DWORD bpp, BOOL fBreakOnMismatch) 550 { 551 LONG DstH, DstW, SrcH, SrcW, DstWBytes; 552 BOOL fMatch = FALSE; 553 DstH = pDstRect->bottom - pDstRect->top; 554 DstW = pDstRect->right - pDstRect->left; 555 SrcH = pSrcRect->bottom - pSrcRect->top; 556 SrcW = pSrcRect->right - pSrcRect->left; 557 558 DstWBytes = ((DstW * bpp + 7) >> 3); 559 560 if(DstW != SrcW && DstH != SrcH) 561 { 562 WARN(("stretched comparison not supported!!")); 563 return FALSE; 564 } 565 566 uint8_t *pDst = (uint8_t*)pDstLRect->pBits; 567 uint8_t *pSrc = (uint8_t*)pSrcLRect->pBits; 568 for (LONG i = 0; i < DstH; ++i) 569 { 570 if (!(fMatch = !memcmp(pDst, pSrc, DstWBytes))) 571 { 572 vboxVDbgPrint(("not match!\n")); 573 if (fBreakOnMismatch) 574 Assert(0); 575 break; 576 } 577 pDst += pDstLRect->Pitch; 578 pSrc += pSrcLRect->Pitch; 579 } 580 return fMatch; 581 } 582 583 BOOL vboxVDbgDoCheckRectsMatch(const PVBOXWDDMDISP_RESOURCE pDstRc, uint32_t iDstAlloc, 584 const PVBOXWDDMDISP_RESOURCE pSrcRc, uint32_t iSrcAlloc, 585 const RECT *pDstRect, 586 const RECT *pSrcRect, 587 BOOL fBreakOnMismatch) 588 { 589 BOOL fMatch = FALSE; 590 RECT DstRect = {0}, SrcRect = {0}; 591 if (!pDstRect) 592 { 593 DstRect.left = 0; 594 DstRect.right = pDstRc->aAllocations[iDstAlloc].SurfDesc.width; 595 DstRect.top = 0; 596 DstRect.bottom = pDstRc->aAllocations[iDstAlloc].SurfDesc.height; 597 pDstRect = &DstRect; 598 } 599 600 if (!pSrcRect) 601 { 602 SrcRect.left = 0; 603 SrcRect.right = pSrcRc->aAllocations[iSrcAlloc].SurfDesc.width; 604 SrcRect.top = 0; 605 SrcRect.bottom = pSrcRc->aAllocations[iSrcAlloc].SurfDesc.height; 606 pSrcRect = &SrcRect; 607 } 608 609 if (pDstRc == pSrcRc 610 && iDstAlloc == iSrcAlloc) 611 { 612 if (!memcmp(pDstRect, pSrcRect, sizeof (*pDstRect))) 613 { 614 vboxVDbgPrint(("matching same rect of one allocation, skipping..\n")); 615 return TRUE; 616 } 617 WARN(("matching different rects of the same allocation, unsupported!")); 618 return FALSE; 619 } 620 621 if (pDstRc->RcDesc.enmFormat != pSrcRc->RcDesc.enmFormat) 622 { 623 WARN(("matching different formats, unsupported!")); 624 return FALSE; 625 } 626 627 DWORD bpp = pDstRc->aAllocations[iDstAlloc].SurfDesc.bpp; 628 if (!bpp) 629 { 630 WARN(("uninited bpp! unsupported!")); 631 return FALSE; 632 } 633 634 LONG DstH, DstW, SrcH, SrcW; 635 DstH = pDstRect->bottom - pDstRect->top; 636 DstW = pDstRect->right - pDstRect->left; 637 SrcH = pSrcRect->bottom - pSrcRect->top; 638 SrcW = pSrcRect->right - pSrcRect->left; 639 640 if(DstW != SrcW && DstH != SrcH) 641 { 642 WARN(("stretched comparison not supported!!")); 643 return FALSE; 644 } 645 646 D3DLOCKED_RECT SrcLRect, DstLRect; 647 HRESULT hr = vboxWddmLockRect(pDstRc, iDstAlloc, &DstLRect, pDstRect, D3DLOCK_READONLY); 648 if (FAILED(hr)) 649 { 650 WARN(("vboxWddmLockRect failed, hr(0x%x)", hr)); 651 return FALSE; 652 } 653 654 hr = vboxWddmLockRect(pSrcRc, iSrcAlloc, &SrcLRect, pSrcRect, D3DLOCK_READONLY); 655 if (FAILED(hr)) 656 { 657 WARN(("vboxWddmLockRect failed, hr(0x%x)", hr)); 658 hr = vboxWddmUnlockRect(pDstRc, iDstAlloc); 659 return FALSE; 660 } 661 662 fMatch = vboxVDbgDoCheckLRects(&DstLRect, pDstRect, &SrcLRect, pSrcRect, bpp, fBreakOnMismatch); 663 664 hr = vboxWddmUnlockRect(pDstRc, iDstAlloc); 665 Assert(hr == S_OK); 666 667 hr = vboxWddmUnlockRect(pSrcRc, iSrcAlloc); 668 Assert(hr == S_OK); 669 670 return fMatch; 528 671 } 529 672 … … 551 694 { 552 695 vboxVDbgPrint(("%s left(%d), top(%d), right(%d), bottom(%d) %s", pPrefix, pRect->left, pRect->top, pRect->right, pRect->bottom, pSuffix)); 696 } 697 698 char *vboxVDbgDoGetModuleName() 699 { 700 if (!g_VBoxVDbgFIsModuleNameInited) 701 { 702 DWORD cName = GetModuleFileNameA(NULL, g_VBoxVDbgModuleName, RT_ELEMENTS(g_VBoxVDbgModuleName)); 703 if (!cName) 704 { 705 DWORD winEr = GetLastError(); 706 WARN(("GetModuleFileNameA failed, winEr %d", winEr)); 707 return NULL; 708 } 709 g_VBoxVDbgFIsModuleNameInited = TRUE; 710 } 711 return g_VBoxVDbgModuleName; 712 } 713 714 BOOL vboxVDbgDoCheckExe(const char * pszName) 715 { 716 char *pszModule = vboxVDbgDoGetModuleName(); 717 if (!pszModule) 718 return FALSE; 719 DWORD cbModule, cbName; 720 cbModule = strlen(pszModule); 721 cbName = strlen(pszName); 722 if (cbName > cbModule) 723 return FALSE; 724 if (_stricmp(pszName, pszModule + (cbModule - cbName))) 725 return FALSE; 726 return TRUE; 553 727 } 554 728 #endif -
trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispDbg.h
r38982 r39130 53 53 54 54 extern DWORD g_VBoxVDbgFCheckSysMemSync; 55 extern DWORD g_VBoxVDbgFCheckBlt; 56 extern DWORD g_VBoxVDbgFCheckTexBlt; 57 58 extern DWORD g_VBoxVDbgFSkipCheckTexBltDwmWndUpdate; 55 59 56 60 /* log enable flags */ … … 59 63 extern DWORD g_VBoxVDbgFLogFlow; 60 64 65 extern DWORD g_VBoxVDbgFIsModuleNameInited; 66 extern char g_VBoxVDbgModuleName[]; 67 68 extern LONG g_VBoxVDbgFIsDwm; 61 69 62 70 #endif … … 177 185 VOID vboxVDbgDoDumpUnlockSurfTex(const char * pPrefix, const D3DDDIARG_UNLOCK* pData, const char * pSuffix, bool fBreak); 178 186 187 BOOL vboxVDbgDoCheckRectsMatch(const PVBOXWDDMDISP_RESOURCE pDstRc, uint32_t iDstAlloc, 188 const PVBOXWDDMDISP_RESOURCE pSrcRc, uint32_t iSrcAlloc, 189 const RECT *pDstRect, 190 const RECT *pSrcRect, 191 BOOL fBreakOnMismatch); 192 193 BOOL vboxVDbgDoCheckExe(const char * pszName); 194 195 VOID vboxVDbgDoPrintLopLastCmd(const char* pszDesc); 179 196 180 197 extern DWORD g_VBoxVDbgPid; 181 198 #define VBOXVDBG_IS_PID(_pid) ((_pid) == (g_VBoxVDbgPid ? g_VBoxVDbgPid : (g_VBoxVDbgPid = GetCurrentProcessId()))) 182 199 #define VBOXVDBG_IS_DUMP_ALLOWED_PID(_pid) (((int)(_pid)) > 0 ? VBOXVDBG_IS_PID(_pid) : !VBOXVDBG_IS_PID(-((int)(_pid)))) 200 201 #define VBOXVDBG_CHECK_EXE(_pszName) (vboxVDbgDoCheckExe(_pszName)) 202 #define VBOXVDBG_IS_DWM() (!!(g_VBoxVDbgFIsDwm >=0 ? g_VBoxVDbgFIsDwm : (g_VBoxVDbgFIsDwm = VBOXVDBG_CHECK_EXE("dwm.exe")))) 183 203 184 204 #define VBOXVDBG_IS_DUMP_ALLOWED(_type) ( \ … … 226 246 } while (0) 227 247 248 #define VBOXVDBG_LOOP_LAST() do { vboxVDbgLoop = 0; } while (0) 249 250 #define VBOXVDBG_LOOP(_op) do { \ 251 DWORD vboxVDbgLoop = 1; \ 252 do { \ 253 _op; \ 254 } while (vboxVDbgLoop); \ 255 } while (0) 256 228 257 #define VBOXVDBG_CHECK_SMSYNC(_pRc) do { \ 229 258 if (VBOXVDBG_IS_CHECK_ALLOWED(SysMemSync)) { \ 230 259 vboxWddmDbgRcSynchMemCheck((_pRc)); \ 231 260 } \ 261 } while (0) 262 263 #define VBOXVDBG_DUMP_RECTS_INIT(_d) DWORD vboxVDbgDumpRects = _d; 264 #define VBOXVDBG_DUMP_RECTS_FORCE() vboxVDbgDumpRects = 1; 265 #define VBOXVDBG_DUMP_RECTS_FORCED() (!!vboxVDbgDumpRects) 266 267 #define VBOXVDBG_CHECK_RECTS(_opRests, _opDump, _pszOpName, _pDstRc, _iDstAlloc, _pSrcRc, _iSrcAlloc, _pDstRect, _pSrcRect) do { \ 268 VBOXVDBG_LOOP(\ 269 VBOXVDBG_DUMP_RECTS_INIT(0); \ 270 _opRests; \ 271 if (vboxVDbgDoCheckRectsMatch(_pDstRc, _iDstAlloc, _pSrcRc, _iSrcAlloc, _pDstRect, _pSrcRect, FALSE)) { \ 272 VBOXVDBG_LOOP_LAST(); \ 273 } \ 274 else \ 275 { \ 276 VBOXVDBG_DUMP_RECTS_FORCE(); \ 277 vboxVDbgPrint(("vboxVDbgDoCheckRectsMatch failed! The " _pszOpName " will be re-done so it can be debugged\n")); \ 278 vboxVDbgDoPrintLopLastCmd("Don't redo the" _pszOpName); \ 279 Assert(0); \ 280 } \ 281 _opDump; \ 282 ); \ 232 283 } while (0) 233 284 … … 291 342 292 343 #define VBOXVDBG_DUMP_TEXBLT_LEAVE(_pSrcRc, _pSrcRect, _pDstRc, _pDstPoint) do { \ 293 if (VBOXVDBG_IS_DUMP_ALLOWED(TexBlt) \ 344 if (VBOXVDBG_DUMP_RECTS_FORCED() \ 345 || VBOXVDBG_IS_DUMP_ALLOWED(TexBlt) \ 294 346 || VBOXVDBG_IS_DUMP_SHARED_ALLOWED(_pSrcRc) \ 295 347 || VBOXVDBG_IS_DUMP_SHARED_ALLOWED(_pDstRc) \ … … 309 361 ) \ 310 362 { \ 311 vboxVDbgDoDumpRcRectByAlloc("==>"__FUNCTION__" Src: ", (_pSrcAlloc), (_pSrcSurf), (_pSrcRect), "\n"); \ 312 vboxVDbgDoDumpRcRectByAlloc("==>"__FUNCTION__" Dst: ", (_pDstAlloc), (_pDstSurf), (_pDstRect), "\n"); \ 363 if ((_pSrcAlloc) == (_pDstAlloc) && !memcmp((_pSrcRect), (_pDstRect), sizeof (_pDstRect))) \ 364 { \ 365 vboxVDbgPrint(("BLT_ENTER: skipping dump of the same rect for one surfcace\n")); \ 366 } \ 367 else \ 368 { \ 369 vboxVDbgDoDumpRcRectByAlloc("==>"__FUNCTION__" Src: ", (_pSrcAlloc), (_pSrcSurf), (_pSrcRect), "\n"); \ 370 vboxVDbgDoDumpRcRectByAlloc("==>"__FUNCTION__" Dst: ", (_pDstAlloc), (_pDstSurf), (_pDstRect), "\n"); \ 371 } \ 313 372 } \ 314 373 } while (0) 315 374 316 375 #define VBOXVDBG_DUMP_BLT_LEAVE(_pSrcAlloc, _pSrcSurf, _pSrcRect, _pDstAlloc, _pDstSurf, _pDstRect) do { \ 317 if (VBOXVDBG_IS_DUMP_ALLOWED(Blt) \ 376 if (VBOXVDBG_DUMP_RECTS_FORCED() \ 377 || VBOXVDBG_IS_DUMP_ALLOWED(Blt) \ 318 378 || VBOXVDBG_IS_DUMP_SHARED_ALLOWED((_pSrcAlloc)->pRc) \ 319 379 || VBOXVDBG_IS_DUMP_SHARED_ALLOWED((_pDstAlloc)->pRc) \ 320 380 ) \ 321 381 { \ 322 vboxVDbgDoDumpRcRectByAlloc("<=="__FUNCTION__" Src: ", (_pSrcAlloc), (_pSrcSurf), (_pSrcRect), "\n"); \ 323 vboxVDbgDoDumpRcRectByAlloc("<=="__FUNCTION__" Dst: ", (_pDstAlloc), (_pDstSurf), (_pDstRect), "\n"); \ 382 if ((_pSrcAlloc) == (_pDstAlloc) && !memcmp((_pSrcRect), (_pDstRect), sizeof (_pDstRect))) \ 383 { \ 384 vboxVDbgPrint(("BLT_LEAVE: skipping dump of the same rect for one surfcace\n")); \ 385 } \ 386 else \ 387 { \ 388 vboxVDbgDoDumpRcRectByAlloc("<=="__FUNCTION__" Src: ", (_pSrcAlloc), (_pSrcSurf), (_pSrcRect), "\n"); \ 389 vboxVDbgDoDumpRcRectByAlloc("<=="__FUNCTION__" Dst: ", (_pDstAlloc), (_pDstSurf), (_pDstRect), "\n"); \ 390 } \ 391 } \ 392 } while (0) 393 394 #define VBOXVDBG_IS_SKIP_DWM_WND_UPDATE(_pSrcRc, _pSrcRect, _pDstRc, _pDstPoint) ( \ 395 g_VBoxVDbgFSkipCheckTexBltDwmWndUpdate \ 396 && ( \ 397 VBOXVDBG_IS_DWM() \ 398 && (_pSrcRc)->RcDesc.enmPool == D3DDDIPOOL_SYSTEMMEM \ 399 && (_pSrcRc)->RcDesc.enmFormat == D3DDDIFMT_A8R8G8B8 \ 400 && (_pSrcRc)->cAllocations == 1 \ 401 && (_pDstRc)->RcDesc.enmPool == D3DDDIPOOL_VIDEOMEMORY \ 402 && (_pDstRc)->RcDesc.enmFormat == D3DDDIFMT_A8R8G8B8 \ 403 && (_pDstRc)->RcDesc.fFlags.RenderTarget \ 404 && (_pDstRc)->RcDesc.fFlags.NotLockable \ 405 && (_pDstRc)->cAllocations == 1 \ 406 && (_pSrcRc)->aAllocations[0].SurfDesc.width == (_pDstRc)->aAllocations[0].SurfDesc.width \ 407 && (_pSrcRc)->aAllocations[0].SurfDesc.height == (_pDstRc)->aAllocations[0].SurfDesc.height \ 408 ) \ 409 ) 410 411 #define VBOXVDBG_CHECK_TEXBLT(_opTexBlt, _pSrcRc, _pSrcRect, _pDstRc, _pDstPoint) do { \ 412 if (VBOXVDBG_IS_CHECK_ALLOWED(TexBlt)) { \ 413 if (VBOXVDBG_IS_SKIP_DWM_WND_UPDATE(_pSrcRc, _pSrcRect, _pDstRc, _pDstPoint)) \ 414 { \ 415 vboxVDbgPrint(("TEXBLT: skipping check for dwm wnd update\n")); \ 416 } \ 417 else \ 418 { \ 419 RECT DstRect; \ 420 DstRect.left = (_pDstPoint)->x; \ 421 DstRect.right = (_pDstPoint)->x + (_pSrcRect)->right - (_pSrcRect)->left; \ 422 DstRect.top = (_pDstPoint)->y; \ 423 DstRect.bottom = (_pDstPoint)->y + (_pSrcRect)->bottom - (_pSrcRect)->top; \ 424 VBOXVDBG_CHECK_RECTS(\ 425 VBOXVDBG_DUMP_TEXBLT_ENTER(_pSrcRc, _pSrcRect, _pDstRc, _pDstPoint); \ 426 _opTexBlt ,\ 427 VBOXVDBG_DUMP_TEXBLT_LEAVE(_pSrcRc, _pSrcRect, _pDstRc, _pDstPoint), \ 428 "TexBlt", \ 429 _pDstRc, 0, _pSrcRc, 0, &DstRect, _pSrcRect); \ 430 break; \ 431 } \ 432 } \ 433 VBOXVDBG_DUMP_RECTS_INIT(0); \ 434 VBOXVDBG_DUMP_TEXBLT_ENTER(_pSrcRc, _pSrcRect, _pDstRc, _pDstPoint); \ 435 _opTexBlt;\ 436 VBOXVDBG_DUMP_TEXBLT_LEAVE(_pSrcRc, _pSrcRect, _pDstRc, _pDstPoint); \ 437 } while (0) 438 439 #define VBOXVDBG_CHECK_BLT(_opBlt, _pSrcAlloc, _pSrcSurf, _pSrcRect, _pDstAlloc, _pDstSurf, _pDstRect) do { \ 440 if (VBOXVDBG_IS_CHECK_ALLOWED(Blt)) { \ 441 VBOXVDBG_CHECK_RECTS(\ 442 VBOXVDBG_DUMP_BLT_ENTER(_pSrcAlloc, _pSrcSurf, _pSrcRect, _pDstAlloc, _pDstSurf, _pDstRect); \ 443 _opBlt ,\ 444 VBOXVDBG_DUMP_BLT_LEAVE(_pSrcAlloc, _pSrcSurf, _pSrcRect, _pDstAlloc, _pDstSurf, _pDstRect), \ 445 "Blt", \ 446 _pDstAlloc->pRc, _pDstAlloc->iAlloc, _pSrcAlloc->pRc, _pSrcAlloc->iAlloc, _pDstRect, _pSrcRect); \ 447 } \ 448 else \ 449 { \ 450 VBOXVDBG_DUMP_RECTS_INIT(0); \ 451 VBOXVDBG_DUMP_BLT_ENTER(_pSrcAlloc, _pSrcSurf, _pSrcRect, _pDstAlloc, _pDstSurf, _pDstRect); \ 452 _opBlt;\ 453 VBOXVDBG_DUMP_BLT_LEAVE(_pSrcAlloc, _pSrcSurf, _pSrcRect, _pDstAlloc, _pDstSurf, _pDstRect); \ 324 454 } \ 325 455 } while (0) … … 371 501 #define VBOXVDBG_BREAK_DDI() do { } while (0) 372 502 #define VBOXVDBG_CHECK_SMSYNC(_pRc) do { } while (0) 503 #define VBOXVDBG_CHECK_BLT(_opBlt, _pSrcAlloc, _pSrcSurf, _pSrcRect, _pDstAlloc, _pDstSurf, _pDstRect) do { } while (0) 504 #define VBOXVDBG_CHECK_TEXBLT(_opTexBlt, _pSrcRc, _pSrcRect, _pDstRc, _pDstPoint) do { } while (0) 373 505 #endif 374 506 -
trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/dbg/VBoxVideoWinDbg.cpp
r38903 r39130 156 156 } 157 157 ULONG uRc = 0; 158 #if 0159 158 if(u64DefaultPitch == u64Pitch) 160 #else161 if(0)162 #endif163 159 { 164 160 ULONG cbRead = 0;
Note:
See TracChangeset
for help on using the changeset viewer.