Changeset 30623 in vbox
- Timestamp:
- Jul 5, 2010 3:40:01 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 63358
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispD3D.cpp
r30622 r30623 34 34 35 35 #define VBOXWDDMDISP_WITH_TMPWORKAROUND 1 36 #define VBOXDISP_TMP_NEWCREATEDEVICE 137 36 38 37 #define VBOXWDDMOVERLAY_TEST … … 3262 3261 pDevice->hWnd = hWnd; 3263 3262 pDevice->pRenderTargetRc = pRc; 3264 #if 0 3265 IDirect3DS wapChain9 *pSwapChain;3266 hr = pDevice->pDevice9If->Get SwapChain(0, &pSwapChain);3263 3264 IDirect3DSurface9* pD3D9Surf; 3265 hr = pDevice->pDevice9If->GetRenderTarget(0, &pD3D9Surf); 3267 3266 Assert(hr == S_OK); 3268 3267 if (hr == S_OK) 3269 3268 { 3270 UINT i = 0, iAlloc = 0; 3271 IDirect3DSurface9* pD3D9Surf; 3272 for (; i < pResource->SurfCount; ++i) 3269 PVBOXWDDMDISP_ALLOCATION pAllocation = &pRc->aAllocations[0]; 3270 pAllocation->enmD3DIfType = VBOXDISP_D3DIFTYPE_SURFACE; 3271 pAllocation->pD3DIf = pD3D9Surf; 3272 hr = vboxWddmSurfSynchMem(pRc, pAllocation); 3273 Assert(hr == S_OK); 3274 if (hr == S_OK) 3273 3275 { 3274 iAlloc = (i < pResource->SurfCount - 1) ? i+1 : 0; 3275 PVBOXWDDMDISP_ALLOCATION pAllocation = &pRc->aAllocations[iAlloc]; 3276 hr = pSwapChain->GetBackBuffer(0, D3DBACKBUFFER_TYPE_MONO, &pD3D9Surf); 3277 Assert(hr == S_OK); 3278 if (hr == S_OK) 3276 for (UINT i = 1; i < pResource->SurfCount; ++i) 3279 3277 { 3280 Assert(pD3D9Surf); 3281 pAllocation->enmD3DIfType = VBOXDISP_D3DIFTYPE_SURFACE; 3282 pAllocation->pD3DIf = pD3D9Surf; 3283 hr = vboxWddmSurfSynchMem(pRc, pAllocation); 3278 PVBOXWDDMDISP_ALLOCATION pAllocation = &pRc->aAllocations[i]; 3279 hr = pDevice->pDevice9If->GetBackBuffer(0 /*UINT iSwapChain*/, 3280 i-1, D3DBACKBUFFER_TYPE_MONO, &pD3D9Surf); 3284 3281 Assert(hr == S_OK); 3285 3282 if (hr == S_OK) 3286 3283 { 3287 hr = pSwapChain->Present(NULL, NULL, NULL, NULL, 0); 3284 Assert(pD3D9Surf); 3285 pAllocation->enmD3DIfType = VBOXDISP_D3DIFTYPE_SURFACE; 3286 pAllocation->pD3DIf = pD3D9Surf; 3287 hr = vboxWddmSurfSynchMem(pRc, pAllocation); 3288 3288 Assert(hr == S_OK); 3289 3289 if (hr == S_OK) … … 3291 3291 continue; 3292 3292 } 3293 3294 /* Failure branch */ 3295 pD3D9Surf->Release(); 3293 3296 } 3294 pD3D9Surf->Release(); 3295 } 3296 3297 /* above we are enumerating from 1..N-1, 0, 3298 * should neve release [0], as it was released above on failure */ 3299 for (UINT j = 1; j < iAlloc ? iAlloc : pResource->SurfCount - 1; ++j) 3300 { 3301 pRc->aAllocations[j].pD3DIf->Release(); 3297 3298 for (UINT j = 1; j < i; ++j) 3299 { 3300 pRc->aAllocations[j].pD3DIf->Release(); 3301 } 3302 3302 } 3303 3303 } 3304 pSwapChain->Release(); 3304 3305 if (hr != S_OK) 3306 pRc->aAllocations[0].pD3DIf->Release(); 3305 3307 } 3306 3308 3307 3309 if (hr != S_OK) 3308 3310 pDevice9If->Release(); 3309 #endif3310 3311 } 3311 3312 … … 3317 3318 } 3318 3319 } 3319 #ifdef VBOXDISP_TMP_NEWCREATEDEVICE3320 3320 else 3321 #else3322 if (hr == S_OK)3323 #endif3324 3321 { 3325 3322 Assert(pDevice->hWnd); … … 4141 4138 Assert(pData->SubResourceIndex < pRc->cAllocations); 4142 4139 HRESULT hr = S_OK; 4143 #ifdef VBOXDISP_TMP_NEWCREATEDEVICE 4144 if (pRc != pDevice->pRenderTargetRc || pRc->cAllocations > 1 || pData->RenderTargetIndex) 4145 #endif 4146 { 4147 IDirect3DSurface9 *pD3D9Surf; 4148 hr = vboxWddmSurfGet(pRc, pData->SubResourceIndex, &pD3D9Surf); 4140 IDirect3DSurface9 *pD3D9Surf; 4141 hr = vboxWddmSurfGet(pRc, pData->SubResourceIndex, &pD3D9Surf); 4142 Assert(hr == S_OK); 4143 if (hr == S_OK) 4144 { 4145 Assert(pD3D9Surf); 4146 hr = pDevice->pDevice9If->SetRenderTarget(pData->RenderTargetIndex, pD3D9Surf); 4149 4147 Assert(hr == S_OK); 4150 if (hr == S_OK) 4151 { 4152 Assert(pD3D9Surf); 4153 hr = pDevice->pDevice9If->SetRenderTarget(pData->RenderTargetIndex, pD3D9Surf); 4154 Assert(hr == S_OK); 4155 pD3D9Surf->Release(); 4156 } 4148 pD3D9Surf->Release(); 4157 4149 } 4158 4150 vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p), hr(0x%x)\n", hDevice, hr));
Note:
See TracChangeset
for help on using the changeset viewer.