1/**************************************************************************
2 *
3 * Copyright 2012-2021 VMware, Inc.
4 * All Rights Reserved.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sub license, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
17 * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
18 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20 * USE OR OTHER DEALINGS IN THE SOFTWARE.
21 *
22 * The above copyright notice and this permission notice (including the
23 * next paragraph) shall be included in all copies or substantial portions
24 * of the Software.
25 *
26 **************************************************************************/
27
28/*
29 * Resource.h --
30 *    Functions that manipulate GPU resources.
31 */
32
33#ifndef RESOURCE_H
34#define RESOURCE_H
35
36#include "DriverIncludes.h"
37
38SIZE_T APIENTRY CalcPrivateResourceSize(
39   D3D10DDI_HDEVICE hDevice,
40   __in const D3D10DDIARG_CREATERESOURCE *pCreateResource);
41
42void APIENTRY CreateResource(
43   D3D10DDI_HDEVICE hDevice,
44   __in const D3D10DDIARG_CREATERESOURCE *pCreateResource,
45   D3D10DDI_HRESOURCE hResource,
46   D3D10DDI_HRTRESOURCE hRTResource);
47
48SIZE_T APIENTRY CalcPrivateOpenedResourceSize(
49   D3D10DDI_HDEVICE hDevice,
50   __in const D3D10DDIARG_OPENRESOURCE *pOpenResource);
51
52void APIENTRY OpenResource(
53   D3D10DDI_HDEVICE hDevice,
54   __in const D3D10DDIARG_OPENRESOURCE *pOpenResource,
55   D3D10DDI_HRESOURCE hResource,
56   D3D10DDI_HRTRESOURCE hRTResource);
57
58void APIENTRY DestroyResource(D3D10DDI_HDEVICE hDevice, D3D10DDI_HRESOURCE hResource);
59
60void APIENTRY ResourceMap(D3D10DDI_HDEVICE hDevice, D3D10DDI_HRESOURCE hResource,
61                 UINT SubResource, D3D10_DDI_MAP DDIMap, UINT Flags,
62                 __out D3D10DDI_MAPPED_SUBRESOURCE *pMappedSubResource);
63
64void APIENTRY ResourceUnmap(D3D10DDI_HDEVICE hDevice, D3D10DDI_HRESOURCE hResource,
65                   UINT SubResource);
66
67void APIENTRY ResourceCopy(D3D10DDI_HDEVICE hDevice, D3D10DDI_HRESOURCE hDstResource,
68                  D3D10DDI_HRESOURCE hSrcResource);
69
70void APIENTRY ResourceCopyRegion(D3D10DDI_HDEVICE hDevice, D3D10DDI_HRESOURCE hResource,
71                        UINT DstSubResource, UINT DstX, UINT DstY, UINT DstZ,
72                        D3D10DDI_HRESOURCE hSrcResource, UINT SrcSubResource,
73                        __in_opt const D3D10_DDI_BOX *pSrcBox);
74
75void APIENTRY ResourceResolveSubResource(D3D10DDI_HDEVICE hDevice,
76                                D3D10DDI_HRESOURCE hDstResource,
77                                UINT DstSubResource,
78                                D3D10DDI_HRESOURCE hSrcResource,
79                                UINT SrcSubResource,
80                                DXGI_FORMAT ResolveFormat);
81
82BOOL APIENTRY ResourceIsStagingBusy(D3D10DDI_HDEVICE hDevice,
83                           D3D10DDI_HRESOURCE hResource);
84
85void APIENTRY ResourceReadAfterWriteHazard(D3D10DDI_HDEVICE hDevice,
86                                  D3D10DDI_HRESOURCE hResource);
87
88void APIENTRY ResourceUpdateSubResourceUP(
89   D3D10DDI_HDEVICE hDevice, D3D10DDI_HRESOURCE hResource,
90   UINT DstSubResource, __in_opt const D3D10_DDI_BOX *pDstBox,
91   __in const void *pSysMemUP, UINT RowPitch, UINT DepthPitch);
92
93#endif   /* RESOURCE_H */
94