nine: Add drirc options (v2)
[mesa.git] / src / gallium / state_trackers / nine / adapter9.h
1 /*
2 * Copyright 2011 Joakim Sindholt <opensource@zhasha.com>
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * on the rights to use, copy, modify, merge, publish, distribute, sub
8 * license, and/or sell copies of the Software, and to permit persons to whom
9 * the Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
13 * Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
19 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
20 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
21 * USE OR OTHER DEALINGS IN THE SOFTWARE. */
22
23 #ifndef _NINE_ADAPTER9_H_
24 #define _NINE_ADAPTER9_H_
25
26 #include "iunknown.h"
27
28 #include "d3dadapter/d3dadapter9.h"
29
30 struct pipe_screen;
31 struct pipe_resource;
32
33 struct d3dadapter9_context
34 {
35 struct pipe_screen *hal, *ref;
36 D3DADAPTER_IDENTIFIER9 identifier;
37 BOOL linear_framebuffer;
38 BOOL throttling;
39 int throttling_value;
40 int vblank_mode;
41
42 void (*destroy)( struct d3dadapter9_context *ctx );
43 };
44
45 struct NineAdapter9
46 {
47 struct NineUnknown base;
48
49 struct d3dadapter9_context *ctx;
50 };
51 static INLINE struct NineAdapter9 *
52 NineAdapter9( void *data )
53 {
54 return (struct NineAdapter9 *)data;
55 }
56
57 HRESULT
58 NineAdapter9_new( struct d3dadapter9_context *pCTX,
59 struct NineAdapter9 **ppOut );
60
61 HRESULT
62 NineAdapter9_ctor( struct NineAdapter9 *This,
63 struct NineUnknownParams *pParams,
64 struct d3dadapter9_context *pCTX );
65
66 void
67 NineAdapter9_dtor( struct NineAdapter9 *This );
68
69 HRESULT WINAPI
70 NineAdapter9_GetAdapterIdentifier( struct NineAdapter9 *This,
71 DWORD Flags,
72 D3DADAPTER_IDENTIFIER9 *pIdentifier );
73
74 HRESULT WINAPI
75 NineAdapter9_CheckDeviceType( struct NineAdapter9 *This,
76 D3DDEVTYPE DevType,
77 D3DFORMAT AdapterFormat,
78 D3DFORMAT BackBufferFormat,
79 BOOL bWindowed );
80
81 HRESULT WINAPI
82 NineAdapter9_CheckDeviceFormat( struct NineAdapter9 *This,
83 D3DDEVTYPE DeviceType,
84 D3DFORMAT AdapterFormat,
85 DWORD Usage,
86 D3DRESOURCETYPE RType,
87 D3DFORMAT CheckFormat );
88
89 HRESULT WINAPI
90 NineAdapter9_CheckDeviceMultiSampleType( struct NineAdapter9 *This,
91 D3DDEVTYPE DeviceType,
92 D3DFORMAT SurfaceFormat,
93 BOOL Windowed,
94 D3DMULTISAMPLE_TYPE MultiSampleType,
95 DWORD *pQualityLevels );
96
97 HRESULT WINAPI
98 NineAdapter9_CheckDepthStencilMatch( struct NineAdapter9 *This,
99 D3DDEVTYPE DeviceType,
100 D3DFORMAT AdapterFormat,
101 D3DFORMAT RenderTargetFormat,
102 D3DFORMAT DepthStencilFormat );
103
104 HRESULT WINAPI
105 NineAdapter9_CheckDeviceFormatConversion( struct NineAdapter9 *This,
106 D3DDEVTYPE DeviceType,
107 D3DFORMAT SourceFormat,
108 D3DFORMAT TargetFormat );
109
110 HRESULT WINAPI
111 NineAdapter9_GetDeviceCaps( struct NineAdapter9 *This,
112 D3DDEVTYPE DeviceType,
113 D3DCAPS9 *pCaps );
114
115 HRESULT WINAPI
116 NineAdapter9_CreateDevice( struct NineAdapter9 *This,
117 UINT RealAdapter,
118 D3DDEVTYPE DeviceType,
119 HWND hFocusWindow,
120 DWORD BehaviorFlags,
121 D3DPRESENT_PARAMETERS *pPresentationParameters,
122 IDirect3D9 *pD3D9,
123 ID3DPresentGroup *pPresentationGroup,
124 IDirect3DDevice9 **ppReturnedDeviceInterface );
125
126 HRESULT WINAPI
127 NineAdapter9_CreateDeviceEx( struct NineAdapter9 *This,
128 UINT RealAdapter,
129 D3DDEVTYPE DeviceType,
130 HWND hFocusWindow,
131 DWORD BehaviorFlags,
132 D3DPRESENT_PARAMETERS *pPresentationParameters,
133 D3DDISPLAYMODEEX *pFullscreenDisplayMode,
134 IDirect3D9Ex *pD3D9Ex,
135 ID3DPresentGroup *pPresentationGroup,
136 IDirect3DDevice9Ex **ppReturnedDeviceInterface );
137
138 #endif /* _NINE_ADAPTER9_H_ */