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_DEVICE9EX_H_
24#define _NINE_DEVICE9EX_H_
25
26#include "device9.h"
27
28struct NineDevice9Ex
29{
30    struct NineDevice9 base;
31};
32static inline struct NineDevice9Ex *
33NineDevice9Ex( void *data )
34{
35    return (struct NineDevice9Ex *)data;
36}
37
38HRESULT
39NineDevice9Ex_new( struct pipe_screen *pScreen,
40                   D3DDEVICE_CREATION_PARAMETERS *pCreationParameters,
41                   D3DCAPS9 *pCaps,
42                   D3DPRESENT_PARAMETERS *pPresentationParameters,
43                   D3DDISPLAYMODEEX *pFullscreenDisplayMode,
44                   IDirect3D9Ex *pD3D9Ex,
45                   ID3DPresentGroup *pPresentationGroup,
46                   struct d3dadapter9_context *pCTX,
47                   struct NineDevice9Ex **ppOut,
48                   int minorVersionNum );
49
50HRESULT NINE_WINAPI
51NineDevice9Ex_SetConvolutionMonoKernel( struct NineDevice9Ex *This,
52                                        UINT width,
53                                        UINT height,
54                                        float *rows,
55                                        float *columns );
56
57HRESULT NINE_WINAPI
58NineDevice9Ex_ComposeRects( struct NineDevice9Ex *This,
59                            IDirect3DSurface9 *pSrc,
60                            IDirect3DSurface9 *pDst,
61                            IDirect3DVertexBuffer9 *pSrcRectDescs,
62                            UINT NumRects,
63                            IDirect3DVertexBuffer9 *pDstRectDescs,
64                            D3DCOMPOSERECTSOP Operation,
65                            int Xoffset,
66                            int Yoffset );
67
68HRESULT NINE_WINAPI
69NineDevice9Ex_PresentEx( struct NineDevice9Ex *This,
70                         const RECT *pSourceRect,
71                         const RECT *pDestRect,
72                         HWND hDestWindowOverride,
73                         const RGNDATA *pDirtyRegion,
74                         DWORD dwFlags );
75
76HRESULT NINE_WINAPI
77NineDevice9Ex_Present( struct NineDevice9Ex *This,
78                     const RECT *pSourceRect,
79                     const RECT *pDestRect,
80                     HWND hDestWindowOverride,
81                     const RGNDATA *pDirtyRegion );
82
83HRESULT NINE_WINAPI
84NineDevice9Ex_GetGPUThreadPriority( struct NineDevice9Ex *This,
85                                    INT *pPriority );
86
87HRESULT NINE_WINAPI
88NineDevice9Ex_SetGPUThreadPriority( struct NineDevice9Ex *This,
89                                    INT Priority );
90
91HRESULT NINE_WINAPI
92NineDevice9Ex_WaitForVBlank( struct NineDevice9Ex *This,
93                             UINT iSwapChain );
94
95HRESULT NINE_WINAPI
96NineDevice9Ex_CheckResourceResidency( struct NineDevice9Ex *This,
97                                      IDirect3DResource9 **pResourceArray,
98                                      UINT32 NumResources );
99
100HRESULT NINE_WINAPI
101NineDevice9Ex_SetMaximumFrameLatency( struct NineDevice9Ex *This,
102                                      UINT MaxLatency );
103
104HRESULT NINE_WINAPI
105NineDevice9Ex_GetMaximumFrameLatency( struct NineDevice9Ex *This,
106                                      UINT *pMaxLatency );
107
108HRESULT NINE_WINAPI
109NineDevice9Ex_CheckDeviceState( struct NineDevice9Ex *This,
110                                HWND hDestinationWindow );
111
112HRESULT NINE_WINAPI
113NineDevice9Ex_CreateRenderTargetEx( struct NineDevice9Ex *This,
114                                    UINT Width,
115                                    UINT Height,
116                                    D3DFORMAT Format,
117                                    D3DMULTISAMPLE_TYPE MultiSample,
118                                    DWORD MultisampleQuality,
119                                    BOOL Lockable,
120                                    IDirect3DSurface9 **ppSurface,
121                                    HANDLE *pSharedHandle,
122                                    DWORD Usage );
123
124HRESULT NINE_WINAPI
125NineDevice9Ex_CreateOffscreenPlainSurfaceEx( struct NineDevice9Ex *This,
126                                             UINT Width,
127                                             UINT Height,
128                                             D3DFORMAT Format,
129                                             D3DPOOL Pool,
130                                             IDirect3DSurface9 **ppSurface,
131                                             HANDLE *pSharedHandle,
132                                             DWORD Usage );
133
134HRESULT NINE_WINAPI
135NineDevice9Ex_CreateDepthStencilSurfaceEx( struct NineDevice9Ex *This,
136                                           UINT Width,
137                                           UINT Height,
138                                           D3DFORMAT Format,
139                                           D3DMULTISAMPLE_TYPE MultiSample,
140                                           DWORD MultisampleQuality,
141                                           BOOL Discard,
142                                           IDirect3DSurface9 **ppSurface,
143                                           HANDLE *pSharedHandle,
144                                           DWORD Usage );
145
146HRESULT NINE_WINAPI
147NineDevice9Ex_ResetEx( struct NineDevice9Ex *This,
148                       D3DPRESENT_PARAMETERS *pPresentationParameters,
149                       D3DDISPLAYMODEEX *pFullscreenDisplayMode );
150
151HRESULT NINE_WINAPI
152NineDevice9Ex_Reset( struct NineDevice9Ex *This,
153                     D3DPRESENT_PARAMETERS *pPresentationParameters );
154
155HRESULT NINE_WINAPI
156NineDevice9Ex_GetDisplayModeEx( struct NineDevice9Ex *This,
157                                UINT iSwapChain,
158                                D3DDISPLAYMODEEX *pMode,
159                                D3DDISPLAYROTATION *pRotation );
160
161HRESULT NINE_WINAPI
162NineDevice9Ex_TestCooperativeLevel( struct NineDevice9Ex *This );
163
164#endif /* _NINE_DEVICE9EX_H_ */
165