1/**************************************************************************
2 *
3 * Copyright 2010 Luca Barbieri
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining
6 * a copy of this software and associated documentation files (the
7 * "Software"), to deal in the Software without restriction, including
8 * without limitation the rights to use, copy, modify, merge, publish,
9 * distribute, sublicense, and/or sell copies of the Software, and to
10 * permit persons to whom the Software is furnished to do so, subject to
11 * the following conditions:
12 *
13 * The above copyright notice and this permission notice (including the
14 * next paragraph) shall be included in all copies or substantial
15 * portions of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
20 * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
21 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
22 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
23 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 *
25 **************************************************************************/
26
27import "oaidl.idl";
28import "ocidl.idl";
29import "d3d10.idl";
30import "d3dcommon.idl";
31
32const unsigned int D3D10_1_SDK_VERSION = 0x20;
33
34cpp_quote("#ifndef _D3D10_1_CONSTANTS")
35cpp_quote("#define _D3D10_1_CONSTANTS")
36const unsigned int D3D10_1_DEFAULT_SAMPLE_MASK = 0xffffffff;
37const float D3D10_1_FLOAT16_FUSED_TOLERANCE_IN_ULP = 0.6;
38const float D3D10_1_FLOAT32_TO_INTEGER_TOLERANCE_IN_ULP = 0.6;
39const unsigned int D3D10_1_GS_INPUT_REGISTER_COUNT = 32;
40const unsigned int D3D10_1_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT = 32;
41const unsigned int D3D10_1_IA_VERTEX_INPUT_STRUCTURE_ELEMENTS_COMPONENTS = 128;
42const unsigned int D3D10_1_IA_VERTEX_INPUT_STRUCTURE_ELEMENT_COUNT = 32;
43const unsigned int D3D10_1_PS_OUTPUT_MASK_REGISTER_COMPONENTS = 1;
44const unsigned int D3D10_1_PS_OUTPUT_MASK_REGISTER_COMPONENT_BIT_COUNT = 32;
45const unsigned int D3D10_1_PS_OUTPUT_MASK_REGISTER_COUNT = 1;
46const unsigned int D3D10_1_SHADER_MAJOR_VERSION = 4;
47const unsigned int D3D10_1_SHADER_MINOR_VERSION = 1;
48const unsigned int D3D10_1_SO_BUFFER_MAX_STRIDE_IN_BYTES = 2048;
49const unsigned int D3D10_1_SO_BUFFER_MAX_WRITE_WINDOW_IN_BYTES = 256;
50const unsigned int D3D10_1_SO_BUFFER_SLOT_COUNT = 4;
51const unsigned int D3D10_1_SO_MULTIPLE_BUFFER_ELEMENTS_PER_BUFFER = 1;
52const unsigned int D3D10_1_SO_SINGLE_BUFFER_COMPONENT_LIMIT = 64;
53const unsigned int D3D10_1_STANDARD_VERTEX_ELEMENT_COUNT = 32;
54const unsigned int D3D10_1_SUBPIXEL_FRACTIONAL_BIT_COUNT = 8;
55const unsigned int D3D10_1_VS_INPUT_REGISTER_COUNT = 32;
56const unsigned int D3D10_1_VS_OUTPUT_REGISTER_COUNT = 32;
57cpp_quote("#endif")
58
59typedef enum D3D10_FEATURE_LEVEL1
60{
61	D3D10_FEATURE_LEVEL_10_0 = 0xa000,
62	D3D10_FEATURE_LEVEL_10_1 = 0xa100,
63	D3D10_FEATURE_LEVEL_9_1 = 0x9100,
64	D3D10_FEATURE_LEVEL_9_2 = 0x9200,
65	D3D10_FEATURE_LEVEL_9_3 = 0x9300
66} D3D10_FEATURE_LEVEL1;
67
68typedef struct D3D10_RENDER_TARGET_BLEND_DESC1
69{
70	BOOL BlendEnable;
71	D3D10_BLEND SrcBlend;
72	D3D10_BLEND DestBlend;
73	D3D10_BLEND_OP BlendOp;
74	D3D10_BLEND SrcBlendAlpha;
75	D3D10_BLEND DestBlendAlpha;
76	D3D10_BLEND_OP BlendOpAlpha;
77	UINT8 RenderTargetWriteMask;
78} D3D10_RENDER_TARGET_BLEND_DESC1;
79
80typedef struct D3D10_BLEND_DESC1
81{
82	BOOL AlphaToCoverageEnable;
83	BOOL IndependentBlendEnable;
84	D3D10_RENDER_TARGET_BLEND_DESC1 RenderTarget[8];
85} D3D10_BLEND_DESC1;
86
87typedef struct D3D10_TEXCUBE_ARRAY_SRV1
88{
89	UINT MostDetailedMip;
90	UINT MipLevels;
91	UINT First2DArrayFace;
92	UINT NumCubes;
93} D3D10_TEXCUBE_ARRAY_SRV1;
94
95typedef D3D_SRV_DIMENSION D3D10_SRV_DIMENSION1;
96
97typedef struct D3D10_SHADER_RESOURCE_VIEW_DESC1
98{
99	DXGI_FORMAT Format;
100	D3D10_SRV_DIMENSION1 ViewDimension;
101	union
102	{
103		D3D10_BUFFER_SRV Buffer;
104		D3D10_TEX1D_SRV Texture1D;
105		D3D10_TEX1D_ARRAY_SRV Texture1DArray;
106		D3D10_TEX2D_SRV Texture2D;
107		D3D10_TEX2D_ARRAY_SRV Texture2DArray;
108		D3D10_TEX2DMS_SRV Texture2DMS;
109		D3D10_TEX2DMS_ARRAY_SRV Texture2DMSArray;
110		D3D10_TEX3D_SRV Texture3D;
111		D3D10_TEXCUBE_SRV TextureCube;
112		D3D10_TEXCUBE_ARRAY_SRV1 TextureCubeArray;
113	} ;
114} D3D10_SHADER_RESOURCE_VIEW_DESC1;
115
116typedef enum D3D10_STANDARD_MULTISAMPLE_QUALITY_LEVELS
117{
118	D3D10_STANDARD_MULTISAMPLE_PATTERN = 0xffffffff,
119	D3D10_CENTER_MULTISAMPLE_PATTERN = 0xfffffffe
120} D3D10_STANDARD_MULTISAMPLE_QUALITY_LEVELS;
121
122[object, local, uuid("EDAD8D99-8A35-4d6d-8566-2EA276CDE161")]
123interface ID3D10BlendState1 : ID3D10BlendState
124{
125	void GetDesc1(
126		[out] D3D10_BLEND_DESC1 *a
127	);
128};
129
130[object, local, uuid("9B7E4C87-342C-4106-A19F-4F2704F689F0")]
131interface ID3D10ShaderResourceView1 : ID3D10ShaderResourceView
132{
133	void GetDesc1(
134		[out] D3D10_SHADER_RESOURCE_VIEW_DESC1 *a
135	);
136};
137
138[object, local, uuid("9B7E4C8F-342C-4106-A19F-4F2704F689F0")]
139interface ID3D10Device1 : ID3D10Device
140{
141	HRESULT CreateShaderResourceView1(
142		[in] ID3D10Resource *a,
143		[in] const D3D10_SHADER_RESOURCE_VIEW_DESC1 *b,
144		[out,optional] ID3D10ShaderResourceView1 **c
145	);
146
147	HRESULT CreateBlendState1(
148		[in] const D3D10_BLEND_DESC1 *a,
149		[out, optional] ID3D10BlendState1 **b
150	);
151
152	D3D10_FEATURE_LEVEL1 GetFeatureLevel();
153};
154
155//cpp_quote("#include \"d3d10_1shader.h\"")
156
157typedef enum D3D10_DRIVER_TYPE D3D10_DRIVER_TYPE;
158
159HRESULT D3D10CreateDevice1(
160	[in,optional] IDXGIAdapter* a,
161	[in] D3D10_DRIVER_TYPE b,
162	[in] HMODULE c,
163	[in] UINT d,
164	[in] D3D10_FEATURE_LEVEL1 e,
165	[in] UINT f,
166	[out,optional] ID3D10Device1** g
167);
168
169typedef HRESULT (* PFN_D3D10_CREATE_DEVICE_AND_SWAP_CHAIN1)(
170	[in,optional] IDXGIAdapter*,
171	D3D10_DRIVER_TYPE,
172	HMODULE,
173	UINT,
174	D3D10_FEATURE_LEVEL1,
175	UINT,
176	[in, optional] DXGI_SWAP_CHAIN_DESC*,
177	[out,optional] IDXGISwapChain**,
178	[out,optional] ID3D10Device1**
179);
180
181HRESULT D3D10CreateDeviceAndSwapChain1(
182	[in,optional] IDXGIAdapter* a,
183	[in] D3D10_DRIVER_TYPE b,
184	[in] HMODULE c,
185	[in] UINT d,
186	[in] D3D10_FEATURE_LEVEL1 e,
187	[in] UINT f,
188	[in,optional] DXGI_SWAP_CHAIN_DESC* g,
189	[out,optional] IDXGISwapChain** h,
190	[out,optional] ID3D10Device1** i
191);
192