wined3d: Unroll SM4+ pixel shader inputs.
[wine.git] / include / dxgi.idl
blob0626315b52b13bac3841e9528bcf3e20a5871fef
1 /*
2 * Copyright 2007 Andras Kovacs
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 import "oaidl.idl";
20 import "ocidl.idl";
21 import "dxgitype.idl";
23 const UINT _FACDXGI = 0x87a;
25 cpp_quote("#define MAKE_DXGI_STATUS(x) MAKE_HRESULT(0, _FACDXGI, x)")
26 cpp_quote("#define MAKE_DXGI_HRESULT(x) MAKE_HRESULT(1, _FACDXGI, x)")
28 cpp_quote("#if 0")
29 typedef HANDLE HMONITOR;
30 typedef struct _LUID {
31 DWORD LowPart;
32 LONG HighPart;
33 } LUID, *PLUID;
34 cpp_quote("#endif")
36 typedef UINT DXGI_USAGE;
37 const DXGI_USAGE DXGI_USAGE_SHADER_INPUT = 0x10L;
38 const DXGI_USAGE DXGI_USAGE_RENDER_TARGET_OUTPUT = 0x20L;
39 const DXGI_USAGE DXGI_USAGE_BACK_BUFFER = 0x40L;
40 const DXGI_USAGE DXGI_USAGE_SHARED = 0x80L;
41 const DXGI_USAGE DXGI_USAGE_READ_ONLY = 0x100L;
42 const DXGI_USAGE DXGI_USAGE_DISCARD_ON_PRESENT = 0x200L;
43 const DXGI_USAGE DXGI_USAGE_UNORDERED_ACCESS = 0x400L;
45 const UINT DXGI_ENUM_MODES_INTERLACED = 1;
46 const UINT DXGI_ENUM_MODES_SCALING = 2;
48 const UINT DXGI_RESOURCE_PRIORITY_MINIMUM = 0x28000000;
49 const UINT DXGI_RESOURCE_PRIORITY_LOW = 0x50000000;
50 const UINT DXGI_RESOURCE_PRIORITY_NORMAL = 0x78000000;
51 const UINT DXGI_RESOURCE_PRIORITY_HIGH = 0xa0000000;
52 const UINT DXGI_RESOURCE_PRIORITY_MAXIMUM = 0xc8000000;
54 const UINT DXGI_MAP_READ = 0x1;
55 const UINT DXGI_MAP_WRITE = 0x2;
56 const UINT DXGI_MAP_DISCARD = 0x4;
58 typedef enum DXGI_SWAP_EFFECT {
59 DXGI_SWAP_EFFECT_DISCARD = 0,
60 DXGI_SWAP_EFFECT_SEQUENTIAL = 1,
61 DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL = 3,
62 DXGI_SWAP_EFFECT_FLIP_DISCARD = 4
63 } DXGI_SWAP_EFFECT;
65 typedef enum DXGI_RESIDENCY {
66 DXGI_RESIDENCY_FULLY_RESIDENT = 1,
67 DXGI_RESIDENCY_RESIDENT_IN_SHARED_MEMORY = 2,
68 DXGI_RESIDENCY_EVICTED_TO_DISK = 3,
69 } DXGI_RESIDENCY;
71 typedef struct DXGI_SURFACE_DESC {
72 UINT Width;
73 UINT Height;
74 DXGI_FORMAT Format;
75 DXGI_SAMPLE_DESC SampleDesc;
76 } DXGI_SURFACE_DESC;
78 typedef struct DXGI_MAPPED_RECT {
79 INT Pitch;
80 BYTE *pBits;
81 } DXGI_MAPPED_RECT;
83 typedef struct DXGI_OUTPUT_DESC {
84 WCHAR DeviceName[32];
85 RECT DesktopCoordinates;
86 BOOL AttachedToDesktop;
87 DXGI_MODE_ROTATION Rotation;
88 HMONITOR Monitor;
89 } DXGI_OUTPUT_DESC;
91 typedef struct DXGI_FRAME_STATISTICS {
92 UINT PresentCount;
93 UINT PresentRefreshCount;
94 UINT SyncRefreshCount;
95 LARGE_INTEGER SyncQPCTime;
96 LARGE_INTEGER SyncGPUTime;
97 } DXGI_FRAME_STATISTICS;
99 typedef struct DXGI_ADAPTER_DESC {
100 WCHAR Description[128];
101 UINT VendorId;
102 UINT DeviceId;
103 UINT SubSysId;
104 UINT Revision;
105 SIZE_T DedicatedVideoMemory;
106 SIZE_T DedicatedSystemMemory;
107 SIZE_T SharedSystemMemory;
108 LUID AdapterLuid;
109 } DXGI_ADAPTER_DESC;
111 typedef enum DXGI_SWAP_CHAIN_FLAG {
112 DXGI_SWAP_CHAIN_FLAG_NONPREROTATED = 1,
113 DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH = 2,
114 DXGI_SWAP_CHAIN_FLAG_GDI_COMPATIBLE = 4
115 } DXGI_SWAP_CHAIN_FLAG;
117 typedef struct DXGI_SWAP_CHAIN_DESC {
118 DXGI_MODE_DESC BufferDesc;
119 DXGI_SAMPLE_DESC SampleDesc;
120 DXGI_USAGE BufferUsage;
121 UINT BufferCount;
122 HWND OutputWindow;
123 BOOL Windowed;
124 DXGI_SWAP_EFFECT SwapEffect;
125 UINT Flags;
126 } DXGI_SWAP_CHAIN_DESC;
128 typedef struct DXGI_SHARED_RESOURCE {
129 HANDLE Handle;
130 } DXGI_SHARED_RESOURCE;
133 object,
134 local,
135 uuid(aec22fb8-76f3-4639-9be0-28eb43a67a2e)
137 interface IDXGIObject : IUnknown
139 HRESULT SetPrivateData(
140 [in] REFGUID guid,
141 [in] UINT data_size,
142 [in] const void *data
144 HRESULT SetPrivateDataInterface(
145 [in] REFGUID guid,
146 [in] const IUnknown *object
148 HRESULT GetPrivateData(
149 [in] REFGUID guid,
150 [in, out] UINT *data_size,
151 [out] void *data
153 HRESULT GetParent(
154 [in] REFIID riid,
155 [out] void **parent
160 object,
161 local,
162 uuid(3d3e0379-f9de-4d58-bb6c-18d62992f1a6)
164 interface IDXGIDeviceSubObject : IDXGIObject
166 HRESULT GetDevice(
167 [in] REFIID riid,
168 [out] void **device
173 object,
174 uuid(035f3ab4-482e-4e50-b41f-8a7f8bd8960b),
175 local,
176 pointer_default(unique)
178 interface IDXGIResource : IDXGIDeviceSubObject
180 HRESULT GetSharedHandle([out] HANDLE *pSharedHandle);
181 HRESULT GetUsage([out] DXGI_USAGE *pUsage);
182 HRESULT SetEvictionPriority([in] UINT EvictionPriority);
183 HRESULT GetEvictionPriority([out, retval] UINT *pEvictionPriority);
187 object,
188 uuid(9d8e1289-d7b3-465f-8126-250e349af85d),
189 local,
190 pointer_default(unique)
192 interface IDXGIKeyedMutex : IDXGIDeviceSubObject
194 HRESULT AcquireSync([in] UINT64 Key, [in] DWORD dwMilliseconds);
195 HRESULT ReleaseSync([in] UINT64 Key);
199 object,
200 local,
201 uuid(cafcb56c-6ac3-4889-bf47-9e23bbd260ec)
203 interface IDXGISurface : IDXGIDeviceSubObject
205 HRESULT GetDesc(
206 [out] DXGI_SURFACE_DESC *desc
208 HRESULT Map(
209 [out] DXGI_MAPPED_RECT *mapped_rect,
210 [in] UINT flags
212 HRESULT Unmap(
217 object,
218 local,
219 uuid(4ae63092-6327-4c1b-80ae-bfe12ea32b86)
221 interface IDXGISurface1 : IDXGISurface
223 HRESULT GetDC(
224 [in] BOOL discard,
225 [out] HDC *hdc
227 HRESULT ReleaseDC(
228 [in] RECT *dirty_rect
233 object,
234 local,
235 uuid(ae02eedb-c735-4690-8d52-5a8dc20213aa)
237 interface IDXGIOutput : IDXGIObject
239 HRESULT GetDesc(
240 [out] DXGI_OUTPUT_DESC *desc
242 HRESULT GetDisplayModeList(
243 [in] DXGI_FORMAT format,
244 [in] UINT flags,
245 [in, out] UINT *mode_count,
246 [out] DXGI_MODE_DESC *desc
248 HRESULT FindClosestMatchingMode(
249 [in] const DXGI_MODE_DESC *mode,
250 [out] DXGI_MODE_DESC *closest_match,
251 [in] IUnknown *device
253 HRESULT WaitForVBlank(
255 HRESULT TakeOwnership(
256 [in] IUnknown *device,
257 [in] BOOL exclusive
259 void ReleaseOwnership(
261 HRESULT GetGammaControlCapabilities(
262 [out] DXGI_GAMMA_CONTROL_CAPABILITIES *gamma_caps
264 HRESULT SetGammaControl(
265 [in] const DXGI_GAMMA_CONTROL *gamma_control
267 HRESULT GetGammaControl(
268 [out] DXGI_GAMMA_CONTROL *gamma_control
270 HRESULT SetDisplaySurface(
271 [in] IDXGISurface *surface
273 HRESULT GetDisplaySurfaceData(
274 [in] IDXGISurface *surface
276 HRESULT GetFrameStatistics(
277 [out] DXGI_FRAME_STATISTICS *stats
282 object,
283 local,
284 uuid(2411e7e1-12ac-4ccf-bd14-9798e8534dc0)
286 interface IDXGIAdapter : IDXGIObject
288 HRESULT EnumOutputs(
289 [in] UINT output_idx,
290 [in, out] IDXGIOutput **output
292 HRESULT GetDesc(
293 [out] DXGI_ADAPTER_DESC *desc
295 HRESULT CheckInterfaceSupport(
296 [in] REFGUID guid,
297 [out] LARGE_INTEGER *umd_version
301 cpp_quote("#define DXGI_MAX_SWAP_CHAIN_BUFFERS (16)")
303 cpp_quote("#define DXGI_PRESENT_TEST __MSABI_LONG(0x00000001U)")
304 cpp_quote("#define DXGI_PRESENT_DO_NOT_SEQUENCE __MSABI_LONG(0x00000002U)")
305 cpp_quote("#define DXGI_PRESENT_RESTART __MSABI_LONG(0x00000004U)")
306 cpp_quote("#define DXGI_PRESENT_DO_NOT_WAIT __MSABI_LONG(0x00000008U)")
307 cpp_quote("#define DXGI_PRESENT_STEREO_PREFER_RIGHT __MSABI_LONG(0x00000010U)")
308 cpp_quote("#define DXGI_PRESENT_STEREO_TEMPORARY_MONO __MSABI_LONG(0x00000020U)")
309 cpp_quote("#define DXGI_PRESENT_RESTRICT_TO_OUTPUT __MSABI_LONG(0x00000040U)")
310 cpp_quote("#define DXGI_PRESENT_USE_DURATION __MSABI_LONG(0x00000100U)")
311 cpp_quote("#define DXGI_PRESENT_ALLOW_TEARING __MSABI_LONG(0x00000200U)")
314 object,
315 local,
316 uuid(310d36a0-d2e7-4c0a-aa04-6a9d23b8886a)
318 interface IDXGISwapChain : IDXGIDeviceSubObject
320 HRESULT Present(
321 [in] UINT sync_interval,
322 [in] UINT flags
324 HRESULT GetBuffer(
325 [in] UINT buffer_idx,
326 [in] REFIID riid,
327 [in, out] void **surface
329 HRESULT SetFullscreenState(
330 [in] BOOL fullscreen,
331 [in] IDXGIOutput *target
333 HRESULT GetFullscreenState(
334 [out] BOOL *fullscreen,
335 [out] IDXGIOutput **target
337 HRESULT GetDesc(
338 [out] DXGI_SWAP_CHAIN_DESC *desc
340 HRESULT ResizeBuffers(
341 [in] UINT buffer_count,
342 [in] UINT width,
343 [in] UINT height,
344 [in] DXGI_FORMAT format,
345 [in] UINT flags
347 HRESULT ResizeTarget(
348 [in] const DXGI_MODE_DESC *target_mode_desc
350 HRESULT GetContainingOutput(
351 [out] IDXGIOutput **output
353 HRESULT GetFrameStatistics(
354 [out] DXGI_FRAME_STATISTICS *stats
356 HRESULT GetLastPresentCount(
357 [out] UINT *last_present_count
361 cpp_quote("#define DXGI_MWA_NO_WINDOW_CHANGES 0x1")
362 cpp_quote("#define DXGI_MWA_NO_ALT_ENTER 0x2")
363 cpp_quote("#define DXGI_MWA_NO_PRINT_SCREEN 0x4")
364 cpp_quote("#define DXGI_MWA_VALID 0x7")
367 object,
368 local,
369 uuid(7b7166ec-21c7-44ae-b21a-c9ae321ae369)
371 interface IDXGIFactory : IDXGIObject
373 HRESULT EnumAdapters(
374 [in] UINT adapter_idx,
375 [out] IDXGIAdapter **adapter
377 HRESULT MakeWindowAssociation(
378 [in] HWND window,
379 [in] UINT flags
381 HRESULT GetWindowAssociation(
382 [in] HWND *window
384 HRESULT CreateSwapChain(
385 [in] IUnknown *device,
386 [in] DXGI_SWAP_CHAIN_DESC *desc,
387 [out] IDXGISwapChain **swapchain
389 HRESULT CreateSoftwareAdapter(
390 [in] HMODULE swrast,
391 [out] IDXGIAdapter **adapter
395 [local] HRESULT __stdcall CreateDXGIFactory(REFIID riid, void **factory);
396 [local] HRESULT __stdcall CreateDXGIFactory1(REFIID riid, void **factory);
399 object,
400 local,
401 uuid(54ec77fa-1377-44e6-8c32-88fd5f44c84c)
403 interface IDXGIDevice : IDXGIObject
405 HRESULT GetAdapter(
406 [out] IDXGIAdapter **adapter
408 HRESULT CreateSurface(
409 [in] const DXGI_SURFACE_DESC *desc,
410 [in] UINT surface_count,
411 [in] DXGI_USAGE usage,
412 [in] const DXGI_SHARED_RESOURCE *shared_resource,
413 [out] IDXGISurface **surface
415 HRESULT QueryResourceResidency(
416 [in] IUnknown *const *resources,
417 [out] DXGI_RESIDENCY *residency,
418 [in] UINT resource_count
420 HRESULT SetGPUThreadPriority(
421 [in] INT priority
423 HRESULT GetGPUThreadPriority(
424 [out] INT *priority
428 typedef enum DXGI_ADAPTER_FLAG {
429 DXGI_ADAPTER_FLAG_NONE = 0,
430 DXGI_ADAPTER_FLAG_REMOTE = 1,
431 DXGI_ADAPTER_FLAG_FORCE_DWORD = 0xFFFFFFFF
432 } DXGI_ADAPTER_FLAG;
434 typedef struct DXGI_ADAPTER_DESC1 {
435 WCHAR Description[128];
436 UINT VendorId;
437 UINT DeviceId;
438 UINT SubSysId;
439 UINT Revision;
440 SIZE_T DedicatedVideoMemory;
441 SIZE_T DedicatedSystemMemory;
442 SIZE_T SharedSystemMemory;
443 LUID AdapterLuid;
444 UINT Flags;
445 } DXGI_ADAPTER_DESC1;
448 object,
449 uuid(29038f61-3839-4626-91fd-086879011a05),
450 local,
451 pointer_default(unique)
453 interface IDXGIAdapter1 : IDXGIAdapter
455 HRESULT GetDesc1([out] DXGI_ADAPTER_DESC1 *pDesc);
459 object,
460 uuid(77db970f-6276-48ba-ba28-070143b4392c),
461 local,
462 pointer_default(unique)
464 interface IDXGIDevice1 : IDXGIDevice
466 HRESULT SetMaximumFrameLatency([in] UINT MaxLatency);
467 HRESULT GetMaximumFrameLatency([out] UINT *pMaxLatency);
471 object,
472 uuid(770aae78-f26f-4dba-a829-253c83d1b387),
473 local,
474 pointer_default(unique)
476 interface IDXGIFactory1 : IDXGIFactory
478 HRESULT EnumAdapters1([in] UINT Adapter, [out] IDXGIAdapter1 **ppAdapter);
479 BOOL IsCurrent();