17ec681f3Smrg/**************************************************************************
27ec681f3Smrg *
37ec681f3Smrg * Copyright 2012-2021 VMware, Inc.
47ec681f3Smrg * All Rights Reserved.
57ec681f3Smrg *
67ec681f3Smrg * Permission is hereby granted, free of charge, to any person obtaining a
77ec681f3Smrg * copy of this software and associated documentation files (the
87ec681f3Smrg * "Software"), to deal in the Software without restriction, including
97ec681f3Smrg * without limitation the rights to use, copy, modify, merge, publish,
107ec681f3Smrg * distribute, sub license, and/or sell copies of the Software, and to
117ec681f3Smrg * permit persons to whom the Software is furnished to do so, subject to
127ec681f3Smrg * the following conditions:
137ec681f3Smrg *
147ec681f3Smrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
157ec681f3Smrg * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
167ec681f3Smrg * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
177ec681f3Smrg * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
187ec681f3Smrg * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
197ec681f3Smrg * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
207ec681f3Smrg * USE OR OTHER DEALINGS IN THE SOFTWARE.
217ec681f3Smrg *
227ec681f3Smrg * The above copyright notice and this permission notice (including the
237ec681f3Smrg * next paragraph) shall be included in all copies or substantial portions
247ec681f3Smrg * of the Software.
257ec681f3Smrg *
267ec681f3Smrg **************************************************************************/
277ec681f3Smrg
287ec681f3Smrg/*
297ec681f3Smrg * Resource.h --
307ec681f3Smrg *    Functions that manipulate GPU resources.
317ec681f3Smrg */
327ec681f3Smrg
337ec681f3Smrg#ifndef RESOURCE_H
347ec681f3Smrg#define RESOURCE_H
357ec681f3Smrg
367ec681f3Smrg#include "DriverIncludes.h"
377ec681f3Smrg
387ec681f3SmrgSIZE_T APIENTRY CalcPrivateResourceSize(
397ec681f3Smrg   D3D10DDI_HDEVICE hDevice,
407ec681f3Smrg   __in const D3D10DDIARG_CREATERESOURCE *pCreateResource);
417ec681f3Smrg
427ec681f3Smrgvoid APIENTRY CreateResource(
437ec681f3Smrg   D3D10DDI_HDEVICE hDevice,
447ec681f3Smrg   __in const D3D10DDIARG_CREATERESOURCE *pCreateResource,
457ec681f3Smrg   D3D10DDI_HRESOURCE hResource,
467ec681f3Smrg   D3D10DDI_HRTRESOURCE hRTResource);
477ec681f3Smrg
487ec681f3SmrgSIZE_T APIENTRY CalcPrivateOpenedResourceSize(
497ec681f3Smrg   D3D10DDI_HDEVICE hDevice,
507ec681f3Smrg   __in const D3D10DDIARG_OPENRESOURCE *pOpenResource);
517ec681f3Smrg
527ec681f3Smrgvoid APIENTRY OpenResource(
537ec681f3Smrg   D3D10DDI_HDEVICE hDevice,
547ec681f3Smrg   __in const D3D10DDIARG_OPENRESOURCE *pOpenResource,
557ec681f3Smrg   D3D10DDI_HRESOURCE hResource,
567ec681f3Smrg   D3D10DDI_HRTRESOURCE hRTResource);
577ec681f3Smrg
587ec681f3Smrgvoid APIENTRY DestroyResource(D3D10DDI_HDEVICE hDevice, D3D10DDI_HRESOURCE hResource);
597ec681f3Smrg
607ec681f3Smrgvoid APIENTRY ResourceMap(D3D10DDI_HDEVICE hDevice, D3D10DDI_HRESOURCE hResource,
617ec681f3Smrg                 UINT SubResource, D3D10_DDI_MAP DDIMap, UINT Flags,
627ec681f3Smrg                 __out D3D10DDI_MAPPED_SUBRESOURCE *pMappedSubResource);
637ec681f3Smrg
647ec681f3Smrgvoid APIENTRY ResourceUnmap(D3D10DDI_HDEVICE hDevice, D3D10DDI_HRESOURCE hResource,
657ec681f3Smrg                   UINT SubResource);
667ec681f3Smrg
677ec681f3Smrgvoid APIENTRY ResourceCopy(D3D10DDI_HDEVICE hDevice, D3D10DDI_HRESOURCE hDstResource,
687ec681f3Smrg                  D3D10DDI_HRESOURCE hSrcResource);
697ec681f3Smrg
707ec681f3Smrgvoid APIENTRY ResourceCopyRegion(D3D10DDI_HDEVICE hDevice, D3D10DDI_HRESOURCE hResource,
717ec681f3Smrg                        UINT DstSubResource, UINT DstX, UINT DstY, UINT DstZ,
727ec681f3Smrg                        D3D10DDI_HRESOURCE hSrcResource, UINT SrcSubResource,
737ec681f3Smrg                        __in_opt const D3D10_DDI_BOX *pSrcBox);
747ec681f3Smrg
757ec681f3Smrgvoid APIENTRY ResourceResolveSubResource(D3D10DDI_HDEVICE hDevice,
767ec681f3Smrg                                D3D10DDI_HRESOURCE hDstResource,
777ec681f3Smrg                                UINT DstSubResource,
787ec681f3Smrg                                D3D10DDI_HRESOURCE hSrcResource,
797ec681f3Smrg                                UINT SrcSubResource,
807ec681f3Smrg                                DXGI_FORMAT ResolveFormat);
817ec681f3Smrg
827ec681f3SmrgBOOL APIENTRY ResourceIsStagingBusy(D3D10DDI_HDEVICE hDevice,
837ec681f3Smrg                           D3D10DDI_HRESOURCE hResource);
847ec681f3Smrg
857ec681f3Smrgvoid APIENTRY ResourceReadAfterWriteHazard(D3D10DDI_HDEVICE hDevice,
867ec681f3Smrg                                  D3D10DDI_HRESOURCE hResource);
877ec681f3Smrg
887ec681f3Smrgvoid APIENTRY ResourceUpdateSubResourceUP(
897ec681f3Smrg   D3D10DDI_HDEVICE hDevice, D3D10DDI_HRESOURCE hResource,
907ec681f3Smrg   UINT DstSubResource, __in_opt const D3D10_DDI_BOX *pDstBox,
917ec681f3Smrg   __in const void *pSysMemUP, UINT RowPitch, UINT DepthPitch);
927ec681f3Smrg
937ec681f3Smrg#endif   /* RESOURCE_H */
94