Changeset 32580 in vbox for trunk/src/VBox/Additions/WINNT/Graphics/Display
- Timestamp:
- Sep 17, 2010 7:57:18 AM (14 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispD3D.cpp
r32577 r32580 3618 3618 HRESULT hr = S_OK; 3619 3619 3620 if (pSrcRc->aAllocations[0].SurfDesc.width == pDstRc->aAllocations[0].SurfDesc.width 3620 #ifdef DEBUG_misha 3621 bool bDo = false; 3622 IDirect3DSurface9 *pTstSrcSurfIf = NULL; 3623 IDirect3DSurface9 *pTstDstSurfIf = NULL; 3624 3625 if (g_VDbgTstDumpEnable) 3626 { 3627 hr = vboxWddmSurfGet(pSrcRc, 0, &pTstSrcSurfIf); 3628 Assert(hr == S_OK); 3629 hr = vboxWddmSurfGet(pDstRc, 0, &pTstDstSurfIf); 3630 Assert(hr == S_OK); 3631 3632 if (g_VDbgTstDumpOnSys2VidSameSizeEnable) 3633 { 3634 if (pDstRc->RcDesc.enmPool != D3DDDIPOOL_SYSTEMMEM 3635 && pSrcRc->RcDesc.enmPool == D3DDDIPOOL_SYSTEMMEM) 3636 { 3637 D3DSURFACE_DESC SrcDesc; 3638 HRESULT hr = pTstSrcSurfIf->GetDesc(&SrcDesc); 3639 Assert(hr == S_OK); 3640 if (hr == S_OK) 3641 { 3642 D3DSURFACE_DESC DstDesc; 3643 hr = pTstDstSurfIf->GetDesc(&DstDesc); 3644 Assert(hr == S_OK); 3645 if (hr == S_OK) 3646 { 3647 if (SrcDesc.Width == DstDesc.Width 3648 && SrcDesc.Height == DstDesc.Height) 3649 { 3650 bDo = true; 3651 } 3652 } 3653 } 3654 } 3655 } 3656 } 3657 3658 if (bDo) 3659 { 3660 RECT DstRect; 3661 vboxWddmRectMoved(&DstRect, &pData->SrcRect, pData->DstPoint.x, pData->DstPoint.y); 3662 vboxVDbgDumpSurfData((pDevice, "TexBlt-pre Src:\n", pSrcRc, 0, &pData->SrcRect, pTstSrcSurfIf, "\n")); 3663 vboxVDbgDumpSurfData((pDevice, "TexBlt-pre Dst:\n", pDstRc, 0, &DstRect, pTstDstSurfIf, "\n")); 3664 } 3665 #endif 3666 3667 if (pSrcRc->aAllocations[0].D3DWidth == pDstRc->aAllocations[0].D3DWidth 3621 3668 && pSrcRc->aAllocations[0].SurfDesc.height == pDstRc->aAllocations[0].SurfDesc.height 3622 3669 && pSrcRc->RcDesc.enmFormat == pDstRc->RcDesc.enmFormat … … 3659 3706 } 3660 3707 3708 #ifdef DEBUG_misha 3709 if (bDo) 3710 { 3711 RECT DstRect; 3712 vboxWddmRectMoved(&DstRect, &pData->SrcRect, pData->DstPoint.x, pData->DstPoint.y); 3713 vboxVDbgDumpSurfData((pDevice, "TexBlt-post Src:\n", pSrcRc, 0, &pData->SrcRect, pTstSrcSurfIf, "\n")); 3714 vboxVDbgDumpSurfData((pDevice, "TexBlt-post Dst:\n", pDstRc, 0, &DstRect, pTstDstSurfIf, "\n")); 3715 } 3716 3717 if (pTstDstSurfIf) 3718 pTstDstSurfIf->Release(); 3719 if (pTstSrcSurfIf) 3720 pTstSrcSurfIf->Release(); 3721 #endif 3661 3722 vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p), hr(0x%x)\n", hDevice, hr)); 3662 3723 return hr; … … 4495 4556 pAllocation->iAlloc = i; 4496 4557 pAllocation->pRc = pRc; 4558 pAllocation->D3DWidth = pSurf->Width; 4497 4559 pAllocation->pvMem = (void*)pSurf->pSysMem; 4498 4560 pAllocation->SurfDesc.pitch = pSurf->SysMemPitch; … … 4673 4735 IDirect3DTexture9 *pD3DIfTex; 4674 4736 HANDLE hSharedHandle = NULL; 4737 if (pResource->Pool == D3DDDIPOOL_SYSTEMMEM) 4738 { 4739 Assert(pSurf->pSysMem); 4740 Assert(pSurf->SysMemPitch); 4741 UINT bpp = vboxWddmCalcBitsPerPixel(pResource->Format); 4742 Assert(bpp); 4743 if (bpp) 4744 { 4745 pAllocation->D3DWidth = ((pSurf->SysMemPitch << 3) / bpp); 4746 if ((pSurf->SysMemPitch << 3) % bpp) 4747 { 4748 Assert(0); 4749 ++pAllocation->D3DWidth; 4750 } 4751 Assert(pAllocation->D3DWidth >= pSurf->Width); 4752 #ifdef DEBUG_misha 4753 /* break to test */ 4754 Assert(pAllocation->D3DWidth == pSurf->Width); 4755 #endif 4756 } 4757 } 4675 4758 #if 0 4676 4759 hr = pDevice9If->CreateTexture(pSurf->Width, 4677 p Surf->Height,4760 pAllocation->D3DWidth, 4678 4761 pResource->SurfCount, 4679 4762 vboxDDI2D3DUsage(pResource->Flags), … … 4685 4768 #else 4686 4769 hr = pDevice->pAdapter->D3D.pfnVBoxWineExD3DDev9CreateTexture((IDirect3DDevice9Ex *)pDevice9If, 4687 p Surf->Width,4770 pAllocation->D3DWidth, 4688 4771 pSurf->Height, 4689 4772 pResource->SurfCount, … … 6999 7082 // Assert(pAlloc->SurfDesc.pitch == Lr.Pitch); 7000 7083 vboxVDbgMpPrint((pDevice, "<?dml?><exec cmd=\"!vbvdbg.ms 0x%p 0n%d 0n%d 0n%d 0n%d\">surface info</exec>\n", 7001 Lr.pBits, pAlloc-> SurfDesc.width, pAlloc->SurfDesc.height, bpp, Lr.Pitch));7084 Lr.pBits, pAlloc->D3DWidth, pAlloc->SurfDesc.height, bpp, Lr.Pitch)); 7002 7085 if (pRect) 7003 7086 { … … 7056 7139 bFrontBuf = (vboxWddmSwapchainGetBb(pSwapchain)->pAlloc == pAlloc); 7057 7140 } 7058 vboxVDbgDoMpPrintF(pDevice, "%s width(%d), height(%d), format(%d), usage(%s), %s", pPrefix,7059 pAlloc-> SurfDesc.width, pAlloc->SurfDesc.height, pAlloc->SurfDesc.format,7141 vboxVDbgDoMpPrintF(pDevice, "%s D3DWidth(%d), width(%d), height(%d), format(%d), usage(%s), %s", pPrefix, 7142 pAlloc->D3DWidth, pAlloc->SurfDesc.width, pAlloc->SurfDesc.height, pAlloc->SurfDesc.format, 7060 7143 bPrimary ? 7061 7144 (bFrontBuf ? "Front Buffer" : "Back Buffer") -
trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispD3D.h
r32496 r32580 212 212 struct VBOXWDDMDISP_RESOURCE *pRc; 213 213 void* pvMem; 214 UINT D3DWidth; 214 215 /* object type is defined by enmD3DIfType enum */ 215 216 IUnknown *pD3DIf;
Note:
See TracChangeset
for help on using the changeset viewer.