Changeset 32577 in vbox for trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispD3D.cpp
- Timestamp:
- Sep 16, 2010 6:11:27 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispD3D.cpp
r32562 r32577 1747 1747 if (!pSwapchain) 1748 1748 { 1749 // Assert(0); 1749 #ifdef DEBUG_misha 1750 Assert(0); 1751 #endif 1750 1752 /* first search for the swapchain the alloc might be added to */ 1751 1753 PVBOXWDDMDISP_SWAPCHAIN pCur = RTListNodeGetFirst(&pDevice->SwapchainList, VBOXWDDMDISP_SWAPCHAIN, ListEntry); … … 1768 1770 || (pBbRc->fFlags == pRtRc->fFlags 1769 1771 && pBbRc->RcDesc.enmPool == pRtRc->RcDesc.enmPool 1770 && pBbRc->RcDesc.fFlags.Value == pRtRc->RcDesc.fFlags.Value1772 // && pBbRc->RcDesc.fFlags.Value == pRtRc->RcDesc.fFlags.Value 1771 1773 ) 1772 1774 )) … … 2349 2351 { 2350 2352 PVBOXWDDMDISP_ALLOCATION pAlloc = &pRc->aAllocations[i]; 2351 pAlloc->SurfDesc.width = 0x4 00;2352 pAlloc->SurfDesc.height = 0x 300;2353 pAlloc->SurfDesc.width = 0x4; 2354 pAlloc->SurfDesc.height = 0x4; 2353 2355 pAlloc->SurfDesc.format = D3DDDIFMT_A8R8G8B8; 2354 2356 } … … 3614 3616 Assert(pSrcRc->RcDesc.enmPool == D3DDDIPOOL_SYSTEMMEM); 3615 3617 Assert(pDstRc->RcDesc.enmPool != D3DDDIPOOL_SYSTEMMEM); 3616 IDirect3DTexture9 *pD3DIfSrcTex = (IDirect3DTexture9*)pSrcRc->aAllocations[0].pD3DIf;3617 IDirect3DTexture9 *pD3DIfDstTex = (IDirect3DTexture9*)pDstRc->aAllocations[0].pD3DIf;3618 Assert(pD3DIfSrcTex);3619 Assert(pD3DIfDstTex);3620 3618 HRESULT hr = S_OK; 3621 3619 3622 3620 if (pSrcRc->aAllocations[0].SurfDesc.width == pDstRc->aAllocations[0].SurfDesc.width 3623 3621 && pSrcRc->aAllocations[0].SurfDesc.height == pDstRc->aAllocations[0].SurfDesc.height 3624 && pSrcRc->RcDesc.enmFormat == pDstRc->RcDesc.enmFormat) 3625 { 3626 /* first check if we can do IDirect3DDevice9::UpdateTexture */ 3627 if (pData->DstPoint.x == 0 && pData->DstPoint.y == 0 3622 && pSrcRc->RcDesc.enmFormat == pDstRc->RcDesc.enmFormat 3623 &&pData->DstPoint.x == 0 && pData->DstPoint.y == 0 3628 3624 && pData->SrcRect.left == 0 && pData->SrcRect.top == 0 3629 3625 && pData->SrcRect.right - pData->SrcRect.left == pSrcRc->aAllocations[0].SurfDesc.width 3630 3626 && pData->SrcRect.bottom - pData->SrcRect.top == pSrcRc->aAllocations[0].SurfDesc.height) 3631 { 3632 hr = pDevice9If->UpdateTexture(pD3DIfSrcTex, pD3DIfDstTex); 3627 { 3628 IDirect3DTexture9 *pD3DIfSrcTex = (IDirect3DTexture9*)pSrcRc->aAllocations[0].pD3DIf; 3629 IDirect3DTexture9 *pD3DIfDstTex = (IDirect3DTexture9*)pDstRc->aAllocations[0].pD3DIf; 3630 Assert(pD3DIfSrcTex); 3631 Assert(pD3DIfDstTex); 3632 hr = pDevice9If->UpdateTexture(pD3DIfSrcTex, pD3DIfDstTex); 3633 Assert(hr == S_OK); 3634 } 3635 else 3636 { 3637 IDirect3DSurface9 *pSrcSurfIf = NULL; 3638 IDirect3DSurface9 *pDstSurfIf = NULL; 3639 hr = vboxWddmSurfGet(pDstRc, 0, &pDstSurfIf); 3640 Assert(hr == S_OK); 3641 if (hr == S_OK) 3642 { 3643 hr = vboxWddmSurfGet(pSrcRc, 0, &pSrcSurfIf); 3633 3644 Assert(hr == S_OK); 3634 } 3635 else 3636 { 3637 Assert(0); 3638 /* @todo: impl */ 3639 } 3640 } 3641 else 3642 { 3643 Assert(0); 3644 /* @todo: impl */ 3645 if (hr == S_OK) 3646 { 3647 RECT DstRect; 3648 vboxWddmRectMoved(&DstRect, &pData->SrcRect, pData->DstPoint.x, pData->DstPoint.y); 3649 #ifdef DEBUG 3650 RECT tstRect = {0,0, pDstRc->aAllocations[0].SurfDesc.width, pDstRc->aAllocations[0].SurfDesc.height}; 3651 Assert(vboxWddmRectIsCoveres(&tstRect, &DstRect)); 3652 #endif 3653 hr = pDevice9If->StretchRect(pSrcSurfIf, &pData->SrcRect, pDstSurfIf, &DstRect, D3DTEXF_NONE); 3654 Assert(hr == S_OK); 3655 pSrcSurfIf->Release(); 3656 } 3657 pDstSurfIf->Release(); 3658 } 3645 3659 } 3646 3660 … … 4761 4775 if (hr == S_OK) 4762 4776 { 4777 #if 0 4763 4778 if(pResource->Flags.Primary) 4764 4779 { … … 4769 4784 Assert(bIssueCreateResource); 4770 4785 } 4786 #endif 4771 4787 continue; 4772 4788 } … … 6752 6768 } 6753 6769 #else 6754 # define VBOXDISP_TEST_SWAPCHAIN6770 //# define VBOXDISP_TEST_SWAPCHAIN 6755 6771 # ifdef VBOXDISP_TEST_SWAPCHAIN 6756 6772 VBOXDISP_D3DEV(pDevice);
Note:
See TracChangeset
for help on using the changeset viewer.