xref: /aosp_15_r20/external/mesa3d/include/d3dadapter/d3dadapter9.h (revision 6104692788411f58d303aa86923a9ff6ecaded22)
1*61046927SAndroid Build Coastguard Worker /*
2*61046927SAndroid Build Coastguard Worker  * Copyright 2011 Joakim Sindholt <[email protected]>
3*61046927SAndroid Build Coastguard Worker  *
4*61046927SAndroid Build Coastguard Worker  * Permission is hereby granted, free of charge, to any person obtaining a
5*61046927SAndroid Build Coastguard Worker  * copy of this software and associated documentation files (the "Software"),
6*61046927SAndroid Build Coastguard Worker  * to deal in the Software without restriction, including without limitation
7*61046927SAndroid Build Coastguard Worker  * on the rights to use, copy, modify, merge, publish, distribute, sub
8*61046927SAndroid Build Coastguard Worker  * license, and/or sell copies of the Software, and to permit persons to whom
9*61046927SAndroid Build Coastguard Worker  * the Software is furnished to do so, subject to the following conditions:
10*61046927SAndroid Build Coastguard Worker  *
11*61046927SAndroid Build Coastguard Worker  * The above copyright notice and this permission notice (including the next
12*61046927SAndroid Build Coastguard Worker  * paragraph) shall be included in all copies or substantial portions of the
13*61046927SAndroid Build Coastguard Worker  * Software.
14*61046927SAndroid Build Coastguard Worker  *
15*61046927SAndroid Build Coastguard Worker  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16*61046927SAndroid Build Coastguard Worker  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17*61046927SAndroid Build Coastguard Worker  * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
18*61046927SAndroid Build Coastguard Worker  * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
19*61046927SAndroid Build Coastguard Worker  * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
20*61046927SAndroid Build Coastguard Worker  * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
21*61046927SAndroid Build Coastguard Worker  * USE OR OTHER DEALINGS IN THE SOFTWARE. */
22*61046927SAndroid Build Coastguard Worker 
23*61046927SAndroid Build Coastguard Worker #ifndef _D3DADAPTER9_H_
24*61046927SAndroid Build Coastguard Worker #define _D3DADAPTER9_H_
25*61046927SAndroid Build Coastguard Worker 
26*61046927SAndroid Build Coastguard Worker #include "present.h"
27*61046927SAndroid Build Coastguard Worker 
28*61046927SAndroid Build Coastguard Worker #ifndef __cplusplus
29*61046927SAndroid Build Coastguard Worker 
30*61046927SAndroid Build Coastguard Worker /* Representation of an adapter group, although since this is implemented by
31*61046927SAndroid Build Coastguard Worker  * the driver, it knows nothing about the windowing system it's on */
32*61046927SAndroid Build Coastguard Worker typedef struct ID3DAdapter9Vtbl
33*61046927SAndroid Build Coastguard Worker {
34*61046927SAndroid Build Coastguard Worker     /* IUnknown */
35*61046927SAndroid Build Coastguard Worker     HRESULT (WINAPI *QueryInterface)(ID3DAdapter9 *This, REFIID riid, void **ppvObject);
36*61046927SAndroid Build Coastguard Worker     ULONG (WINAPI *AddRef)(ID3DAdapter9 *This);
37*61046927SAndroid Build Coastguard Worker     ULONG (WINAPI *Release)(ID3DAdapter9 *This);
38*61046927SAndroid Build Coastguard Worker 
39*61046927SAndroid Build Coastguard Worker     /* ID3DAdapter9 */
40*61046927SAndroid Build Coastguard Worker     HRESULT (WINAPI *GetAdapterIdentifier)(ID3DAdapter9 *This, DWORD Flags, D3DADAPTER_IDENTIFIER9 *pIdentifier);
41*61046927SAndroid Build Coastguard Worker     HRESULT (WINAPI *CheckDeviceType)(ID3DAdapter9 *This, D3DDEVTYPE DevType, D3DFORMAT AdapterFormat, D3DFORMAT BackBufferFormat, BOOL bWindowed);
42*61046927SAndroid Build Coastguard Worker     HRESULT (WINAPI *CheckDeviceFormat)(ID3DAdapter9 *This, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat, DWORD Usage, D3DRESOURCETYPE RType, D3DFORMAT CheckFormat);
43*61046927SAndroid Build Coastguard Worker     HRESULT (WINAPI *CheckDeviceMultiSampleType)(ID3DAdapter9 *This, D3DDEVTYPE DeviceType, D3DFORMAT SurfaceFormat, BOOL Windowed, D3DMULTISAMPLE_TYPE MultiSampleType, DWORD *pQualityLevels);
44*61046927SAndroid Build Coastguard Worker     HRESULT (WINAPI *CheckDepthStencilMatch)(ID3DAdapter9 *This, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat, D3DFORMAT RenderTargetFormat, D3DFORMAT DepthStencilFormat);
45*61046927SAndroid Build Coastguard Worker     HRESULT (WINAPI *CheckDeviceFormatConversion)(ID3DAdapter9 *This, D3DDEVTYPE DeviceType, D3DFORMAT SourceFormat, D3DFORMAT TargetFormat);
46*61046927SAndroid Build Coastguard Worker     HRESULT (WINAPI *GetDeviceCaps)(ID3DAdapter9 *This, D3DDEVTYPE DeviceType, D3DCAPS9 *pCaps);
47*61046927SAndroid Build Coastguard Worker     HRESULT (WINAPI *CreateDevice)(ID3DAdapter9 *This, UINT RealAdapter, D3DDEVTYPE DeviceType, HWND hFocusWindow, DWORD BehaviorFlags, D3DPRESENT_PARAMETERS *pPresentationParameters, IDirect3D9 *pD3D9, ID3DPresentGroup *pPresentationFactory, IDirect3DDevice9 **ppReturnedDeviceInterface);
48*61046927SAndroid Build Coastguard Worker     HRESULT (WINAPI *CreateDeviceEx)(ID3DAdapter9 *This, UINT RealAdapter, D3DDEVTYPE DeviceType, HWND hFocusWindow, DWORD BehaviorFlags, D3DPRESENT_PARAMETERS *pPresentationParameters, D3DDISPLAYMODEEX *pFullscreenDisplayMode, IDirect3D9Ex *pD3D9Ex, ID3DPresentGroup *pPresentationFactory, IDirect3DDevice9Ex **ppReturnedDeviceInterface);
49*61046927SAndroid Build Coastguard Worker } ID3DAdapter9Vtbl;
50*61046927SAndroid Build Coastguard Worker 
51*61046927SAndroid Build Coastguard Worker struct ID3DAdapter9
52*61046927SAndroid Build Coastguard Worker {
53*61046927SAndroid Build Coastguard Worker     ID3DAdapter9Vtbl *lpVtbl;
54*61046927SAndroid Build Coastguard Worker };
55*61046927SAndroid Build Coastguard Worker 
56*61046927SAndroid Build Coastguard Worker /* IUnknown macros */
57*61046927SAndroid Build Coastguard Worker #define ID3DAdapter9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
58*61046927SAndroid Build Coastguard Worker #define ID3DAdapter9_AddRef(p) (p)->lpVtbl->AddRef(p)
59*61046927SAndroid Build Coastguard Worker #define ID3DAdapter9_Release(p) (p)->lpVtbl->Release(p)
60*61046927SAndroid Build Coastguard Worker /* ID3DAdapter9 macros */
61*61046927SAndroid Build Coastguard Worker #define ID3DAdapter9_GetAdapterIdentifier(p,a,b) (p)->lpVtbl->GetAdapterIdentifier(p,a,b)
62*61046927SAndroid Build Coastguard Worker #define ID3DAdapter9_CheckDeviceType(p,a,b,c,d) (p)->lpVtbl->CheckDeviceType(p,a,b,c,d)
63*61046927SAndroid Build Coastguard Worker #define ID3DAdapter9_CheckDeviceFormat(p,a,b,c,d,e) (p)->lpVtbl->CheckDeviceFormat(p,a,b,c,d,e)
64*61046927SAndroid Build Coastguard Worker #define ID3DAdapter9_CheckDeviceMultiSampleType(p,a,b,c,d,e) (p)->lpVtbl->CheckDeviceMultiSampleType(p,a,b,c,d,e)
65*61046927SAndroid Build Coastguard Worker #define ID3DAdapter9_CheckDepthStencilMatch(p,a,b,c,d) (p)->lpVtbl->CheckDepthStencilMatch(p,a,b,c,d)
66*61046927SAndroid Build Coastguard Worker #define ID3DAdapter9_CheckDeviceFormatConversion(p,a,b,c) (p)->lpVtbl->CheckDeviceFormatConversion(p,a,b,c)
67*61046927SAndroid Build Coastguard Worker #define ID3DAdapter9_GetDeviceCaps(p,a,b) (p)->lpVtbl->GetDeviceCaps(p,a,b)
68*61046927SAndroid Build Coastguard Worker #define ID3DAdapter9_CreateDevice(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->CreateDevice(p,a,b,c,d,e,f,g,h)
69*61046927SAndroid Build Coastguard Worker #define ID3DAdapter9_CreateDeviceEx(p,a,b,c,d,e,f,g,h,i) (p)->lpVtbl->CreateDeviceEx(p,a,b,c,d,e,f,g,h,i)
70*61046927SAndroid Build Coastguard Worker 
71*61046927SAndroid Build Coastguard Worker #else /* __cplusplus */
72*61046927SAndroid Build Coastguard Worker 
73*61046927SAndroid Build Coastguard Worker struct ID3DAdapter9 : public IUnknown
74*61046927SAndroid Build Coastguard Worker {
75*61046927SAndroid Build Coastguard Worker     HRESULT WINAPI GetAdapterIdentifier(DWORD Flags, D3DADAPTER_IDENTIFIER9 *pIdentifier);
76*61046927SAndroid Build Coastguard Worker     HRESULT WINAPI CheckDeviceType(D3DDEVTYPE DevType, D3DFORMAT AdapterFormat, D3DFORMAT BackBufferFormat, BOOL bWindowed);
77*61046927SAndroid Build Coastguard Worker     HRESULT WINAPI CheckDeviceFormat(D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat, DWORD Usage, D3DRESOURCETYPE RType, D3DFORMAT CheckFormat);
78*61046927SAndroid Build Coastguard Worker     HRESULT WINAPI CheckDeviceMultiSampleType(D3DDEVTYPE DeviceType, D3DFORMAT SurfaceFormat, BOOL Windowed, D3DMULTISAMPLE_TYPE MultiSampleType, DWORD *pQualityLevels);
79*61046927SAndroid Build Coastguard Worker     HRESULT WINAPI CheckDepthStencilMatch(D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat, D3DFORMAT RenderTargetFormat, D3DFORMAT DepthStencilFormat);
80*61046927SAndroid Build Coastguard Worker     HRESULT WINAPI CheckDeviceFormatConversion(D3DDEVTYPE DeviceType, D3DFORMAT SourceFormat, D3DFORMAT TargetFormat);
81*61046927SAndroid Build Coastguard Worker     HRESULT WINAPI GetDeviceCaps(D3DDEVTYPE DeviceType, D3DCAPS9 *pCaps);
82*61046927SAndroid Build Coastguard Worker     HRESULT WINAPI CreateDevice(UINT RealAdapter, D3DDEVTYPE DeviceType, HWND hFocusWindow, DWORD BehaviorFlags, D3DPRESENT_PARAMETERS *pPresentationParameters, IDirect3D9 *pD3D9, ID3DPresentGroup *pPresentationFactory, IDirect3DDevice9 **ppReturnedDeviceInterface);
83*61046927SAndroid Build Coastguard Worker     HRESULT WINAPI CreateDeviceEx(UINT RealAdapter, D3DDEVTYPE DeviceType, HWND hFocusWindow, DWORD BehaviorFlags, D3DPRESENT_PARAMETERS *pPresentationParameters, D3DDISPLAYMODEEX *pFullscreenDisplayMode, IDirect3D9Ex *pD3D9Ex, ID3DPresentGroup *pPresentationFactory, IDirect3DDevice9Ex **ppReturnedDeviceInterface);
84*61046927SAndroid Build Coastguard Worker };
85*61046927SAndroid Build Coastguard Worker 
86*61046927SAndroid Build Coastguard Worker #endif /* __cplusplus */
87*61046927SAndroid Build Coastguard Worker 
88*61046927SAndroid Build Coastguard Worker #ifdef __cplusplus
89*61046927SAndroid Build Coastguard Worker extern "C" {
90*61046927SAndroid Build Coastguard Worker #endif /* __cplusplus */
91*61046927SAndroid Build Coastguard Worker 
92*61046927SAndroid Build Coastguard Worker /* acquire a const struct D3DAdapter9* structure describing the interface
93*61046927SAndroid Build Coastguard Worker  * queried. See  */
94*61046927SAndroid Build Coastguard Worker const void * WINAPI
95*61046927SAndroid Build Coastguard Worker D3DAdapter9GetProc( const char *name );
96*61046927SAndroid Build Coastguard Worker 
97*61046927SAndroid Build Coastguard Worker #ifdef __cplusplus
98*61046927SAndroid Build Coastguard Worker }
99*61046927SAndroid Build Coastguard Worker #endif /* __cplusplus */
100*61046927SAndroid Build Coastguard Worker 
101*61046927SAndroid Build Coastguard Worker #endif /* _D3DADAPTER9_H_ */
102