Changeset 33416 in vbox for trunk/src/VBox/Additions/WINNT/Graphics/Display
- Timestamp:
- Oct 25, 2010 12:30:19 PM (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
r33367 r33416 2109 2109 if (pvSwapchain != pSwapchain->pSwapChainIf) 2110 2110 { 2111 Assert(0); 2112 if (iBb == (~0)) 2113 { 2114 pD3D9Surf->Release(); 2115 hr = pSwapchain->pSwapChainIf->GetBackBuffer(0, D3DBACKBUFFER_TYPE_MONO, &pD3D9Surf); 2116 Assert(hr == S_OK); 2117 } 2111 Assert(iBb != (~0)); 2112 // Assert(0); 2113 #if 0 //def DEBUG_misha 2114 vboxVDbgDumpAllocSurfData((pDevice, "Synch Src:\n", pAlloc, pD3D9OldSurf, NULL, "\n")); 2115 vboxVDbgDumpAllocData((pDevice, "Synch ALLOC:\n", pAlloc, NULL, "\n")); 2116 #endif 2118 2117 hr = pDevice->pDevice9If->StretchRect(pD3D9OldSurf, NULL, pD3D9Surf, NULL, D3DTEXF_NONE); 2119 2118 Assert(hr == S_OK); 2120 if (iBb == (~0)) 2119 #if 0 //def DEBUG_misha 2120 vboxVDbgDumpAllocSurfData((pDevice, "Synch Dst:\n", pAlloc, pD3D9Surf, NULL, "\n")); 2121 #endif 2122 if (pSwapchain->cRTs == 1) 2121 2123 { 2122 pD3D9Surf->Release();2124 /* synch bb and fb */ 2123 2125 hr = pSwapchain->pSwapChainIf->Present(NULL, NULL, NULL, NULL, 0); 2124 2126 Assert(hr == S_OK); 2125 hr = pSwapchain->pSwapChainIf->GetBackBuffer(~0, D3DBACKBUFFER_TYPE_MONO, &pD3D9Surf); 2126 Assert(hr == S_OK); 2127 if (hr == S_OK) 2128 { 2129 pD3D9Surf->Release(); 2130 hr = pSwapchain->pSwapChainIf->GetBackBuffer(0, D3DBACKBUFFER_TYPE_MONO, &pD3D9Surf); 2131 Assert(hr == S_OK); 2132 if (hr == S_OK) 2133 { 2134 hr = pDevice->pDevice9If->StretchRect(pD3D9OldSurf, NULL, pD3D9Surf, NULL, D3DTEXF_NONE); 2135 Assert(hr == S_OK); 2136 } 2137 } 2127 2138 } 2128 2139 } … … 2209 2220 { 2210 2221 if (OldParams.BackBufferCount == Params.BackBufferCount 2211 && OldParams.SwapEffect == Params.SwapEffect) 2222 // && OldParams.SwapEffect == Params.SwapEffect 2223 ) 2212 2224 { 2213 2225 bReuseSwapchain = TRUE; … … 7954 7966 bool g_VDbgTstDumpOnSys2VidSameSizeEnable = false; 7955 7967 7956 VOID vboxVDbgDoDump SurfData(const PVBOXWDDMDISP_DEVICE pDevice, const char * pPrefix, const PVBOXWDDMDISP_RESOURCE pRc, uint32_t iAlloc, const RECT *pRect, IDirect3DSurface9 *pSurf, const char* pSuffix)7968 VOID vboxVDbgDoDumpAllocSurfData(const PVBOXWDDMDISP_DEVICE pDevice, const char * pPrefix, PVBOXWDDMDISP_ALLOCATION pAlloc, IDirect3DSurface9 *pSurf, const RECT *pRect, const char* pSuffix) 7957 7969 { 7958 7970 if (pPrefix) … … 7960 7972 vboxVDbgMpPrint((pDevice, "%s", pPrefix)); 7961 7973 } 7962 7963 Assert(pRc->cAllocations > iAlloc);7964 PVBOXWDDMDISP_ALLOCATION pAlloc = &pRc->aAllocations[iAlloc];7965 7966 vboxVDbgMpPrintAlloc((pDevice, "allocation info:\n", pRc, iAlloc, "\n"));7967 7974 7968 7975 D3DLOCKED_RECT Lr; … … 7974 7981 } 7975 7982 7976 BOOL bReleaseSurf = false;7977 if (!pSurf)7978 {7979 HRESULT tmpHr = vboxWddmSurfGet(pRc, iAlloc, &pSurf);7980 Assert(tmpHr == S_OK);7981 bReleaseSurf = TRUE;7982 }7983 7983 HRESULT srcHr = pSurf->LockRect(&Lr, NULL, D3DLOCK_READONLY); 7984 7984 Assert(srcHr == S_OK); … … 8005 8005 vboxVDbgMpPrint((pDevice, "%s\n", pSuffix)); 8006 8006 } 8007 } 8008 8009 VOID vboxVDbgDoDumpAllocData(const PVBOXWDDMDISP_DEVICE pDevice, const char * pPrefix, PVBOXWDDMDISP_ALLOCATION pAlloc, const RECT *pRect, const char* pSuffix) 8010 { 8011 if (pPrefix) 8012 { 8013 vboxVDbgMpPrint((pDevice, "%s", pPrefix)); 8014 } 8015 8016 if (pRect) 8017 { 8018 Assert(pRect->right > pRect->left); 8019 Assert(pRect->bottom > pRect->top); 8020 vboxVDbgMpPrintRect((pDevice, "rect: ", pRect, "\n")); 8021 } 8022 8023 Assert(pAlloc->hAllocation); 8024 8025 D3DDDICB_LOCK LockData; 8026 LockData.hAllocation = pAlloc->hAllocation; 8027 LockData.PrivateDriverData = 0; 8028 LockData.NumPages = 0; 8029 LockData.pPages = NULL; 8030 LockData.pData = NULL; /* out */ 8031 LockData.Flags.Value = 0; 8032 LockData.Flags.LockEntire =1; 8033 LockData.Flags.ReadOnly = 1; 8034 8035 HRESULT hr = pDevice->RtCallbacks.pfnLockCb(pDevice->hDevice, &LockData); 8036 Assert(hr == S_OK); 8037 if (hr == S_OK) 8038 { 8039 UINT bpp = vboxWddmCalcBitsPerPixel(pAlloc->SurfDesc.format); 8040 // Assert(bpp == pAlloc->SurfDesc.bpp); 8041 // Assert(pAlloc->SurfDesc.pitch == Lr.Pitch); 8042 vboxVDbgMpPrint((pDevice, "<?dml?><exec cmd=\"!vbvdbg.ms 0x%p 0n%d 0n%d 0n%d 0n%d\">surface info</exec>\n", 8043 LockData.pData, pAlloc->D3DWidth, pAlloc->SurfDesc.height, bpp, pAlloc->SurfDesc.pitch)); 8044 if (pRect) 8045 { 8046 vboxVDbgMpPrint((pDevice, "<?dml?><exec cmd=\"!vbvdbg.ms 0x%p 0n%d 0n%d 0n%d 0n%d\">rect info</exec>\n", 8047 ((uint8_t*)LockData.pData) + (pRect->top * pAlloc->SurfDesc.pitch) + ((pRect->left * bpp) >> 3), 8048 pRect->right - pRect->left, pRect->bottom - pRect->top, bpp, pAlloc->SurfDesc.pitch)); 8049 } 8050 Assert(0); 8051 8052 D3DDDICB_UNLOCK DdiUnlock; 8053 8054 DdiUnlock.NumAllocations = 1; 8055 DdiUnlock.phAllocations = &pAlloc->hAllocation; 8056 8057 hr = pDevice->RtCallbacks.pfnUnlockCb(pDevice->hDevice, &DdiUnlock); 8058 Assert(hr == S_OK); 8059 } 8060 if (pSuffix) 8061 { 8062 vboxVDbgMpPrint((pDevice, "%s\n", pSuffix)); 8063 } 8064 } 8065 8066 8067 VOID vboxVDbgDoDumpSurfData(const PVBOXWDDMDISP_DEVICE pDevice, const char * pPrefix, const PVBOXWDDMDISP_RESOURCE pRc, uint32_t iAlloc, const RECT *pRect, IDirect3DSurface9 *pSurf, const char* pSuffix) 8068 { 8069 if (pPrefix) 8070 { 8071 vboxVDbgMpPrint((pDevice, "%s", pPrefix)); 8072 } 8073 8074 Assert(pRc->cAllocations > iAlloc); 8075 PVBOXWDDMDISP_ALLOCATION pAlloc = &pRc->aAllocations[iAlloc]; 8076 8077 vboxVDbgMpPrintAlloc((pDevice, "allocation info:\n", pRc, iAlloc, "\n")); 8078 8079 D3DLOCKED_RECT Lr; 8080 if (pRect) 8081 { 8082 Assert(pRect->right > pRect->left); 8083 Assert(pRect->bottom > pRect->top); 8084 vboxVDbgMpPrintRect((pDevice, "rect: ", pRect, "\n")); 8085 } 8086 8087 BOOL bReleaseSurf = false; 8088 if (!pSurf) 8089 { 8090 HRESULT tmpHr = vboxWddmSurfGet(pRc, iAlloc, &pSurf); 8091 Assert(tmpHr == S_OK); 8092 bReleaseSurf = TRUE; 8093 } 8094 HRESULT srcHr = pSurf->LockRect(&Lr, NULL, D3DLOCK_READONLY); 8095 Assert(srcHr == S_OK); 8096 if (srcHr == S_OK) 8097 { 8098 UINT bpp = vboxWddmCalcBitsPerPixel(pAlloc->SurfDesc.format); 8099 // Assert(bpp == pAlloc->SurfDesc.bpp); 8100 // Assert(pAlloc->SurfDesc.pitch == Lr.Pitch); 8101 vboxVDbgMpPrint((pDevice, "<?dml?><exec cmd=\"!vbvdbg.ms 0x%p 0n%d 0n%d 0n%d 0n%d\">surface info</exec>\n", 8102 Lr.pBits, pAlloc->D3DWidth, pAlloc->SurfDesc.height, bpp, Lr.Pitch)); 8103 if (pRect) 8104 { 8105 vboxVDbgMpPrint((pDevice, "<?dml?><exec cmd=\"!vbvdbg.ms 0x%p 0n%d 0n%d 0n%d 0n%d\">rect info</exec>\n", 8106 ((uint8_t*)Lr.pBits) + (pRect->top * Lr.Pitch) + ((pRect->left * bpp) >> 3), 8107 pRect->right - pRect->left, pRect->bottom - pRect->top, bpp, Lr.Pitch)); 8108 } 8109 Assert(0); 8110 8111 srcHr = pSurf->UnlockRect(); 8112 Assert(srcHr == S_OK); 8113 } 8114 if (pSuffix) 8115 { 8116 vboxVDbgMpPrint((pDevice, "%s\n", pSuffix)); 8117 } 8007 8118 8008 8119 if (bReleaseSurf) -
trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispD3DCmn.h
r33241 r33416 82 82 extern bool g_VDbgTstDumpOnSys2VidSameSizeEnable; 83 83 84 VOID vboxVDbgDoDumpAllocData(const PVBOXWDDMDISP_DEVICE pDevice, const char * pPrefix, PVBOXWDDMDISP_ALLOCATION pAlloc, const RECT *pRect, const char* pSuffix); 85 VOID vboxVDbgDoDumpAllocSurfData(const PVBOXWDDMDISP_DEVICE pDevice, const char * pPrefix, PVBOXWDDMDISP_ALLOCATION pAlloc, IDirect3DSurface9 *pSurf, const RECT *pRect, const char* pSuffix); 84 86 VOID vboxVDbgDoDumpSurfData(const PVBOXWDDMDISP_DEVICE pDevice, const char * pPrefix, const PVBOXWDDMDISP_RESOURCE pRc, uint32_t iAlloc, const RECT *pRect, IDirect3DSurface9 *pSurf, const char* pSuffix); 85 87 void vboxVDbgDoMpPrintRect(const PVBOXWDDMDISP_DEVICE pDevice, const char * pPrefix, const RECT *pRect, const char * pSuffix); … … 109 111 vboxVDbgDoDumpSurfData _m ; \ 110 112 } while (0) 113 #define vboxVDbgDumpAllocSurfData(_m) \ 114 do { \ 115 vboxVDbgDoDumpAllocSurfData _m ; \ 116 } while (0) 117 #define vboxVDbgDumpAllocData(_m) \ 118 do { \ 119 vboxVDbgDoDumpAllocData _m ; \ 120 } while (0) 111 121 #else 112 122 #define vboxVDbgDumpSurfData(_m) do {} while (0) … … 122 132 #define vboxVDbgMpPrintAlloc(_m) do {} while (0) 123 133 #define vboxVDbgDumpSurfData(_m) do {} while (0) 134 #define vboxVDbgDumpAllocSurfData(_m) do {} while (0) 135 #define vboxVDbgDumpAllocData(_m) do {} while (0) 124 136 #define vboxVDbgBreak() do {} while (0) 125 137 #define vboxVDbgPrint(_m) do {} while (0)
Note:
See TracChangeset
for help on using the changeset viewer.