VBoxD3DIf.h revision dc4c9f05c58012e8b1f0bfdd12b2e14fc2f228de
587e39a4b516e63e86e5616bb49eb4fd38656327slive * VBoxVideo Display D3D User mode dll
f2e55f27f49e34dcd7a066d1486a623a02a93ec7erikabele * Copyright (C) 2012 Oracle Corporation
587e39a4b516e63e86e5616bb49eb4fd38656327slive * This file is part of VirtualBox Open Source Edition (OSE), as
587e39a4b516e63e86e5616bb49eb4fd38656327slive * available from http://www.virtualbox.org. This file is free software;
587e39a4b516e63e86e5616bb49eb4fd38656327slive * you can redistribute it and/or modify it under the terms of the GNU
587e39a4b516e63e86e5616bb49eb4fd38656327slive * General Public License (GPL) as published by the Free Software
587e39a4b516e63e86e5616bb49eb4fd38656327slive * Foundation, in version 2 as it comes in the "COPYING" file of the
587e39a4b516e63e86e5616bb49eb4fd38656327slive * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
587e39a4b516e63e86e5616bb49eb4fd38656327slive * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
587e39a4b516e63e86e5616bb49eb4fd38656327slivestatic D3DFORMAT vboxDDI2D3DFormat(D3DDDIFORMAT format);
6a3d8d134c395506972ae3afc1c00ebddd9d2086sliveD3DMULTISAMPLE_TYPE vboxDDI2D3DMultiSampleType(D3DDDIMULTISAMPLE_TYPE enmType);
6a3d8d134c395506972ae3afc1c00ebddd9d2086sliveD3DRENDERSTATETYPE vboxDDI2D3DRenderStateType(D3DDDIRENDERSTATETYPE enmType);
439945dc3565e433010177ffb4e4841b98065d1dsliveVBOXWDDMDISP_TSS_LOOKUP vboxDDI2D3DTestureStageStateType(D3DDDITEXTURESTAGESTATETYPE enmType);
587e39a4b516e63e86e5616bb49eb4fd38656327sliveDWORD vboxDDI2D3DLockFlags(D3DDDI_LOCKFLAGS fLockFlags);
439945dc3565e433010177ffb4e4841b98065d1dsliveD3DTEXTUREFILTERTYPE vboxDDI2D3DBltFlags(D3DDDI_BLTFLAGS fFlags);
439945dc3565e433010177ffb4e4841b98065d1dsliveD3DQUERYTYPE vboxDDI2D3DQueryType(D3DDDIQUERYTYPE enmType);
439945dc3565e433010177ffb4e4841b98065d1dsliveDWORD vboxDDI2D3DIssueQueryFlags(D3DDDI_ISSUEQUERYFLAGS Flags);
439945dc3565e433010177ffb4e4841b98065d1dsliveHRESULT VBoxD3DIfCreateForRc(struct VBOXWDDMDISP_RESOURCE *pRc);
439945dc3565e433010177ffb4e4841b98065d1dsliveHRESULT VBoxD3DIfLockRect(struct VBOXWDDMDISP_RESOURCE *pRc, UINT iAlloc,
587e39a4b516e63e86e5616bb49eb4fd38656327sliveHRESULT VBoxD3DIfUnlockRect(struct VBOXWDDMDISP_RESOURCE *pRc, UINT iAlloc);
587e39a4b516e63e86e5616bb49eb4fd38656327slivevoid VBoxD3DIfLockUnlockMemSynch(struct VBOXWDDMDISP_ALLOCATION *pAlloc, D3DLOCKED_RECT *pLockInfo, RECT *pRect, bool bToLockInfo);
587e39a4b516e63e86e5616bb49eb4fd38656327slive/* NOTE: does NOT increment a ref counter! NO Release needed!! */
f2e55f27f49e34dcd7a066d1486a623a02a93ec7erikabeleDECLINLINE(IUnknown*) VBoxD3DIfGet(PVBOXWDDMDISP_ALLOCATION pAlloc)
587e39a4b516e63e86e5616bb49eb4fd38656327slive if (pAlloc->enmType != VBOXWDDM_ALLOC_TYPE_STD_SHAREDPRIMARYSURFACE)
587e39a4b516e63e86e5616bb49eb4fd38656327slive WARN(("dynamic creation is supported for VBOXWDDM_ALLOC_TYPE_STD_SHAREDPRIMARYSURFACE only!, current type is %d", pAlloc->enmType));
587e39a4b516e63e86e5616bb49eb4fd38656327slive Assert(pAlloc->enmD3DIfType == VBOXDISP_D3DIFTYPE_SURFACE);
587e39a4b516e63e86e5616bb49eb4fd38656327slive/* on success increments the surface ref counter,
587e39a4b516e63e86e5616bb49eb4fd38656327slive * i.e. one must call pSurf->Release() once the surface is not needed*/
587e39a4b516e63e86e5616bb49eb4fd38656327sliveDECLINLINE(HRESULT) VBoxD3DIfSurfGet(PVBOXWDDMDISP_RESOURCE pRc, UINT iAlloc, IDirect3DSurface9 **ppSurf)
587e39a4b516e63e86e5616bb49eb4fd38656327slive IUnknown* pD3DIf = VBoxD3DIfGet(&pRc->aAllocations[iAlloc]);
587e39a4b516e63e86e5616bb49eb4fd38656327slive IDirect3DSurface9 *pD3DIfSurf = (IDirect3DSurface9*)pD3DIf;
587e39a4b516e63e86e5616bb49eb4fd38656327slive Assert(pRc->cAllocations == 1); /* <- VBoxD3DIfSurfGet is typically used in Blt & ColorFill functions
587e39a4b516e63e86e5616bb49eb4fd38656327slive * in this case, if texture is used as a destination,
587e39a4b516e63e86e5616bb49eb4fd38656327slive * we should update sub-layers as well which is not done currently
587e39a4b516e63e86e5616bb49eb4fd38656327slive * so for now check VBoxD3DIfSurfGet is used for one-level textures */
587e39a4b516e63e86e5616bb49eb4fd38656327slive IDirect3DTexture9 *pD3DIfTex = (IDirect3DTexture9*)pD3DIf;
587e39a4b516e63e86e5616bb49eb4fd38656327slive hr = pD3DIfTex->GetSurfaceLevel(iAlloc, &pSurfaceLevel);
587e39a4b516e63e86e5616bb49eb4fd38656327slive IDirect3DCubeTexture9 *pD3DIfCubeTex = (IDirect3DCubeTexture9*)pD3DIf;
587e39a4b516e63e86e5616bb49eb4fd38656327slive hr = pD3DIfCubeTex->GetCubeMapSurface(VBOXDISP_CUBEMAP_INDEX_TO_FACE(pRc, iAlloc),
587e39a4b516e63e86e5616bb49eb4fd38656327slive VBOXDISP_CUBEMAP_INDEX_TO_LEVEL(pRc, iAlloc), &pSurfaceLevel);
return hr;
VOID VBoxD3DIfFillPresentParams(D3DPRESENT_PARAMETERS *pParams, PVBOXWDDMDISP_RESOURCE pRc, UINT cRTs);
#ifdef VBOXWDDMDISP_DEBUG
#ifdef VBOXDISP_EARLYCREATEDEVICE