xref: /reactos/sdk/include/psdk/dmemmgr.h (revision 4561998a)
1 /*
2  * COPYRIGHT:            This file is in the public domain.
3  * PROJECT:              ReactOS kernel
4  * FILE:                 include/psdk/dmemmgr.h
5  * PURPOSE:              Directx headers
6  * PROGRAMMER:           Magnus Olsen (greatlrd)
7  *
8  */
9 
10 #ifndef __DMEMMGR_INCLUDED__
11 #define __DMEMMGR_INCLUDED__
12 
13 /* Helper macro to enable gcc's extension.  */
14 #ifndef __GNU_EXTENSION
15 #ifdef __GNUC__
16 #define __GNU_EXTENSION __extension__
17 #else
18 #define __GNU_EXTENSION
19 #endif
20 #endif
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
26 #ifndef __NTDDKCOMP__
27 
28 #ifndef FLATPTR_DEFINED
29 typedef ULONG_PTR FLATPTR;
30 #define FLATPTR_DEFINED
31 #endif
32 
33 typedef struct _VIDMEM *LPVIDMEM;
34 
35 #else
36 
37 #ifndef FLATPTR_DEFINED
38 typedef ULONG_PTR FLATPTR;
39 #define FLATPTR_DEFINED
40 #endif
41 
42 typedef struct _VIDEOMEMORY *LPVIDMEM;
43 #endif
44 
45 #define SURFACEALIGN_DISCARDABLE 0x00000001
46 #define VMEMHEAP_LINEAR 0x00000001
47 #define VMEMHEAP_RECTANGULAR 0x00000002
48 #define VMEMHEAP_ALIGNMENT 0x00000004
49 
50 typedef struct _VMEML
51 {
52   struct _VMEML *next;
53   FLATPTR ptr;
54   DWORD size;
55   BOOL bDiscardable;
56 } VMEML, *LPVMEML, *LPLPVMEML;
57 
58 typedef struct _VMEMR
59 {
60   struct _VMEMR *next;
61   struct _VMEMR *prev;
62 
63   struct _VMEMR *pUp;
64   struct _VMEMR *pDown;
65   struct _VMEMR *pLeft;
66   struct _VMEMR *pRight;
67   FLATPTR  ptr;
68   DWORD size;
69   DWORD x;
70   DWORD y;
71   DWORD cx;
72   DWORD cy;
73   DWORD flags;
74   FLATPTR pBits;
75   BOOL bDiscardable;
76 } VMEMR,  *LPVMEMR,  *LPLPVMEMR;
77 
78 typedef struct _SURFACEALIGNMENT
79 {
80   __GNU_EXTENSION union
81   {
82     struct
83     {
84       DWORD dwStartAlignment;
85       DWORD dwPitchAlignment;
86       DWORD dwFlags;
87       DWORD dwReserved2;
88     } Linear;
89     struct
90     {
91       DWORD dwXAlignment;
92       DWORD dwYAlignment;
93       DWORD dwFlags;
94       DWORD dwReserved2;
95     } Rectangular;
96   };
97 } SURFACEALIGNMENT, *LPSURFACEALIGNMENT;
98 
99 typedef struct _HEAPALIGNMENT
100 {
101     DWORD dwSize;
102     DDSCAPS ddsCaps;
103     DWORD dwReserved;
104     SURFACEALIGNMENT ExecuteBuffer;
105     SURFACEALIGNMENT Overlay;
106     SURFACEALIGNMENT Texture;
107     SURFACEALIGNMENT ZBuffer;
108     SURFACEALIGNMENT AlphaBuffer;
109     SURFACEALIGNMENT Offscreen;
110     SURFACEALIGNMENT FlipTarget;
111 } HEAPALIGNMENT, *LPHEAPALIGNMENT;
112 
113 typedef struct _VMEMHEAP
114 {
115     DWORD dwFlags;
116     DWORD stride;
117     LPVOID freeList;
118     LPVOID allocList;
119     DWORD dwTotalSize;
120     FLATPTR fpGARTLin;
121     FLATPTR fpGARTDev;
122     DWORD dwCommitedSize;
123     DWORD dwCoalesceCount;
124     HEAPALIGNMENT Alignment;
125     DDSCAPSEX ddsCapsEx;
126     DDSCAPSEX ddsCapsExAlt;
127 #ifndef IS_16
128     LARGE_INTEGER liPhysAGPBase;
129 #endif
130     HANDLE hdevAGP;
131     LPVOID pvPhysRsrv;
132     BYTE* pAgpCommitMask;
133     DWORD dwAgpCommitMaskSize;
134 } VMEMHEAP, *LPVMEMHEAP;
135 
136 typedef struct _DD_GETHEAPALIGNMENTDATA
137 {
138     ULONG_PTR dwInstance;
139     DWORD dwHeap;
140     HRESULT ddRVal;
141     VOID* GetHeapAlignment;
142     HEAPALIGNMENT Alignment;
143 } DD_GETHEAPALIGNMENTDATA;
144 
145 #ifndef DD_GETHEAPALIGNMENTDATA_DECLARED
146 typedef DD_GETHEAPALIGNMENTDATA *PDD_GETHEAPALIGNMENTDATA;
147 #define DD_GETHEAPALIGNMENTDATA_DECLARED
148 #endif
149 
150 extern void WINAPI VidMemFree( LPVMEMHEAP pvmh, FLATPTR ptr);
151 extern FLATPTR WINAPI VidMemAlloc( LPVMEMHEAP pvmh, DWORD width, DWORD height);
152 
153 extern FLATPTR WINAPI
154        HeapVidMemAllocAligned(
155                                LPVIDMEM lpVidMem,
156                                DWORD dwWidth,
157                                DWORD dwHeight,
158                                LPSURFACEALIGNMENT lpAlignment ,
159                                LPLONG lpNewPitch );
160 
161 
162 
163 
164 
165 
166 #ifdef __cplusplus
167 }
168 #endif
169 
170 #endif
171