Changeset 31713 in vbox for trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispD3D.cpp
- Timestamp:
- Aug 16, 2010 6:13:40 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispD3D.cpp
r31687 r31713 3484 3484 CONST D3DDDI_SURFACEINFO* pSurf = &pResource->pSurfList[0]; 3485 3485 IDirect3DTexture9 *pD3DIfTex; 3486 HANDLE hSharedHandle = NULL; 3486 3487 #if 0 3487 3488 hr = pDevice->pDevice9If->CreateTexture(pSurf->Width, … … 3503 3504 vboxDDI2D3DPool(pResource->Pool), 3504 3505 &pD3DIfTex, 3505 NULL /* HANDLE* pSharedHandle */,3506 pResource->Flags.SharedResource ? &hSharedHandle : NULL, 3506 3507 pResource->Pool == D3DDDIPOOL_SYSTEMMEM ? pRc->aAllocations[0].pvMem : NULL); 3507 3508 #endif … … 3512 3513 pAllocation->enmD3DIfType = VBOXDISP_D3DIFTYPE_TEXTURE; 3513 3514 pAllocation->pD3DIf = pD3DIfTex; 3515 Assert(!!(pResource->Flags.SharedResource) == !!(hSharedHandle)); 3516 pAllocation->hSharedHandle = hSharedHandle; 3514 3517 #if 0 3515 3518 if (pResource->Pool == D3DDDIPOOL_SYSTEMMEM) … … 3723 3726 { 3724 3727 D3DDDI_ALLOCATIONINFO *pDdiAllocI = &pDdiAllocate->pAllocationInfo[i]; 3728 PVBOXWDDMDISP_ALLOCATION pAllocation = &pRc->aAllocations[i]; 3725 3729 Assert(pDdiAllocI->pPrivateDriverData); 3726 3730 Assert(pDdiAllocI->PrivateDriverDataSize == sizeof (VBOXWDDM_ALLOCINFO)); … … 3740 3744 pAllocInfo->enmType = VBOXWDDM_ALLOC_TYPE_UMD_RC_GENERIC; 3741 3745 pAllocInfo->fFlags = pResource->Flags; 3746 pAllocInfo->hSharedHandle = pAllocation->hSharedHandle; 3742 3747 pAllocInfo->SurfDesc.width = pSurf->Width; 3743 3748 pAllocInfo->SurfDesc.height = pSurf->Height; … … 5177 5182 else 5178 5183 { 5179 Assert(0); /* <-- need to test that */5180 5181 5184 /* this is a "generic" resource whose creation is initiaded by the UMD */ 5182 5185 Assert(pData->PrivateDriverDataSize == sizeof (VBOXWDDM_RCINFO)); 5183 if (pData->PrivateDriverDataSize >= sizeof (VBOXWDDM_RCINFO))5186 if (pData->PrivateDriverDataSize == sizeof (VBOXWDDM_RCINFO)) 5184 5187 { 5185 5188 VBOXWDDM_RCINFO *pRcInfo = (VBOXWDDM_RCINFO*)pData->pPrivateDriverData; … … 5189 5192 pRc->RcDesc = pRcInfo->RcDesc; 5190 5193 pRc->cAllocations = pData->NumAllocations; 5194 5195 for (UINT i = 0; i < pData->NumAllocations; ++i) 5196 { 5197 PVBOXWDDMDISP_ALLOCATION pAllocation = &pRc->aAllocations[i]; 5198 D3DDDI_OPENALLOCATIONINFO* pOAI = pData->pOpenAllocationInfo; 5199 Assert(pOAI->PrivateDriverDataSize == sizeof (VBOXWDDM_ALLOCINFO)); 5200 if (pOAI->PrivateDriverDataSize != sizeof (VBOXWDDM_ALLOCINFO)) 5201 { 5202 hr = E_INVALIDARG; 5203 break; 5204 } 5205 Assert(pOAI->pPrivateDriverData); 5206 PVBOXWDDM_ALLOCINFO pAllocInfo = (PVBOXWDDM_ALLOCINFO)pOAI->pPrivateDriverData; 5207 pAllocation->hAllocation = pOAI->hAllocation; 5208 pAllocation->enmType = pAllocInfo->enmType; 5209 pAllocation->hSharedHandle = pAllocInfo->hSharedHandle; 5210 pAllocation->SurfDesc = pAllocInfo->SurfDesc; 5211 Assert(pAllocation->hSharedHandle); 5212 } 5213 5214 Assert(pRc->RcDesc.fFlags.SharedResource); 5215 if (pRc->RcDesc.fFlags.Texture) 5216 { 5217 Assert(pDevice->pDevice9If); 5218 5219 PVBOXWDDMDISP_ALLOCATION pAllocation = &pRc->aAllocations[0]; 5220 IDirect3DTexture9 *pD3DIfTex; 5221 HANDLE hSharedHandle = pAllocation->hSharedHandle; 5222 Assert(pAllocation->hSharedHandle); 5223 5224 hr = pDevice->pAdapter->D3D.pfnVBoxWineExD3DDev9CreateTexture((IDirect3DDevice9Ex *)pDevice->pDevice9If, 5225 pAllocation->SurfDesc.width, 5226 pAllocation->SurfDesc.height, 5227 pRc->cAllocations, 5228 vboxDDI2D3DUsage(pRc->RcDesc.fFlags), 5229 vboxDDI2D3DFormat(pRc->RcDesc.enmFormat), 5230 vboxDDI2D3DPool(pRc->RcDesc.enmPool), 5231 &pD3DIfTex, 5232 &hSharedHandle, 5233 NULL); 5234 Assert(hr == S_OK); 5235 if (hr == S_OK) 5236 { 5237 Assert(pD3DIfTex); 5238 pAllocation->enmD3DIfType = VBOXDISP_D3DIFTYPE_TEXTURE; 5239 pAllocation->pD3DIf = pD3DIfTex; 5240 Assert(pAllocation->hSharedHandle == hSharedHandle); 5241 Assert(pAllocation->hSharedHandle); 5242 } 5243 } 5244 else 5245 { 5246 /* impl */ 5247 Assert(0); 5248 } 5191 5249 } 5192 5250 else
Note:
See TracChangeset
for help on using the changeset viewer.