blob: dd1043b096831a8e289c071ff29b2a45829b6b01 [file] [log] [blame]
José Fonsecaaf7d2312011-07-07 10:16:57 +01001##########################################################################
2#
3# Copyright 2011 Jose Fonseca
4# All Rights Reserved.
5#
6# Permission is hereby granted, free of charge, to any person obtaining a copy
7# of this software and associated documentation files (the "Software"), to deal
8# in the Software without restriction, including without limitation the rights
9# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10# copies of the Software, and to permit persons to whom the Software is
11# furnished to do so, subject to the following conditions:
12#
13# The above copyright notice and this permission notice shall be included in
14# all copies or substantial portions of the Software.
15#
16# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22# THE SOFTWARE.
23#
24##########################################################################/
25
José Fonseca5b6fb752012-04-14 14:56:45 +010026
Piotr Podsiadły0b8b0192019-01-03 20:39:55 +010027from .dxgi import *
28from .d3d10sdklayers import *
José Fonseca5b6fb752012-04-14 14:56:45 +010029
José Fonsecaaf7d2312011-07-07 10:16:57 +010030
José Fonseca73841ad2012-04-16 20:47:56 +010031HRESULT = MAKE_HRESULT([
José Fonseca1e1676f2012-04-05 11:18:27 +010032 "D3D10_ERROR_FILE_NOT_FOUND",
33 "D3D10_ERROR_TOO_MANY_UNIQUE_STATE_OBJECTS",
34 "D3DERR_INVALIDCALL",
35 "D3DERR_WASSTILLDRAWING",
José Fonseca1e1676f2012-04-05 11:18:27 +010036])
37
Jose Fonseca5f5181d2015-07-17 12:06:23 +010038D3D10_PRIMITIVE_TOPOLOGY = Enum("D3D10_PRIMITIVE_TOPOLOGY", [
39 "D3D10_PRIMITIVE_TOPOLOGY_UNDEFINED",
40 "D3D10_PRIMITIVE_TOPOLOGY_POINTLIST",
41 "D3D10_PRIMITIVE_TOPOLOGY_LINELIST",
42 "D3D10_PRIMITIVE_TOPOLOGY_LINESTRIP",
43 "D3D10_PRIMITIVE_TOPOLOGY_TRIANGLELIST",
44 "D3D10_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP",
45 "D3D10_PRIMITIVE_TOPOLOGY_LINELIST_ADJ",
46 "D3D10_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ",
47 "D3D10_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ",
48 "D3D10_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ",
49])
50
José Fonsecaaf7d2312011-07-07 10:16:57 +010051D3D10_BLEND = Enum("D3D10_BLEND", [
52 "D3D10_BLEND_ZERO",
53 "D3D10_BLEND_ONE",
54 "D3D10_BLEND_SRC_COLOR",
55 "D3D10_BLEND_INV_SRC_COLOR",
56 "D3D10_BLEND_SRC_ALPHA",
57 "D3D10_BLEND_INV_SRC_ALPHA",
58 "D3D10_BLEND_DEST_ALPHA",
59 "D3D10_BLEND_INV_DEST_ALPHA",
60 "D3D10_BLEND_DEST_COLOR",
61 "D3D10_BLEND_INV_DEST_COLOR",
62 "D3D10_BLEND_SRC_ALPHA_SAT",
63 "D3D10_BLEND_BLEND_FACTOR",
64 "D3D10_BLEND_INV_BLEND_FACTOR",
65 "D3D10_BLEND_SRC1_COLOR",
66 "D3D10_BLEND_INV_SRC1_COLOR",
67 "D3D10_BLEND_SRC1_ALPHA",
68 "D3D10_BLEND_INV_SRC1_ALPHA",
69])
70
71D3D10_BLEND_OP = Enum("D3D10_BLEND_OP", [
72 "D3D10_BLEND_OP_ADD",
73 "D3D10_BLEND_OP_SUBTRACT",
74 "D3D10_BLEND_OP_REV_SUBTRACT",
75 "D3D10_BLEND_OP_MIN",
76 "D3D10_BLEND_OP_MAX",
77])
78
79D3D10_BLEND_DESC = Struct("D3D10_BLEND_DESC", [
80 (BOOL, "AlphaToCoverageEnable"),
José Fonseca44756652011-10-15 10:26:30 +010081 (Array(BOOL, 8), "BlendEnable"),
José Fonsecaaf7d2312011-07-07 10:16:57 +010082 (D3D10_BLEND, "SrcBlend"),
83 (D3D10_BLEND, "DestBlend"),
84 (D3D10_BLEND_OP, "BlendOp"),
85 (D3D10_BLEND, "SrcBlendAlpha"),
86 (D3D10_BLEND, "DestBlendAlpha"),
87 (D3D10_BLEND_OP, "BlendOpAlpha"),
José Fonseca44756652011-10-15 10:26:30 +010088 (Array(UINT8, 8), "RenderTargetWriteMask"),
José Fonsecaaf7d2312011-07-07 10:16:57 +010089])
90
91D3D10_DEPTH_WRITE_MASK = Enum("D3D10_DEPTH_WRITE_MASK", [
92 "D3D10_DEPTH_WRITE_MASK_ZERO",
93 "D3D10_DEPTH_WRITE_MASK_ALL",
94])
95
96D3D10_COMPARISON_FUNC = Enum("D3D10_COMPARISON_FUNC", [
97 "D3D10_COMPARISON_NEVER",
98 "D3D10_COMPARISON_LESS",
99 "D3D10_COMPARISON_EQUAL",
100 "D3D10_COMPARISON_LESS_EQUAL",
101 "D3D10_COMPARISON_GREATER",
102 "D3D10_COMPARISON_NOT_EQUAL",
103 "D3D10_COMPARISON_GREATER_EQUAL",
104 "D3D10_COMPARISON_ALWAYS",
105])
106
107D3D10_STENCIL_OP = Enum("D3D10_STENCIL_OP", [
108 "D3D10_STENCIL_OP_KEEP",
109 "D3D10_STENCIL_OP_ZERO",
110 "D3D10_STENCIL_OP_REPLACE",
111 "D3D10_STENCIL_OP_INCR_SAT",
112 "D3D10_STENCIL_OP_DECR_SAT",
113 "D3D10_STENCIL_OP_INVERT",
114 "D3D10_STENCIL_OP_INCR",
115 "D3D10_STENCIL_OP_DECR",
116])
117
118D3D10_DEPTH_STENCILOP_DESC = Struct("D3D10_DEPTH_STENCILOP_DESC", [
119 (D3D10_STENCIL_OP, "StencilFailOp"),
120 (D3D10_STENCIL_OP, "StencilDepthFailOp"),
121 (D3D10_STENCIL_OP, "StencilPassOp"),
122 (D3D10_COMPARISON_FUNC, "StencilFunc"),
123])
124
125D3D10_DEPTH_STENCIL_DESC = Struct("D3D10_DEPTH_STENCIL_DESC", [
126 (BOOL, "DepthEnable"),
127 (D3D10_DEPTH_WRITE_MASK, "DepthWriteMask"),
128 (D3D10_COMPARISON_FUNC, "DepthFunc"),
129 (BOOL, "StencilEnable"),
130 (UINT8, "StencilReadMask"),
131 (UINT8, "StencilWriteMask"),
132 (D3D10_DEPTH_STENCILOP_DESC, "FrontFace"),
133 (D3D10_DEPTH_STENCILOP_DESC, "BackFace"),
134])
135
136D3D10_FILL_MODE = Enum("D3D10_FILL_MODE", [
137 "D3D10_FILL_WIREFRAME",
138 "D3D10_FILL_SOLID",
139])
140
141D3D10_CULL_MODE = Enum("D3D10_CULL_MODE", [
142 "D3D10_CULL_NONE",
143 "D3D10_CULL_FRONT",
144 "D3D10_CULL_BACK",
145])
146
147D3D10_RASTERIZER_DESC = Struct("D3D10_RASTERIZER_DESC", [
148 (D3D10_FILL_MODE, "FillMode"),
149 (D3D10_CULL_MODE, "CullMode"),
150 (BOOL, "FrontCounterClockwise"),
151 (INT, "DepthBias"),
152 (FLOAT, "DepthBiasClamp"),
153 (FLOAT, "SlopeScaledDepthBias"),
154 (BOOL, "DepthClipEnable"),
155 (BOOL, "ScissorEnable"),
156 (BOOL, "MultisampleEnable"),
157 (BOOL, "AntialiasedLineEnable"),
158])
159
160D3D10_FILTER = Enum("D3D10_FILTER", [
161 "D3D10_FILTER_MIN_MAG_MIP_POINT",
162 "D3D10_FILTER_MIN_MAG_POINT_MIP_LINEAR",
163 "D3D10_FILTER_MIN_POINT_MAG_LINEAR_MIP_POINT",
164 "D3D10_FILTER_MIN_POINT_MAG_MIP_LINEAR",
165 "D3D10_FILTER_MIN_LINEAR_MAG_MIP_POINT",
166 "D3D10_FILTER_MIN_LINEAR_MAG_POINT_MIP_LINEAR",
167 "D3D10_FILTER_MIN_MAG_LINEAR_MIP_POINT",
168 "D3D10_FILTER_MIN_MAG_MIP_LINEAR",
169 "D3D10_FILTER_ANISOTROPIC",
170 "D3D10_FILTER_COMPARISON_MIN_MAG_MIP_POINT",
171 "D3D10_FILTER_COMPARISON_MIN_MAG_POINT_MIP_LINEAR",
172 "D3D10_FILTER_COMPARISON_MIN_POINT_MAG_LINEAR_MIP_POINT",
173 "D3D10_FILTER_COMPARISON_MIN_POINT_MAG_MIP_LINEAR",
174 "D3D10_FILTER_COMPARISON_MIN_LINEAR_MAG_MIP_POINT",
175 "D3D10_FILTER_COMPARISON_MIN_LINEAR_MAG_POINT_MIP_LINEAR",
176 "D3D10_FILTER_COMPARISON_MIN_MAG_LINEAR_MIP_POINT",
177 "D3D10_FILTER_COMPARISON_MIN_MAG_MIP_LINEAR",
178 "D3D10_FILTER_COMPARISON_ANISOTROPIC",
179 "D3D10_FILTER_TEXT_1BIT",
180])
181
182D3D10_TEXTURE_ADDRESS_MODE = Enum("D3D10_TEXTURE_ADDRESS_MODE", [
183 "D3D10_TEXTURE_ADDRESS_WRAP",
184 "D3D10_TEXTURE_ADDRESS_MIRROR",
185 "D3D10_TEXTURE_ADDRESS_CLAMP",
186 "D3D10_TEXTURE_ADDRESS_BORDER",
187 "D3D10_TEXTURE_ADDRESS_MIRROR_ONCE",
188])
189
190D3D10_SAMPLER_DESC = Struct("D3D10_SAMPLER_DESC", [
191 (D3D10_FILTER, "Filter"),
192 (D3D10_TEXTURE_ADDRESS_MODE, "AddressU"),
193 (D3D10_TEXTURE_ADDRESS_MODE, "AddressV"),
194 (D3D10_TEXTURE_ADDRESS_MODE, "AddressW"),
195 (FLOAT, "MipLODBias"),
196 (UINT, "MaxAnisotropy"),
197 (D3D10_COMPARISON_FUNC, "ComparisonFunc"),
José Fonseca44756652011-10-15 10:26:30 +0100198 (Array(FLOAT, 4), "BorderColor"),
José Fonsecaaf7d2312011-07-07 10:16:57 +0100199 (FLOAT, "MinLOD"),
200 (FLOAT, "MaxLOD"),
201])
202
José Fonsecaee590be2012-04-16 13:25:06 +0100203D3D10_FORMAT_SUPPORT = Flags(UINT, [
204 "D3D10_FORMAT_SUPPORT_BUFFER",
205 "D3D10_FORMAT_SUPPORT_IA_VERTEX_BUFFER",
206 "D3D10_FORMAT_SUPPORT_IA_INDEX_BUFFER",
207 "D3D10_FORMAT_SUPPORT_SO_BUFFER",
208 "D3D10_FORMAT_SUPPORT_TEXTURE1D",
209 "D3D10_FORMAT_SUPPORT_TEXTURE2D",
210 "D3D10_FORMAT_SUPPORT_TEXTURE3D",
211 "D3D10_FORMAT_SUPPORT_TEXTURECUBE",
212 "D3D10_FORMAT_SUPPORT_SHADER_LOAD",
213 "D3D10_FORMAT_SUPPORT_SHADER_SAMPLE",
214 "D3D10_FORMAT_SUPPORT_SHADER_SAMPLE_COMPARISON",
215 "D3D10_FORMAT_SUPPORT_SHADER_SAMPLE_MONO_TEXT",
216 "D3D10_FORMAT_SUPPORT_MIP",
217 "D3D10_FORMAT_SUPPORT_MIP_AUTOGEN",
218 "D3D10_FORMAT_SUPPORT_RENDER_TARGET",
219 "D3D10_FORMAT_SUPPORT_BLENDABLE",
220 "D3D10_FORMAT_SUPPORT_DEPTH_STENCIL",
221 "D3D10_FORMAT_SUPPORT_CPU_LOCKABLE",
222 "D3D10_FORMAT_SUPPORT_MULTISAMPLE_RESOLVE",
223 "D3D10_FORMAT_SUPPORT_DISPLAY",
224 "D3D10_FORMAT_SUPPORT_CAST_WITHIN_BIT_LAYOUT",
225 "D3D10_FORMAT_SUPPORT_MULTISAMPLE_RENDERTARGET",
226 "D3D10_FORMAT_SUPPORT_MULTISAMPLE_LOAD",
227 "D3D10_FORMAT_SUPPORT_SHADER_GATHER",
José Fonseca5b9ac332012-11-20 15:23:14 +0000228 "D3D10_FORMAT_SUPPORT_BACK_BUFFER_CAST",
José Fonsecaee590be2012-04-16 13:25:06 +0100229])
230
José Fonsecaaf7d2312011-07-07 10:16:57 +0100231D3D10_COUNTER = Enum("D3D10_COUNTER", [
232 "D3D10_COUNTER_GPU_IDLE",
233 "D3D10_COUNTER_VERTEX_PROCESSING",
234 "D3D10_COUNTER_GEOMETRY_PROCESSING",
235 "D3D10_COUNTER_PIXEL_PROCESSING",
236 "D3D10_COUNTER_OTHER_GPU_PROCESSING",
237 "D3D10_COUNTER_HOST_ADAPTER_BANDWIDTH_UTILIZATION",
238 "D3D10_COUNTER_LOCAL_VIDMEM_BANDWIDTH_UTILIZATION",
239 "D3D10_COUNTER_VERTEX_THROUGHPUT_UTILIZATION",
240 "D3D10_COUNTER_TRIANGLE_SETUP_THROUGHPUT_UTILIZATION",
241 "D3D10_COUNTER_FILLRATE_THROUGHPUT_UTILIZATION",
242 "D3D10_COUNTER_VS_MEMORY_LIMITED",
243 "D3D10_COUNTER_VS_COMPUTATION_LIMITED",
244 "D3D10_COUNTER_GS_MEMORY_LIMITED",
245 "D3D10_COUNTER_GS_COMPUTATION_LIMITED",
246 "D3D10_COUNTER_PS_MEMORY_LIMITED",
247 "D3D10_COUNTER_PS_COMPUTATION_LIMITED",
248 "D3D10_COUNTER_POST_TRANSFORM_CACHE_HIT_RATE",
249 "D3D10_COUNTER_TEXTURE_CACHE_HIT_RATE",
250 "D3D10_COUNTER_DEVICE_DEPENDENT_0",
251])
252
253D3D10_COUNTER_DESC = Struct("D3D10_COUNTER_DESC", [
254 (D3D10_COUNTER, "Counter"),
255 (UINT, "MiscFlags"),
256])
257
258D3D10_COUNTER_TYPE = Enum("D3D10_COUNTER_TYPE", [
259 "D3D10_COUNTER_TYPE_FLOAT32",
260 "D3D10_COUNTER_TYPE_UINT16",
261 "D3D10_COUNTER_TYPE_UINT32",
262 "D3D10_COUNTER_TYPE_UINT64",
263])
264
265D3D10_COUNTER_INFO = Struct("D3D10_COUNTER_INFO", [
266 (D3D10_COUNTER, "LastDeviceDependentCounter"),
267 (UINT, "NumSimultaneousCounters"),
268 (UINT8, "NumDetectableParallelUnits"),
269])
270
271D3D10_RESOURCE_DIMENSION = Enum("D3D10_RESOURCE_DIMENSION", [
272 "D3D10_RESOURCE_DIMENSION_UNKNOWN",
273 "D3D10_RESOURCE_DIMENSION_BUFFER",
274 "D3D10_RESOURCE_DIMENSION_TEXTURE1D",
275 "D3D10_RESOURCE_DIMENSION_TEXTURE2D",
276 "D3D10_RESOURCE_DIMENSION_TEXTURE3D",
277])
278
279D3D10_USAGE = Enum("D3D10_USAGE", [
280 "D3D10_USAGE_DEFAULT",
281 "D3D10_USAGE_IMMUTABLE",
282 "D3D10_USAGE_DYNAMIC",
283 "D3D10_USAGE_STAGING",
284])
285
José Fonseca511254d2012-04-11 12:04:00 +0100286D3D10_BIND_FLAG = Flags(UINT, [
José Fonsecaaf7d2312011-07-07 10:16:57 +0100287 "D3D10_BIND_VERTEX_BUFFER",
288 "D3D10_BIND_INDEX_BUFFER",
289 "D3D10_BIND_CONSTANT_BUFFER",
290 "D3D10_BIND_SHADER_RESOURCE",
291 "D3D10_BIND_STREAM_OUTPUT",
292 "D3D10_BIND_RENDER_TARGET",
293 "D3D10_BIND_DEPTH_STENCIL",
294])
295
José Fonseca511254d2012-04-11 12:04:00 +0100296D3D10_CPU_ACCESS_FLAG = Flags(UINT, [
297 "D3D10_CPU_ACCESS_WRITE",
298 "D3D10_CPU_ACCESS_READ",
299])
300
301D3D10_RESOURCE_MISC_FLAG = Flags(UINT, [
302 "D3D10_RESOURCE_MISC_GENERATE_MIPS",
303 "D3D10_RESOURCE_MISC_SHARED",
304 "D3D10_RESOURCE_MISC_TEXTURECUBE",
305 "D3D10_RESOURCE_MISC_SHARED_KEYEDMUTEX",
306 "D3D10_RESOURCE_MISC_GDI_COMPATIBLE",
307])
308
José Fonsecaaf7d2312011-07-07 10:16:57 +0100309D3D10_BUFFER_DESC = Struct("D3D10_BUFFER_DESC", [
310 (UINT, "ByteWidth"),
311 (D3D10_USAGE, "Usage"),
José Fonseca511254d2012-04-11 12:04:00 +0100312 (D3D10_BIND_FLAG, "BindFlags"),
313 (D3D10_CPU_ACCESS_FLAG, "CPUAccessFlags"),
314 (D3D10_RESOURCE_MISC_FLAG, "MiscFlags"),
José Fonsecaaf7d2312011-07-07 10:16:57 +0100315])
316
317D3D10_MAP = Enum("D3D10_MAP", [
318 "D3D10_MAP_READ",
319 "D3D10_MAP_WRITE",
320 "D3D10_MAP_READ_WRITE",
321 "D3D10_MAP_WRITE_DISCARD",
322 "D3D10_MAP_WRITE_NO_OVERWRITE",
323])
324
325D3D10_TEXTURE1D_DESC = Struct("D3D10_TEXTURE1D_DESC", [
326 (UINT, "Width"),
327 (UINT, "MipLevels"),
328 (UINT, "ArraySize"),
329 (DXGI_FORMAT, "Format"),
330 (D3D10_USAGE, "Usage"),
José Fonseca511254d2012-04-11 12:04:00 +0100331 (D3D10_BIND_FLAG, "BindFlags"),
332 (D3D10_CPU_ACCESS_FLAG, "CPUAccessFlags"),
333 (D3D10_RESOURCE_MISC_FLAG, "MiscFlags"),
José Fonsecaaf7d2312011-07-07 10:16:57 +0100334])
335
336D3D10_TEXTURE2D_DESC = Struct("D3D10_TEXTURE2D_DESC", [
337 (UINT, "Width"),
338 (UINT, "Height"),
339 (UINT, "MipLevels"),
340 (UINT, "ArraySize"),
341 (DXGI_FORMAT, "Format"),
342 (DXGI_SAMPLE_DESC, "SampleDesc"),
343 (D3D10_USAGE, "Usage"),
José Fonseca511254d2012-04-11 12:04:00 +0100344 (D3D10_BIND_FLAG, "BindFlags"),
345 (D3D10_CPU_ACCESS_FLAG, "CPUAccessFlags"),
346 (D3D10_RESOURCE_MISC_FLAG, "MiscFlags"),
José Fonsecaaf7d2312011-07-07 10:16:57 +0100347])
348
349D3D10_TEXTURE3D_DESC = Struct("D3D10_TEXTURE3D_DESC", [
350 (UINT, "Width"),
351 (UINT, "Height"),
352 (UINT, "Depth"),
353 (UINT, "MipLevels"),
354 (DXGI_FORMAT, "Format"),
355 (D3D10_USAGE, "Usage"),
José Fonseca511254d2012-04-11 12:04:00 +0100356 (D3D10_BIND_FLAG, "BindFlags"),
357 (D3D10_CPU_ACCESS_FLAG, "CPUAccessFlags"),
358 (D3D10_RESOURCE_MISC_FLAG, "MiscFlags"),
José Fonsecaaf7d2312011-07-07 10:16:57 +0100359])
360
361D3D10_DSV_DIMENSION = Enum("D3D10_DSV_DIMENSION", [
362 "D3D10_DSV_DIMENSION_UNKNOWN",
363 "D3D10_DSV_DIMENSION_TEXTURE1D",
364 "D3D10_DSV_DIMENSION_TEXTURE1DARRAY",
365 "D3D10_DSV_DIMENSION_TEXTURE2D",
366 "D3D10_DSV_DIMENSION_TEXTURE2DARRAY",
367 "D3D10_DSV_DIMENSION_TEXTURE2DMS",
368 "D3D10_DSV_DIMENSION_TEXTURE2DMSARRAY",
369])
370
371D3D10_TEX1D_DSV = Struct("D3D10_TEX1D_DSV", [
372 (UINT, "MipSlice"),
373])
374
375D3D10_TEX1D_ARRAY_DSV = Struct("D3D10_TEX1D_ARRAY_DSV", [
376 (UINT, "MipSlice"),
377 (UINT, "FirstArraySlice"),
378 (UINT, "ArraySize"),
379])
380
381D3D10_TEX2D_DSV = Struct("D3D10_TEX2D_DSV", [
382 (UINT, "MipSlice"),
383])
384
385D3D10_TEX2D_ARRAY_DSV = Struct("D3D10_TEX2D_ARRAY_DSV", [
386 (UINT, "MipSlice"),
387 (UINT, "FirstArraySlice"),
388 (UINT, "ArraySize"),
389])
390
391D3D10_TEX2DMS_DSV = Struct("D3D10_TEX2DMS_DSV", [
392 (UINT, "UnusedField_NothingToDefine"),
393])
394
395D3D10_TEX2DMS_ARRAY_DSV = Struct("D3D10_TEX2DMS_ARRAY_DSV", [
396 (UINT, "FirstArraySlice"),
397 (UINT, "ArraySize"),
398])
399
400D3D10_DEPTH_STENCIL_VIEW_DESC = Struct("D3D10_DEPTH_STENCIL_VIEW_DESC", [
401 (DXGI_FORMAT, "Format"),
402 (D3D10_DSV_DIMENSION, "ViewDimension"),
José Fonsecadbf714b2012-11-20 17:03:43 +0000403 (Union("{self}.ViewDimension", [
404 ("D3D10_DSV_DIMENSION_TEXTURE1D", D3D10_TEX1D_DSV, "Texture1D"),
405 ("D3D10_DSV_DIMENSION_TEXTURE1DARRAY", D3D10_TEX1D_ARRAY_DSV, "Texture1DArray"),
406 ("D3D10_DSV_DIMENSION_TEXTURE2D", D3D10_TEX2D_DSV, "Texture2D"),
407 ("D3D10_DSV_DIMENSION_TEXTURE2DARRAY", D3D10_TEX2D_ARRAY_DSV, "Texture2DArray"),
408 ("D3D10_DSV_DIMENSION_TEXTURE2DMS", D3D10_TEX2DMS_DSV, "Texture2DMS"),
409 ("D3D10_DSV_DIMENSION_TEXTURE2DMSARRAY", D3D10_TEX2DMS_ARRAY_DSV, "Texture2DMSArray"),
410 ]), None),
José Fonsecaaf7d2312011-07-07 10:16:57 +0100411])
412
413D3D10_RTV_DIMENSION = Enum("D3D10_RTV_DIMENSION", [
414 "D3D10_RTV_DIMENSION_UNKNOWN",
415 "D3D10_RTV_DIMENSION_BUFFER",
416 "D3D10_RTV_DIMENSION_TEXTURE1D",
417 "D3D10_RTV_DIMENSION_TEXTURE1DARRAY",
418 "D3D10_RTV_DIMENSION_TEXTURE2D",
419 "D3D10_RTV_DIMENSION_TEXTURE2DARRAY",
420 "D3D10_RTV_DIMENSION_TEXTURE2DMS",
421 "D3D10_RTV_DIMENSION_TEXTURE2DMSARRAY",
422 "D3D10_RTV_DIMENSION_TEXTURE3D",
423])
424
425D3D10_BUFFER_RTV = Struct("D3D10_BUFFER_RTV", [
José Fonseca5f4b6e32012-11-20 10:47:10 +0000426 (UINT, "FirstElement"),
427 (UINT, "NumElements"),
José Fonsecaaf7d2312011-07-07 10:16:57 +0100428])
429
430D3D10_TEX1D_RTV = Struct("D3D10_TEX1D_RTV", [
431 (UINT, "MipSlice"),
432])
433
434D3D10_TEX1D_ARRAY_RTV = Struct("D3D10_TEX1D_ARRAY_RTV", [
435 (UINT, "MipSlice"),
436 (UINT, "FirstArraySlice"),
437 (UINT, "ArraySize"),
438])
439
440D3D10_TEX2D_RTV = Struct("D3D10_TEX2D_RTV", [
441 (UINT, "MipSlice"),
442])
443
444D3D10_TEX2D_ARRAY_RTV = Struct("D3D10_TEX2D_ARRAY_RTV", [
445 (UINT, "MipSlice"),
446 (UINT, "FirstArraySlice"),
447 (UINT, "ArraySize"),
448])
449
450D3D10_TEX2DMS_RTV = Struct("D3D10_TEX2DMS_RTV", [
451 (UINT, "UnusedField_NothingToDefine"),
452])
453
454D3D10_TEX2DMS_ARRAY_RTV = Struct("D3D10_TEX2DMS_ARRAY_RTV", [
455 (UINT, "FirstArraySlice"),
456 (UINT, "ArraySize"),
457])
458
459D3D10_TEX3D_RTV = Struct("D3D10_TEX3D_RTV", [
460 (UINT, "MipSlice"),
461 (UINT, "FirstWSlice"),
462 (UINT, "WSize"),
463])
464
465D3D10_RENDER_TARGET_VIEW_DESC = Struct("D3D10_RENDER_TARGET_VIEW_DESC", [
466 (DXGI_FORMAT, "Format"),
467 (D3D10_RTV_DIMENSION, "ViewDimension"),
José Fonsecadbf714b2012-11-20 17:03:43 +0000468 (Union("{self}.ViewDimension", [
469 ("D3D10_RTV_DIMENSION_BUFFER", D3D10_BUFFER_RTV, "Buffer"),
470 ("D3D10_RTV_DIMENSION_TEXTURE1D", D3D10_TEX1D_RTV, "Texture1D"),
471 ("D3D10_RTV_DIMENSION_TEXTURE1DARRAY", D3D10_TEX1D_ARRAY_RTV, "Texture1DArray"),
472 ("D3D10_RTV_DIMENSION_TEXTURE2D", D3D10_TEX2D_RTV, "Texture2D"),
473 ("D3D10_RTV_DIMENSION_TEXTURE2DARRAY", D3D10_TEX2D_ARRAY_RTV, "Texture2DArray"),
474 ("D3D10_RTV_DIMENSION_TEXTURE2DMS", D3D10_TEX2DMS_RTV, "Texture2DMS"),
475 ("D3D10_RTV_DIMENSION_TEXTURE2DMSARRAY", D3D10_TEX2DMS_ARRAY_RTV, "Texture2DMSArray"),
476 ("D3D10_RTV_DIMENSION_TEXTURE3D", D3D10_TEX3D_RTV, "Texture3D"),
477 ]), None),
José Fonsecaaf7d2312011-07-07 10:16:57 +0100478])
479
480D3D10_SRV_DIMENSION = Enum("D3D10_SRV_DIMENSION", [
481 "D3D10_SRV_DIMENSION_UNKNOWN",
Jose Fonseca5f5181d2015-07-17 12:06:23 +0100482 "D3D10_SRV_DIMENSION_BUFFER",
483 "D3D10_SRV_DIMENSION_TEXTURE1D",
484 "D3D10_SRV_DIMENSION_TEXTURE1DARRAY",
485 "D3D10_SRV_DIMENSION_TEXTURE2D",
486 "D3D10_SRV_DIMENSION_TEXTURE2DARRAY",
487 "D3D10_SRV_DIMENSION_TEXTURE2DMS",
488 "D3D10_SRV_DIMENSION_TEXTURE2DMSARRAY",
489 "D3D10_SRV_DIMENSION_TEXTURE3D",
490 "D3D10_SRV_DIMENSION_TEXTURECUBE",
José Fonsecaaf7d2312011-07-07 10:16:57 +0100491])
492
493D3D10_BUFFER_SRV = Struct("D3D10_BUFFER_SRV", [
José Fonseca5f4b6e32012-11-20 10:47:10 +0000494 (UINT, "FirstElement"),
495 (UINT, "NumElements"),
José Fonsecaaf7d2312011-07-07 10:16:57 +0100496])
497
498D3D10_TEX1D_SRV = Struct("D3D10_TEX1D_SRV", [
499 (UINT, "MostDetailedMip"),
500 (UINT, "MipLevels"),
501])
502
503D3D10_TEX1D_ARRAY_SRV = Struct("D3D10_TEX1D_ARRAY_SRV", [
504 (UINT, "MostDetailedMip"),
505 (UINT, "MipLevels"),
506 (UINT, "FirstArraySlice"),
507 (UINT, "ArraySize"),
508])
509
510D3D10_TEX2D_SRV = Struct("D3D10_TEX2D_SRV", [
511 (UINT, "MostDetailedMip"),
512 (UINT, "MipLevels"),
513])
514
515D3D10_TEX2D_ARRAY_SRV = Struct("D3D10_TEX2D_ARRAY_SRV", [
516 (UINT, "MostDetailedMip"),
517 (UINT, "MipLevels"),
518 (UINT, "FirstArraySlice"),
519 (UINT, "ArraySize"),
520])
521
522D3D10_TEX2DMS_SRV = Struct("D3D10_TEX2DMS_SRV", [
523 (UINT, "UnusedField_NothingToDefine"),
524])
525
526D3D10_TEX2DMS_ARRAY_SRV = Struct("D3D10_TEX2DMS_ARRAY_SRV", [
527 (UINT, "FirstArraySlice"),
528 (UINT, "ArraySize"),
529])
530
531D3D10_TEX3D_SRV = Struct("D3D10_TEX3D_SRV", [
532 (UINT, "MostDetailedMip"),
533 (UINT, "MipLevels"),
534])
535
536D3D10_TEXCUBE_SRV = Struct("D3D10_TEXCUBE_SRV", [
537 (UINT, "MostDetailedMip"),
538 (UINT, "MipLevels"),
539])
540
541D3D10_SHADER_RESOURCE_VIEW_DESC = Struct("D3D10_SHADER_RESOURCE_VIEW_DESC", [
542 (DXGI_FORMAT, "Format"),
543 (D3D10_SRV_DIMENSION, "ViewDimension"),
José Fonsecadbf714b2012-11-20 17:03:43 +0000544 (Union("{self}.ViewDimension", [
545 ("D3D10_SRV_DIMENSION_BUFFER", D3D10_BUFFER_SRV, "Buffer"),
546 ("D3D10_SRV_DIMENSION_TEXTURE1D", D3D10_TEX1D_SRV, "Texture1D"),
547 ("D3D10_SRV_DIMENSION_TEXTURE1DARRAY", D3D10_TEX1D_ARRAY_SRV, "Texture1DArray"),
Jose Fonsecaa92e0c42015-03-14 10:49:23 +0000548 ("D3D10_SRV_DIMENSION_TEXTURE2D", D3D10_TEX2D_SRV, "Texture2D"),
José Fonsecadbf714b2012-11-20 17:03:43 +0000549 ("D3D10_SRV_DIMENSION_TEXTURE2DARRAY", D3D10_TEX2D_ARRAY_SRV, "Texture2DArray"),
550 ("D3D10_SRV_DIMENSION_TEXTURE2DMS", D3D10_TEX2DMS_SRV, "Texture2DMS"),
551 ("D3D10_SRV_DIMENSION_TEXTURE2DMSARRAY", D3D10_TEX2DMS_ARRAY_SRV, "Texture2DMSArray"),
552 ("D3D10_SRV_DIMENSION_TEXTURE3D", D3D10_TEX3D_SRV, "Texture3D"),
553 ("D3D10_SRV_DIMENSION_TEXTURECUBE", D3D10_TEXCUBE_SRV, "TextureCube"),
554 ]), None),
José Fonsecaaf7d2312011-07-07 10:16:57 +0100555])
556
557D3D10_BOX = Struct("D3D10_BOX", [
558 (UINT, "left"),
559 (UINT, "top"),
560 (UINT, "front"),
561 (UINT, "right"),
562 (UINT, "bottom"),
563 (UINT, "back"),
564])
565
566D3D10_SUBRESOURCE_DATA = Struct("D3D10_SUBRESOURCE_DATA", [
José Fonseca30fb4c32012-11-04 11:07:45 +0000567 (Blob(Const(Void), "_calcSubresourceSize(pDesc, {i}, {self}.SysMemPitch, {self}.SysMemSlicePitch)"), "pSysMem"),
José Fonsecaaf7d2312011-07-07 10:16:57 +0100568 (UINT, "SysMemPitch"),
569 (UINT, "SysMemSlicePitch"),
570])
571
572D3D10_SO_DECLARATION_ENTRY = Struct("D3D10_SO_DECLARATION_ENTRY", [
573 (LPCSTR, "SemanticName"),
574 (UINT, "SemanticIndex"),
575 (BYTE, "StartComponent"),
576 (BYTE, "ComponentCount"),
577 (BYTE, "OutputSlot"),
578])
579
580D3D10_INPUT_CLASSIFICATION = Enum("D3D10_INPUT_CLASSIFICATION", [
581 "D3D10_INPUT_PER_VERTEX_DATA",
582 "D3D10_INPUT_PER_INSTANCE_DATA",
583])
584
585D3D10_INPUT_ELEMENT_DESC = Struct("D3D10_INPUT_ELEMENT_DESC", [
586 (LPCSTR, "SemanticName"),
587 (UINT, "SemanticIndex"),
588 (DXGI_FORMAT, "Format"),
589 (UINT, "InputSlot"),
590 (UINT, "AlignedByteOffset"),
591 (D3D10_INPUT_CLASSIFICATION, "InputSlotClass"),
592 (UINT, "InstanceDataStepRate"),
593])
594
595D3D10_QUERY = Enum("D3D10_QUERY", [
596 "D3D10_QUERY_EVENT",
597 "D3D10_QUERY_OCCLUSION",
598 "D3D10_QUERY_TIMESTAMP",
599 "D3D10_QUERY_TIMESTAMP_DISJOINT",
600 "D3D10_QUERY_PIPELINE_STATISTICS",
601 "D3D10_QUERY_OCCLUSION_PREDICATE",
602 "D3D10_QUERY_SO_STATISTICS",
603 "D3D10_QUERY_SO_OVERFLOW_PREDICATE",
604])
605
José Fonseca511254d2012-04-11 12:04:00 +0100606D3D10_QUERY_MISC_FLAG = Flags(UINT, [
607 "D3D10_QUERY_MISC_PREDICATEHINT",
608])
609
José Fonsecaaf7d2312011-07-07 10:16:57 +0100610D3D10_QUERY_DESC = Struct("D3D10_QUERY_DESC", [
611 (D3D10_QUERY, "Query"),
José Fonseca511254d2012-04-11 12:04:00 +0100612 (D3D10_QUERY_MISC_FLAG, "MiscFlags"),
José Fonsecaaf7d2312011-07-07 10:16:57 +0100613])
614
José Fonsecaaf7d2312011-07-07 10:16:57 +0100615D3D10_RECT = Alias("D3D10_RECT", RECT)
616D3D10_VIEWPORT = Struct("D3D10_VIEWPORT", [
617 (INT, "TopLeftX"),
618 (INT, "TopLeftY"),
619 (UINT, "Width"),
620 (UINT, "Height"),
621 (FLOAT, "MinDepth"),
622 (FLOAT, "MaxDepth"),
623])
624
625D3D10_MAPPED_TEXTURE2D = Struct("D3D10_MAPPED_TEXTURE2D", [
José Fonsecaaf366b22012-11-07 20:00:46 +0000626 (LinearPointer(Void, "_MappedSize"), "pData"),
José Fonsecaaf7d2312011-07-07 10:16:57 +0100627 (UINT, "RowPitch"),
628])
629
630D3D10_MAPPED_TEXTURE3D = Struct("D3D10_MAPPED_TEXTURE3D", [
José Fonsecaaf366b22012-11-07 20:00:46 +0000631 (LinearPointer(Void, "_MappedSize"), "pData"),
José Fonsecaaf7d2312011-07-07 10:16:57 +0100632 (UINT, "RowPitch"),
633 (UINT, "DepthPitch"),
634])
635
José Fonseca511254d2012-04-11 12:04:00 +0100636D3D10_MAP_FLAG = Flags(UINT, [
José Fonsecaaf7d2312011-07-07 10:16:57 +0100637 "D3D10_MAP_FLAG_DO_NOT_WAIT",
638])
639
José Fonseca511254d2012-04-11 12:04:00 +0100640D3D10_CLEAR_FLAG = Flags(UINT, [
José Fonsecaaf7d2312011-07-07 10:16:57 +0100641 "D3D10_CLEAR_DEPTH",
642 "D3D10_CLEAR_STENCIL",
643])
644
José Fonseca511254d2012-04-11 12:04:00 +0100645D3D10_COLOR_WRITE_ENABLE = Flags(UINT, [
José Fonsecaaf7d2312011-07-07 10:16:57 +0100646 "D3D10_COLOR_WRITE_ENABLE_ALL",
647 "D3D10_COLOR_WRITE_ENABLE_RED",
José Fonsecaaf7d2312011-07-07 10:16:57 +0100648 "D3D10_COLOR_WRITE_ENABLE_GREEN",
José Fonsecaaf7d2312011-07-07 10:16:57 +0100649 "D3D10_COLOR_WRITE_ENABLE_BLUE",
José Fonsecaaf7d2312011-07-07 10:16:57 +0100650 "D3D10_COLOR_WRITE_ENABLE_ALPHA",
José Fonsecaaf7d2312011-07-07 10:16:57 +0100651])
652
653D3D10_TEXTURECUBE_FACE = Enum("D3D10_TEXTURECUBE_FACE", [
654 "D3D10_TEXTURECUBE_FACE_POSITIVE_X",
655 "D3D10_TEXTURECUBE_FACE_NEGATIVE_X",
656 "D3D10_TEXTURECUBE_FACE_POSITIVE_Y",
657 "D3D10_TEXTURECUBE_FACE_NEGATIVE_Y",
658 "D3D10_TEXTURECUBE_FACE_POSITIVE_Z",
659 "D3D10_TEXTURECUBE_FACE_NEGATIVE_Z",
660])
661
José Fonseca511254d2012-04-11 12:04:00 +0100662D3D10_ASYNC_GETDATA_FLAG = Flags(UINT, [
José Fonsecaaf7d2312011-07-07 10:16:57 +0100663 "D3D10_ASYNC_GETDATA_DONOTFLUSH",
664])
665
666D3D10_FILTER_TYPE = Enum("D3D10_FILTER_TYPE", [
667 "D3D10_FILTER_TYPE_POINT",
668 "D3D10_FILTER_TYPE_LINEAR",
669])
670
José Fonsecaaf7d2312011-07-07 10:16:57 +0100671D3D10_QUERY_DATA_TIMESTAMP_DISJOINT = Struct("D3D10_QUERY_DATA_TIMESTAMP_DISJOINT", [
672 (UINT64, "Frequency"),
673 (BOOL, "Disjoint"),
674])
675
676D3D10_QUERY_DATA_PIPELINE_STATISTICS = Struct("D3D10_QUERY_DATA_PIPELINE_STATISTICS", [
677 (UINT64, "IAVertices"),
678 (UINT64, "IAPrimitives"),
679 (UINT64, "VSInvocations"),
680 (UINT64, "GSInvocations"),
681 (UINT64, "GSPrimitives"),
682 (UINT64, "CInvocations"),
683 (UINT64, "CPrimitives"),
684 (UINT64, "PSInvocations"),
685])
686
687D3D10_QUERY_DATA_SO_STATISTICS = Struct("D3D10_QUERY_DATA_SO_STATISTICS", [
688 (UINT64, "NumPrimitivesWritten"),
689 (UINT64, "PrimitivesStorageNeeded"),
690])
691
José Fonseca89daf562014-08-15 16:10:47 +0100692D3D10_QUERY_DATA = Polymorphic("_getQueryType(_this)", [
693 ("D3D10_QUERY_EVENT", Pointer(BOOL)),
694 ("D3D10_QUERY_OCCLUSION", Pointer(UINT64)),
695 ("D3D10_QUERY_TIMESTAMP", Pointer(UINT64)),
696 ("D3D10_QUERY_TIMESTAMP_DISJOINT", Pointer(D3D10_QUERY_DATA_TIMESTAMP_DISJOINT)),
697 ("D3D10_QUERY_PIPELINE_STATISTICS", Pointer(D3D10_QUERY_DATA_PIPELINE_STATISTICS)),
698 ("D3D10_QUERY_OCCLUSION_PREDICATE", Pointer(BOOL)),
699 ("D3D10_QUERY_SO_STATISTICS", Pointer(D3D10_QUERY_DATA_SO_STATISTICS)),
700 ("D3D10_QUERY_SO_OVERFLOW_PREDICATE", Pointer(BOOL)),
701], Blob(Void, "DataSize"), contextLess=False)
702
703# TODO: Handle ID3D10Counter::GetData too.
704D3D10_COUNTER_DATA = Polymorphic("_getCounterType(_this)", [
705 ("D3D10_COUNTER_GPU_IDLE", Pointer(FLOAT32)),
706 ("D3D10_COUNTER_VERTEX_PROCESSING", Pointer(FLOAT32)),
707 ("D3D10_COUNTER_GEOMETRY_PROCESSING", Pointer(FLOAT32)),
708 ("D3D10_COUNTER_PIXEL_PROCESSING", Pointer(FLOAT32)),
709 ("D3D10_COUNTER_OTHER_GPU_PROCESSING", Pointer(FLOAT32)),
710 ("D3D10_COUNTER_HOST_ADAPTER_BANDWIDTH_UTILIZATION", Pointer(FLOAT32)),
711 ("D3D10_COUNTER_LOCAL_VIDMEM_BANDWIDTH_UTILIZATION", Pointer(FLOAT32)),
712 ("D3D10_COUNTER_VERTEX_THROUGHPUT_UTILIZATION", Pointer(FLOAT32)),
713 ("D3D10_COUNTER_TRIANGLE_SETUP_THROUGHPUT_UTILIZATION", Pointer(FLOAT32)),
714 ("D3D10_COUNTER_FILLRATE_THROUGHPUT_UTILIZATION", Pointer(FLOAT32)),
715 ("D3D10_COUNTER_VS_MEMORY_LIMITED", Pointer(FLOAT32)),
716 ("D3D10_COUNTER_VS_COMPUTATION_LIMITED", Pointer(FLOAT32)),
717 ("D3D10_COUNTER_GS_MEMORY_LIMITED", Pointer(FLOAT32)),
718 ("D3D10_COUNTER_GS_COMPUTATION_LIMITED", Pointer(FLOAT32)),
719 ("D3D10_COUNTER_PS_MEMORY_LIMITED", Pointer(FLOAT32)),
720 ("D3D10_COUNTER_PS_COMPUTATION_LIMITED", Pointer(FLOAT32)),
721 ("D3D10_COUNTER_POST_TRANSFORM_CACHE_HIT_RATE", Pointer(FLOAT32)),
722 ("D3D10_COUNTER_TEXTURE_CACHE_HIT_RATE", Pointer(FLOAT32)),
723], Blob(Void, "DataSize"), contextLess=False)
724
José Fonseca1e1676f2012-04-05 11:18:27 +0100725D3D10_CREATE_DEVICE_FLAG = Flags(UINT, [
José Fonsecaaf7d2312011-07-07 10:16:57 +0100726 "D3D10_CREATE_DEVICE_SINGLETHREADED",
727 "D3D10_CREATE_DEVICE_DEBUG",
728 "D3D10_CREATE_DEVICE_SWITCH_TO_REF",
729 "D3D10_CREATE_DEVICE_PREVENT_INTERNAL_THREADING_OPTIMIZATIONS",
730 "D3D10_CREATE_DEVICE_ALLOW_NULL_FROM_MAP",
731 "D3D10_CREATE_DEVICE_BGRA_SUPPORT",
732 "D3D10_CREATE_DEVICE_STRICT_VALIDATION",
José Fonseca5b9ac332012-11-20 15:23:14 +0000733 "D3D10_CREATE_DEVICE_BGRA_SUPPORT",
734 "D3D10_CREATE_DEVICE_PREVENT_ALTERING_LAYER_SETTINGS_FROM_REGISTRY",
735 "D3D10_CREATE_DEVICE_STRICT_VALIDATION",
736 "D3D10_CREATE_DEVICE_DEBUGGABLE",
José Fonsecaaf7d2312011-07-07 10:16:57 +0100737])
738
José Fonseca1e1676f2012-04-05 11:18:27 +0100739D3D10_RAISE_FLAG = Flags(UINT, [
740 "D3D10_RAISE_FLAG_DRIVER_INTERNAL_ERROR",
741])
742
Jose Fonsecaf42d6552019-01-15 14:53:35 +0000743D3D10_SAMPLE_MASK = FakeEnum(UINT, [
744 "D3D10_DEFAULT_SAMPLE_MASK"
745])
746
José Fonsecaaf7d2312011-07-07 10:16:57 +0100747ID3D10DeviceChild = Interface("ID3D10DeviceChild", IUnknown)
748ID3D10Resource = Interface("ID3D10Resource", ID3D10DeviceChild)
749ID3D10Buffer = Interface("ID3D10Buffer", ID3D10Resource)
750ID3D10Texture1D = Interface("ID3D10Texture1D", ID3D10Resource)
751ID3D10Texture2D = Interface("ID3D10Texture2D", ID3D10Resource)
752ID3D10Texture3D = Interface("ID3D10Texture3D", ID3D10Resource)
753ID3D10View = Interface("ID3D10View", ID3D10DeviceChild)
754ID3D10DepthStencilView = Interface("ID3D10DepthStencilView", ID3D10View)
755ID3D10RenderTargetView = Interface("ID3D10RenderTargetView", ID3D10View)
756ID3D10ShaderResourceView = Interface("ID3D10ShaderResourceView", ID3D10View)
757ID3D10BlendState = Interface("ID3D10BlendState", ID3D10DeviceChild)
758ID3D10DepthStencilState = Interface("ID3D10DepthStencilState", ID3D10DeviceChild)
759ID3D10GeometryShader = Interface("ID3D10GeometryShader", ID3D10DeviceChild)
760ID3D10InputLayout = Interface("ID3D10InputLayout", ID3D10DeviceChild)
761ID3D10PixelShader = Interface("ID3D10PixelShader", ID3D10DeviceChild)
762ID3D10RasterizerState = Interface("ID3D10RasterizerState", ID3D10DeviceChild)
763ID3D10SamplerState = Interface("ID3D10SamplerState", ID3D10DeviceChild)
764ID3D10VertexShader = Interface("ID3D10VertexShader", ID3D10DeviceChild)
765ID3D10Asynchronous = Interface("ID3D10Asynchronous", ID3D10DeviceChild)
766ID3D10Counter = Interface("ID3D10Counter", ID3D10Asynchronous)
767ID3D10Query = Interface("ID3D10Query", ID3D10Asynchronous)
768ID3D10Predicate = Interface("ID3D10Predicate", ID3D10Query)
769ID3D10Device = Interface("ID3D10Device", IUnknown)
770ID3D10Multithread = Interface("ID3D10Multithread", IUnknown)
771
772ID3D10DeviceChild.methods += [
José Fonseca43aa19f2012-11-10 09:29:38 +0000773 StdMethod(Void, "GetDevice", [Out(Pointer(ObjPointer(ID3D10Device)), "ppDevice")]),
José Fonseca9eec9342014-10-03 22:24:50 +0100774 StdMethod(HRESULT, "GetPrivateData", [(REFGUID, "guid"), InOut(Pointer(UINT), "pDataSize"), Out(OpaquePointer(Void), "pData")], sideeffects=False),
José Fonseca43aa19f2012-11-10 09:29:38 +0000775 StdMethod(HRESULT, "SetPrivateData", [(REFGUID, "guid"), (UINT, "DataSize"), (OpaqueBlob(Const(Void), "DataSize"), "pData")], sideeffects=False),
776 StdMethod(HRESULT, "SetPrivateDataInterface", [(REFGUID, "guid"), (OpaquePointer(Const(IUnknown)), "pData")], sideeffects=False),
José Fonsecaaf7d2312011-07-07 10:16:57 +0100777]
778
779ID3D10Resource.methods += [
José Fonseca43aa19f2012-11-10 09:29:38 +0000780 StdMethod(Void, "GetType", [Out(Pointer(D3D10_RESOURCE_DIMENSION), "rType")], sideeffects=False),
781 StdMethod(Void, "SetEvictionPriority", [(UINT, "EvictionPriority")]),
782 StdMethod(UINT, "GetEvictionPriority", [], sideeffects=False),
José Fonsecaaf7d2312011-07-07 10:16:57 +0100783]
784
785ID3D10Buffer.methods += [
José Fonseca43aa19f2012-11-10 09:29:38 +0000786 StdMethod(HRESULT, "Map", [(D3D10_MAP, "MapType"), (D3D10_MAP_FLAG, "MapFlags"), Out(Pointer(LinearPointer(Void, "_MappedSize")), "ppData")]),
787 StdMethod(Void, "Unmap", []),
788 StdMethod(Void, "GetDesc", [Out(Pointer(D3D10_BUFFER_DESC), "pDesc")], sideeffects=False),
José Fonsecaaf7d2312011-07-07 10:16:57 +0100789]
790
791ID3D10Texture1D.methods += [
José Fonseca43aa19f2012-11-10 09:29:38 +0000792 StdMethod(HRESULT, "Map", [(UINT, "Subresource"), (D3D10_MAP, "MapType"), (D3D10_MAP_FLAG, "MapFlags"), Out(Pointer(LinearPointer(Void, "_MappedSize")), "ppData")]),
793 StdMethod(Void, "Unmap", [(UINT, "Subresource")]),
794 StdMethod(Void, "GetDesc", [Out(Pointer(D3D10_TEXTURE1D_DESC), "pDesc")], sideeffects=False),
José Fonsecaaf7d2312011-07-07 10:16:57 +0100795]
796
797ID3D10Texture2D.methods += [
José Fonseca43aa19f2012-11-10 09:29:38 +0000798 StdMethod(HRESULT, "Map", [(UINT, "Subresource"), (D3D10_MAP, "MapType"), (D3D10_MAP_FLAG, "MapFlags"), Out(Pointer(D3D10_MAPPED_TEXTURE2D), "pMappedTex2D")]),
799 StdMethod(Void, "Unmap", [(UINT, "Subresource")]),
800 StdMethod(Void, "GetDesc", [Out(Pointer(D3D10_TEXTURE2D_DESC), "pDesc")], sideeffects=False),
José Fonsecaaf7d2312011-07-07 10:16:57 +0100801]
802
803ID3D10Texture3D.methods += [
José Fonseca43aa19f2012-11-10 09:29:38 +0000804 StdMethod(HRESULT, "Map", [(UINT, "Subresource"), (D3D10_MAP, "MapType"), (D3D10_MAP_FLAG, "MapFlags"), Out(Pointer(D3D10_MAPPED_TEXTURE3D), "pMappedTex3D")]),
805 StdMethod(Void, "Unmap", [(UINT, "Subresource")]),
806 StdMethod(Void, "GetDesc", [Out(Pointer(D3D10_TEXTURE3D_DESC), "pDesc")], sideeffects=False),
José Fonsecaaf7d2312011-07-07 10:16:57 +0100807]
808
809ID3D10View.methods += [
José Fonseca43aa19f2012-11-10 09:29:38 +0000810 StdMethod(Void, "GetResource", [Out(Pointer(ObjPointer(ID3D10Resource)), "ppResource")]),
José Fonsecaaf7d2312011-07-07 10:16:57 +0100811]
812
813ID3D10DepthStencilView.methods += [
José Fonseca43aa19f2012-11-10 09:29:38 +0000814 StdMethod(Void, "GetDesc", [Out(Pointer(D3D10_DEPTH_STENCIL_VIEW_DESC), "pDesc")], sideeffects=False),
José Fonsecaaf7d2312011-07-07 10:16:57 +0100815]
816
817ID3D10RenderTargetView.methods += [
José Fonseca43aa19f2012-11-10 09:29:38 +0000818 StdMethod(Void, "GetDesc", [Out(Pointer(D3D10_RENDER_TARGET_VIEW_DESC), "pDesc")], sideeffects=False),
José Fonsecaaf7d2312011-07-07 10:16:57 +0100819]
820
821ID3D10ShaderResourceView.methods += [
José Fonseca43aa19f2012-11-10 09:29:38 +0000822 StdMethod(Void, "GetDesc", [Out(Pointer(D3D10_SHADER_RESOURCE_VIEW_DESC), "pDesc")], sideeffects=False),
José Fonsecaaf7d2312011-07-07 10:16:57 +0100823]
824
825ID3D10BlendState.methods += [
José Fonseca43aa19f2012-11-10 09:29:38 +0000826 StdMethod(Void, "GetDesc", [Out(Pointer(D3D10_BLEND_DESC), "pDesc")], sideeffects=False),
José Fonsecaaf7d2312011-07-07 10:16:57 +0100827]
828
829ID3D10DepthStencilState.methods += [
José Fonseca43aa19f2012-11-10 09:29:38 +0000830 StdMethod(Void, "GetDesc", [Out(Pointer(D3D10_DEPTH_STENCIL_DESC), "pDesc")], sideeffects=False),
José Fonsecaaf7d2312011-07-07 10:16:57 +0100831]
832
José Fonsecaaf7d2312011-07-07 10:16:57 +0100833ID3D10RasterizerState.methods += [
José Fonseca43aa19f2012-11-10 09:29:38 +0000834 StdMethod(Void, "GetDesc", [Out(Pointer(D3D10_RASTERIZER_DESC), "pDesc")], sideeffects=False),
José Fonsecaaf7d2312011-07-07 10:16:57 +0100835]
836
837ID3D10SamplerState.methods += [
José Fonseca43aa19f2012-11-10 09:29:38 +0000838 StdMethod(Void, "GetDesc", [Out(Pointer(D3D10_SAMPLER_DESC), "pDesc")], sideeffects=False),
José Fonsecaaf7d2312011-07-07 10:16:57 +0100839]
840
José Fonsecaaf7d2312011-07-07 10:16:57 +0100841ID3D10Asynchronous.methods += [
José Fonseca43aa19f2012-11-10 09:29:38 +0000842 StdMethod(Void, "Begin", []),
843 StdMethod(Void, "End", []),
Jose Fonseca60e65142017-06-09 13:06:32 +0100844 StdMethod(HRESULT, "GetData", [Out(D3D10_QUERY_DATA, "pData"), (UINT, "DataSize"), (D3D10_ASYNC_GETDATA_FLAG, "GetDataFlags")]),
José Fonseca43aa19f2012-11-10 09:29:38 +0000845 StdMethod(UINT, "GetDataSize", [], sideeffects=False),
José Fonsecaaf7d2312011-07-07 10:16:57 +0100846]
847
848ID3D10Counter.methods += [
José Fonseca43aa19f2012-11-10 09:29:38 +0000849 StdMethod(Void, "GetDesc", [Out(Pointer(D3D10_COUNTER_DESC), "pDesc")], sideeffects=False),
José Fonsecaaf7d2312011-07-07 10:16:57 +0100850]
851
852ID3D10Query.methods += [
José Fonseca43aa19f2012-11-10 09:29:38 +0000853 StdMethod(Void, "GetDesc", [Out(Pointer(D3D10_QUERY_DESC), "pDesc")], sideeffects=False),
José Fonsecaaf7d2312011-07-07 10:16:57 +0100854]
855
José Fonsecaaf7d2312011-07-07 10:16:57 +0100856ID3D10Device.methods += [
José Fonseca43aa19f2012-11-10 09:29:38 +0000857 StdMethod(Void, "VSSetConstantBuffers", [(UINT, "StartSlot"), (UINT, "NumBuffers"), (Array(Const(ObjPointer(ID3D10Buffer)), "NumBuffers"), "ppConstantBuffers")]),
858 StdMethod(Void, "PSSetShaderResources", [(UINT, "StartSlot"), (UINT, "NumViews"), (Array(Const(ObjPointer(ID3D10ShaderResourceView)), "NumViews"), "ppShaderResourceViews")]),
859 StdMethod(Void, "PSSetShader", [(ObjPointer(ID3D10PixelShader), "pPixelShader")]),
860 StdMethod(Void, "PSSetSamplers", [(UINT, "StartSlot"), (UINT, "NumSamplers"), (Array(Const(ObjPointer(ID3D10SamplerState)), "NumSamplers"), "ppSamplers")]),
861 StdMethod(Void, "VSSetShader", [(ObjPointer(ID3D10VertexShader), "pVertexShader")]),
862 StdMethod(Void, "DrawIndexed", [(UINT, "IndexCount"), (UINT, "StartIndexLocation"), (INT, "BaseVertexLocation")]),
863 StdMethod(Void, "Draw", [(UINT, "VertexCount"), (UINT, "StartVertexLocation")]),
864 StdMethod(Void, "PSSetConstantBuffers", [(UINT, "StartSlot"), (UINT, "NumBuffers"), (Array(Const(ObjPointer(ID3D10Buffer)), "NumBuffers"), "ppConstantBuffers")]),
865 StdMethod(Void, "IASetInputLayout", [(ObjPointer(ID3D10InputLayout), "pInputLayout")]),
866 StdMethod(Void, "IASetVertexBuffers", [(UINT, "StartSlot"), (UINT, "NumBuffers"), (Array(Const(ObjPointer(ID3D10Buffer)), "NumBuffers"), "ppVertexBuffers"), (Array(Const(UINT), "NumBuffers"), "pStrides"), (Array(Const(UINT), "NumBuffers"), "pOffsets")]),
867 StdMethod(Void, "IASetIndexBuffer", [(ObjPointer(ID3D10Buffer), "pIndexBuffer"), (DXGI_FORMAT, "Format"), (UINT, "Offset")]),
868 StdMethod(Void, "DrawIndexedInstanced", [(UINT, "IndexCountPerInstance"), (UINT, "InstanceCount"), (UINT, "StartIndexLocation"), (INT, "BaseVertexLocation"), (UINT, "StartInstanceLocation")]),
869 StdMethod(Void, "DrawInstanced", [(UINT, "VertexCountPerInstance"), (UINT, "InstanceCount"), (UINT, "StartVertexLocation"), (UINT, "StartInstanceLocation")]),
870 StdMethod(Void, "GSSetConstantBuffers", [(UINT, "StartSlot"), (UINT, "NumBuffers"), (Array(Const(ObjPointer(ID3D10Buffer)), "NumBuffers"), "ppConstantBuffers")]),
871 StdMethod(Void, "GSSetShader", [(ObjPointer(ID3D10GeometryShader), "pShader")]),
872 StdMethod(Void, "IASetPrimitiveTopology", [(D3D10_PRIMITIVE_TOPOLOGY, "Topology")]),
873 StdMethod(Void, "VSSetShaderResources", [(UINT, "StartSlot"), (UINT, "NumViews"), (Array(Const(ObjPointer(ID3D10ShaderResourceView)), "NumViews"), "ppShaderResourceViews")]),
874 StdMethod(Void, "VSSetSamplers", [(UINT, "StartSlot"), (UINT, "NumSamplers"), (Array(Const(ObjPointer(ID3D10SamplerState)), "NumSamplers"), "ppSamplers")]),
875 StdMethod(Void, "SetPredication", [(ObjPointer(ID3D10Predicate), "pPredicate"), (BOOL, "PredicateValue")]),
876 StdMethod(Void, "GSSetShaderResources", [(UINT, "StartSlot"), (UINT, "NumViews"), (Array(Const(ObjPointer(ID3D10ShaderResourceView)), "NumViews"), "ppShaderResourceViews")]),
877 StdMethod(Void, "GSSetSamplers", [(UINT, "StartSlot"), (UINT, "NumSamplers"), (Array(Const(ObjPointer(ID3D10SamplerState)), "NumSamplers"), "ppSamplers")]),
878 StdMethod(Void, "OMSetRenderTargets", [(UINT, "NumViews"), (Array(Const(ObjPointer(ID3D10RenderTargetView)), "NumViews"), "ppRenderTargetViews"), (ObjPointer(ID3D10DepthStencilView), "pDepthStencilView")]),
Jose Fonsecaf42d6552019-01-15 14:53:35 +0000879 StdMethod(Void, "OMSetBlendState", [(ObjPointer(ID3D10BlendState), "pBlendState"), (Array(Const(FLOAT), 4), "BlendFactor"), (D3D10_SAMPLE_MASK, "SampleMask")]),
José Fonseca43aa19f2012-11-10 09:29:38 +0000880 StdMethod(Void, "OMSetDepthStencilState", [(ObjPointer(ID3D10DepthStencilState), "pDepthStencilState"), (UINT, "StencilRef")]),
881 StdMethod(Void, "SOSetTargets", [(UINT, "NumBuffers"), (Array(Const(ObjPointer(ID3D10Buffer)), "NumBuffers"), "ppSOTargets"), (Array(Const(UINT), "NumBuffers"), "pOffsets")]),
882 StdMethod(Void, "DrawAuto", []),
883 StdMethod(Void, "RSSetState", [(ObjPointer(ID3D10RasterizerState), "pRasterizerState")]),
884 StdMethod(Void, "RSSetViewports", [(UINT, "NumViewports"), (Array(Const(D3D10_VIEWPORT), "NumViewports"), "pViewports")]),
885 StdMethod(Void, "RSSetScissorRects", [(UINT, "NumRects"), (Array(Const(D3D10_RECT), "NumRects"), "pRects")]),
886 StdMethod(Void, "CopySubresourceRegion", [(ObjPointer(ID3D10Resource), "pDstResource"), (UINT, "DstSubresource"), (UINT, "DstX"), (UINT, "DstY"), (UINT, "DstZ"), (ObjPointer(ID3D10Resource), "pSrcResource"), (UINT, "SrcSubresource"), (Pointer(Const(D3D10_BOX)), "pSrcBox")]),
887 StdMethod(Void, "CopyResource", [(ObjPointer(ID3D10Resource), "pDstResource"), (ObjPointer(ID3D10Resource), "pSrcResource")]),
888 StdMethod(Void, "UpdateSubresource", [(ObjPointer(ID3D10Resource), "pDstResource"), (UINT, "DstSubresource"), (Pointer(Const(D3D10_BOX)), "pDstBox"), (Blob(Const(Void), "_calcSubresourceSize(pDstResource, DstSubresource, pDstBox, SrcRowPitch, SrcDepthPitch)"), "pSrcData"), (UINT, "SrcRowPitch"), (UINT, "SrcDepthPitch")]),
889 StdMethod(Void, "ClearRenderTargetView", [(ObjPointer(ID3D10RenderTargetView), "pRenderTargetView"), (Array(Const(FLOAT), 4), "ColorRGBA")]),
890 StdMethod(Void, "ClearDepthStencilView", [(ObjPointer(ID3D10DepthStencilView), "pDepthStencilView"), (D3D10_CLEAR_FLAG, "ClearFlags"), (FLOAT, "Depth"), (UINT8, "Stencil")]),
891 StdMethod(Void, "GenerateMips", [(ObjPointer(ID3D10ShaderResourceView), "pShaderResourceView")]),
892 StdMethod(Void, "ResolveSubresource", [(ObjPointer(ID3D10Resource), "pDstResource"), (UINT, "DstSubresource"), (ObjPointer(ID3D10Resource), "pSrcResource"), (UINT, "SrcSubresource"), (DXGI_FORMAT, "Format")]),
893 StdMethod(Void, "VSGetConstantBuffers", [(UINT, "StartSlot"), (UINT, "NumBuffers"), Out(Array(ObjPointer(ID3D10Buffer), "NumBuffers"), "ppConstantBuffers")]),
894 StdMethod(Void, "PSGetShaderResources", [(UINT, "StartSlot"), (UINT, "NumViews"), Out(Array(ObjPointer(ID3D10ShaderResourceView), "NumViews"), "ppShaderResourceViews")]),
895 StdMethod(Void, "PSGetShader", [Out(Pointer(ObjPointer(ID3D10PixelShader)), "ppPixelShader")]),
896 StdMethod(Void, "PSGetSamplers", [(UINT, "StartSlot"), (UINT, "NumSamplers"), Out(Array(ObjPointer(ID3D10SamplerState), "NumSamplers"), "ppSamplers")]),
897 StdMethod(Void, "VSGetShader", [Out(Pointer(ObjPointer(ID3D10VertexShader)), "ppVertexShader")]),
898 StdMethod(Void, "PSGetConstantBuffers", [(UINT, "StartSlot"), (UINT, "NumBuffers"), Out(Array(ObjPointer(ID3D10Buffer), "NumBuffers"), "ppConstantBuffers")]),
899 StdMethod(Void, "IAGetInputLayout", [Out(Pointer(ObjPointer(ID3D10InputLayout)), "ppInputLayout")]),
900 StdMethod(Void, "IAGetVertexBuffers", [(UINT, "StartSlot"), (UINT, "NumBuffers"), Out(Array(ObjPointer(ID3D10Buffer), "NumBuffers"), "ppVertexBuffers"), Out(Array(UINT, "NumBuffers"), "pStrides"), Out(Array(UINT, "NumBuffers"), "pOffsets")]),
901 StdMethod(Void, "IAGetIndexBuffer", [Out(Pointer(ObjPointer(ID3D10Buffer)), "pIndexBuffer"), Out(Pointer(DXGI_FORMAT), "Format"), Out(Pointer(UINT), "Offset")]),
902 StdMethod(Void, "GSGetConstantBuffers", [(UINT, "StartSlot"), (UINT, "NumBuffers"), Out(Array(ObjPointer(ID3D10Buffer), "NumBuffers"), "ppConstantBuffers")]),
903 StdMethod(Void, "GSGetShader", [Out(Pointer(ObjPointer(ID3D10GeometryShader)), "ppGeometryShader")]),
904 StdMethod(Void, "IAGetPrimitiveTopology", [Out(Pointer(D3D10_PRIMITIVE_TOPOLOGY), "pTopology")], sideeffects=False),
905 StdMethod(Void, "VSGetShaderResources", [(UINT, "StartSlot"), (UINT, "NumViews"), Out(Array(ObjPointer(ID3D10ShaderResourceView), "NumViews"), "ppShaderResourceViews")]),
906 StdMethod(Void, "VSGetSamplers", [(UINT, "StartSlot"), (UINT, "NumSamplers"), Out(Array(ObjPointer(ID3D10SamplerState), "NumSamplers"), "ppSamplers")]),
907 StdMethod(Void, "GetPredication", [Out(Pointer(ObjPointer(ID3D10Predicate)), "ppPredicate"), Out(Pointer(BOOL), "pPredicateValue")]),
908 StdMethod(Void, "GSGetShaderResources", [(UINT, "StartSlot"), (UINT, "NumViews"), Out(Array(ObjPointer(ID3D10ShaderResourceView), "NumViews"), "ppShaderResourceViews")]),
909 StdMethod(Void, "GSGetSamplers", [(UINT, "StartSlot"), (UINT, "NumSamplers"), Out(Array(ObjPointer(ID3D10SamplerState), "NumSamplers"), "ppSamplers")]),
910 StdMethod(Void, "OMGetRenderTargets", [(UINT, "NumViews"), Out(Array(ObjPointer(ID3D10RenderTargetView), "NumViews"), "ppRenderTargetViews"), Out(Pointer(ObjPointer(ID3D10DepthStencilView)), "ppDepthStencilView")]),
Jose Fonsecaf42d6552019-01-15 14:53:35 +0000911 StdMethod(Void, "OMGetBlendState", [Out(Pointer(ObjPointer(ID3D10BlendState)), "ppBlendState"), Out(Array(FLOAT, 4), "BlendFactor"), Out(Pointer(D3D10_SAMPLE_MASK), "pSampleMask")]),
José Fonseca43aa19f2012-11-10 09:29:38 +0000912 StdMethod(Void, "OMGetDepthStencilState", [Out(Pointer(ObjPointer(ID3D10DepthStencilState)), "ppDepthStencilState"), Out(Pointer(UINT), "pStencilRef")]),
913 StdMethod(Void, "SOGetTargets", [(UINT, "NumBuffers"), Out(Array(ObjPointer(ID3D10Buffer), "NumBuffers"), "ppSOTargets"), Out(Array(UINT, "NumBuffers"), "pOffsets")]),
914 StdMethod(Void, "RSGetState", [Out(Pointer(ObjPointer(ID3D10RasterizerState)), "ppRasterizerState")]),
José Fonseca00b9aba2014-08-13 13:18:48 +0100915 StdMethod(Void, "RSGetViewports", [InOut(Pointer(UINT), "pNumViewports"), Out(Array(D3D10_VIEWPORT, "*pNumViewports"), "pViewports")], sideeffects=False),
916 StdMethod(Void, "RSGetScissorRects", [InOut(Pointer(UINT), "pNumRects"), Out(Array(D3D10_RECT, "*pNumRects"), "pRects")], sideeffects=False),
José Fonseca43aa19f2012-11-10 09:29:38 +0000917 StdMethod(HRESULT, "GetDeviceRemovedReason", [], sideeffects=False),
918 StdMethod(HRESULT, "SetExceptionMode", [(D3D10_RAISE_FLAG, "RaiseFlags")]),
919 StdMethod(D3D10_RAISE_FLAG, "GetExceptionMode", [], sideeffects=False),
José Fonseca9eec9342014-10-03 22:24:50 +0100920 StdMethod(HRESULT, "GetPrivateData", [(REFGUID, "guid"), InOut(Pointer(UINT), "pDataSize"), Out(OpaquePointer(Void), "pData")], sideeffects=False),
José Fonseca43aa19f2012-11-10 09:29:38 +0000921 StdMethod(HRESULT, "SetPrivateData", [(REFGUID, "guid"), (UINT, "DataSize"), (OpaqueBlob(Const(Void), "DataSize"), "pData")], sideeffects=False),
922 StdMethod(HRESULT, "SetPrivateDataInterface", [(REFGUID, "guid"), (OpaquePointer(Const(IUnknown)), "pData")], sideeffects=False),
923 StdMethod(Void, "ClearState", []),
924 StdMethod(Void, "Flush", []),
Jose Fonsecaa9b61382015-06-10 22:04:45 +0100925 StdMethod(HRESULT, "CreateBuffer", [(Pointer(Const(D3D10_BUFFER_DESC)), "pDesc"), (Array(Const(D3D10_SUBRESOURCE_DATA), 1), "pInitialData"), Out(Pointer(ObjPointer(ID3D10Buffer)), "ppBuffer")]),
José Fonseca43aa19f2012-11-10 09:29:38 +0000926 StdMethod(HRESULT, "CreateTexture1D", [(Pointer(Const(D3D10_TEXTURE1D_DESC)), "pDesc"), (Array(Const(D3D10_SUBRESOURCE_DATA), "_getNumSubResources(pDesc)"), "pInitialData"), Out(Pointer(ObjPointer(ID3D10Texture1D)), "ppTexture1D")]),
927 StdMethod(HRESULT, "CreateTexture2D", [(Pointer(Const(D3D10_TEXTURE2D_DESC)), "pDesc"), (Array(Const(D3D10_SUBRESOURCE_DATA), "_getNumSubResources(pDesc)"), "pInitialData"), Out(Pointer(ObjPointer(ID3D10Texture2D)), "ppTexture2D")]),
928 StdMethod(HRESULT, "CreateTexture3D", [(Pointer(Const(D3D10_TEXTURE3D_DESC)), "pDesc"), (Array(Const(D3D10_SUBRESOURCE_DATA), "_getNumSubResources(pDesc)"), "pInitialData"), Out(Pointer(ObjPointer(ID3D10Texture3D)), "ppTexture3D")]),
929 StdMethod(HRESULT, "CreateShaderResourceView", [(ObjPointer(ID3D10Resource), "pResource"), (Pointer(Const(D3D10_SHADER_RESOURCE_VIEW_DESC)), "pDesc"), Out(Pointer(ObjPointer(ID3D10ShaderResourceView)), "ppSRView")]),
930 StdMethod(HRESULT, "CreateRenderTargetView", [(ObjPointer(ID3D10Resource), "pResource"), (Pointer(Const(D3D10_RENDER_TARGET_VIEW_DESC)), "pDesc"), Out(Pointer(ObjPointer(ID3D10RenderTargetView)), "ppRTView")]),
931 StdMethod(HRESULT, "CreateDepthStencilView", [(ObjPointer(ID3D10Resource), "pResource"), (Pointer(Const(D3D10_DEPTH_STENCIL_VIEW_DESC)), "pDesc"), Out(Pointer(ObjPointer(ID3D10DepthStencilView)), "ppDepthStencilView")]),
932 StdMethod(HRESULT, "CreateInputLayout", [(Array(Const(D3D10_INPUT_ELEMENT_DESC), "NumElements"), "pInputElementDescs"), (UINT, "NumElements"), (Blob(Const(Void), "BytecodeLength"), "pShaderBytecodeWithInputSignature"), (SIZE_T, "BytecodeLength"), Out(Pointer(ObjPointer(ID3D10InputLayout)), "ppInputLayout")]),
933 StdMethod(HRESULT, "CreateVertexShader", [(Blob(Const(Void), "BytecodeLength"), "pShaderBytecode"), (SIZE_T, "BytecodeLength"), Out(Pointer(ObjPointer(ID3D10VertexShader)), "ppVertexShader")]),
934 StdMethod(HRESULT, "CreateGeometryShader", [(Blob(Const(Void), "BytecodeLength"), "pShaderBytecode"), (SIZE_T, "BytecodeLength"), Out(Pointer(ObjPointer(ID3D10GeometryShader)), "ppGeometryShader")]),
935 StdMethod(HRESULT, "CreateGeometryShaderWithStreamOutput", [(Blob(Const(Void), "BytecodeLength"), "pShaderBytecode"), (SIZE_T, "BytecodeLength"), (Array(Const(D3D10_SO_DECLARATION_ENTRY), "NumEntries"), "pSODeclaration"), (UINT, "NumEntries"), (UINT, "OutputStreamStride"), Out(Pointer(ObjPointer(ID3D10GeometryShader)), "ppGeometryShader")]),
936 StdMethod(HRESULT, "CreatePixelShader", [(Blob(Const(Void), "BytecodeLength"), "pShaderBytecode"), (SIZE_T, "BytecodeLength"), Out(Pointer(ObjPointer(ID3D10PixelShader)), "ppPixelShader")]),
937 StdMethod(HRESULT, "CreateBlendState", [(Pointer(Const(D3D10_BLEND_DESC)), "pBlendStateDesc"), Out(Pointer(ObjPointer(ID3D10BlendState)), "ppBlendState")]),
938 StdMethod(HRESULT, "CreateDepthStencilState", [(Pointer(Const(D3D10_DEPTH_STENCIL_DESC)), "pDepthStencilDesc"), Out(Pointer(ObjPointer(ID3D10DepthStencilState)), "ppDepthStencilState")]),
939 StdMethod(HRESULT, "CreateRasterizerState", [(Pointer(Const(D3D10_RASTERIZER_DESC)), "pRasterizerDesc"), Out(Pointer(ObjPointer(ID3D10RasterizerState)), "ppRasterizerState")]),
940 StdMethod(HRESULT, "CreateSamplerState", [(Pointer(Const(D3D10_SAMPLER_DESC)), "pSamplerDesc"), Out(Pointer(ObjPointer(ID3D10SamplerState)), "ppSamplerState")]),
941 StdMethod(HRESULT, "CreateQuery", [(Pointer(Const(D3D10_QUERY_DESC)), "pQueryDesc"), Out(Pointer(ObjPointer(ID3D10Query)), "ppQuery")]),
942 StdMethod(HRESULT, "CreatePredicate", [(Pointer(Const(D3D10_QUERY_DESC)), "pPredicateDesc"), Out(Pointer(ObjPointer(ID3D10Predicate)), "ppPredicate")]),
943 StdMethod(HRESULT, "CreateCounter", [(Pointer(Const(D3D10_COUNTER_DESC)), "pCounterDesc"), Out(Pointer(ObjPointer(ID3D10Counter)), "ppCounter")]),
944 StdMethod(HRESULT, "CheckFormatSupport", [(DXGI_FORMAT, "Format"), Out(Pointer(D3D10_FORMAT_SUPPORT), "pFormatSupport")], sideeffects=False),
945 StdMethod(HRESULT, "CheckMultisampleQualityLevels", [(DXGI_FORMAT, "Format"), (UINT, "SampleCount"), Out(Pointer(UINT), "pNumQualityLevels")], sideeffects=False),
José Fonsecae088e5c2012-11-16 20:05:54 +0000946 StdMethod(Void, "CheckCounterInfo", [Out(Pointer(D3D10_COUNTER_INFO), "pCounterInfo")], sideeffects=False),
José Fonseca43aa19f2012-11-10 09:29:38 +0000947 StdMethod(HRESULT, "CheckCounter", [(Pointer(Const(D3D10_COUNTER_DESC)), "pDesc"), Out(Pointer(D3D10_COUNTER_TYPE), "pType"), Out(Pointer(UINT), "pActiveCounters"), Out(LPSTR, "szName"), Out(Pointer(UINT), "pNameLength"), Out(LPSTR, "szUnits"), Out(Pointer(UINT), "pUnitsLength"), Out(LPSTR, "szDescription"), Out(Pointer(UINT), "pDescriptionLength")], sideeffects=False),
948 StdMethod(D3D10_CREATE_DEVICE_FLAG, "GetCreationFlags", [], sideeffects=False),
949 StdMethod(HRESULT, "OpenSharedResource", [(HANDLE, "hResource"), (REFIID, "ReturnedInterface"), Out(Pointer(ObjPointer(Void)), "ppResource")]),
950 StdMethod(Void, "SetTextFilterSize", [(UINT, "Width"), (UINT, "Height")]),
951 StdMethod(Void, "GetTextFilterSize", [Out(Pointer(UINT), "pWidth"), Out(Pointer(UINT), "pHeight")], sideeffects=False),
José Fonsecaaf7d2312011-07-07 10:16:57 +0100952]
953
954ID3D10Multithread.methods += [
José Fonseca43aa19f2012-11-10 09:29:38 +0000955 StdMethod(Void, "Enter", []),
956 StdMethod(Void, "Leave", []),
957 StdMethod(BOOL, "SetMultithreadProtected", [(BOOL, "bMTProtect")]),
958 StdMethod(BOOL, "GetMultithreadProtected", [], sideeffects=False),
José Fonsecaaf7d2312011-07-07 10:16:57 +0100959]
960
Jose Fonseca550c98d2018-02-13 12:59:31 +0000961ID3D10DebugTest = Interface('ID3D10DebugTest', IUnknown)
962ID3D10DebugTest.methods += [
963 StdMethod(Void, 'PreventFurtherExecutionOnError', [(BOOL, 'Enable')]),
964 StdMethod(Void, 'VSSetConstantBuffer14', [(ObjPointer(ID3D10Buffer), 'pCB14')]),
965 StdMethod(Void, 'GSSetConstantBuffer14', [(ObjPointer(ID3D10Buffer), 'pCB14')]),
966 StdMethod(Void, 'PSSetConstantBuffer14', [(ObjPointer(ID3D10Buffer), 'pCB14')]),
967]
968
Jose Fonsecaa92e0c42015-03-14 10:49:23 +0000969D3D10_DRIVER_TYPE = Enum("D3D10_DRIVER_TYPE", [
970 "D3D10_DRIVER_TYPE_HARDWARE",
971 "D3D10_DRIVER_TYPE_REFERENCE",
972 "D3D10_DRIVER_TYPE_NULL",
973 "D3D10_DRIVER_TYPE_SOFTWARE",
974 "D3D10_DRIVER_TYPE_WARP",
975])
976
977
José Fonseca81301932012-11-11 00:10:20 +0000978d3d10 = Module("d3d10")
José Fonseca467a42a2012-05-04 11:49:19 +0100979
Jose Fonsecaa92e0c42015-03-14 10:49:23 +0000980d3d10.addFunctions([
981 StdFunction(HRESULT, "D3D10CreateDevice", [(ObjPointer(IDXGIAdapter), "pAdapter"), (D3D10_DRIVER_TYPE, "DriverType"), (HMODULE, "Software"), (D3D10_CREATE_DEVICE_FLAG, "Flags"), (UINT, "SDKVersion"), Out(Pointer(ObjPointer(ID3D10Device)), "ppDevice")]),
982 StdFunction(HRESULT, "D3D10CreateDeviceAndSwapChain", [(ObjPointer(IDXGIAdapter), "pAdapter"), (D3D10_DRIVER_TYPE, "DriverType"), (HMODULE, "Software"), (D3D10_CREATE_DEVICE_FLAG, "Flags"), (UINT, "SDKVersion"), (Pointer(DXGI_SWAP_CHAIN_DESC), "pSwapChainDesc"), Out(Pointer(ObjPointer(IDXGISwapChain)), "ppSwapChain"), Out(Pointer(ObjPointer(ID3D10Device)), "ppDevice")]),
983])
José Fonseca467a42a2012-05-04 11:49:19 +0100984
Jose Fonsecaa92e0c42015-03-14 10:49:23 +0000985d3d10.addInterfaces([
986 ID3D10Debug,
987 ID3D10InfoQueue,
988 ID3D10Multithread,
989 ID3D10SwitchToRef,
Jose Fonseca550c98d2018-02-13 12:59:31 +0000990 ID3D10DebugTest,
Jose Fonsecaa92e0c42015-03-14 10:49:23 +0000991])
992
993
994#
995# D3D10.1
996#
997
998
999D3D10_FEATURE_LEVEL1 = Enum("D3D10_FEATURE_LEVEL1", [
1000 "D3D10_FEATURE_LEVEL_10_0",
1001 "D3D10_FEATURE_LEVEL_10_1",
1002 "D3D10_FEATURE_LEVEL_9_1",
1003 "D3D10_FEATURE_LEVEL_9_2",
1004 "D3D10_FEATURE_LEVEL_9_3",
1005])
1006
1007D3D10_RENDER_TARGET_BLEND_DESC1 = Struct("D3D10_RENDER_TARGET_BLEND_DESC1", [
1008 (BOOL, "BlendEnable"),
1009 (D3D10_BLEND, "SrcBlend"),
1010 (D3D10_BLEND, "DestBlend"),
1011 (D3D10_BLEND_OP, "BlendOp"),
1012 (D3D10_BLEND, "SrcBlendAlpha"),
1013 (D3D10_BLEND, "DestBlendAlpha"),
1014 (D3D10_BLEND_OP, "BlendOpAlpha"),
1015 (UINT8, "RenderTargetWriteMask"),
1016])
1017
Jose Fonsecaa9b61382015-06-10 22:04:45 +01001018D3D10_SIMULTANEOUS_RENDER_TARGET_COUNT = 8
1019
Jose Fonsecaa92e0c42015-03-14 10:49:23 +00001020D3D10_BLEND_DESC1 = Struct("D3D10_BLEND_DESC1", [
1021 (BOOL, "AlphaToCoverageEnable"),
1022 (BOOL, "IndependentBlendEnable"),
Jose Fonsecaa9b61382015-06-10 22:04:45 +01001023 (Array(D3D10_RENDER_TARGET_BLEND_DESC1, D3D10_SIMULTANEOUS_RENDER_TARGET_COUNT), "RenderTarget"),
Jose Fonsecaa92e0c42015-03-14 10:49:23 +00001024])
1025
1026ID3D10BlendState1 = Interface("ID3D10BlendState1", ID3D10BlendState)
1027ID3D10BlendState1.methods += [
1028 StdMethod(Void, "GetDesc1", [Out(Pointer(D3D10_BLEND_DESC1), "pDesc")], sideeffects=False),
1029]
1030
Jose Fonseca5f5181d2015-07-17 12:06:23 +01001031D3D10_SRV_DIMENSION1 = Enum("D3D10_SRV_DIMENSION1", [
1032 "D3D10_1_SRV_DIMENSION_UNKNOWN",
1033 "D3D10_1_SRV_DIMENSION_BUFFER",
1034 "D3D10_1_SRV_DIMENSION_TEXTURE1D",
1035 "D3D10_1_SRV_DIMENSION_TEXTURE1DARRAY",
1036 "D3D10_1_SRV_DIMENSION_TEXTURE2D",
1037 "D3D10_1_SRV_DIMENSION_TEXTURE2DARRAY",
1038 "D3D10_1_SRV_DIMENSION_TEXTURE2DMS",
1039 "D3D10_1_SRV_DIMENSION_TEXTURE2DMSARRAY",
1040 "D3D10_1_SRV_DIMENSION_TEXTURE3D",
1041 "D3D10_1_SRV_DIMENSION_TEXTURECUBE",
1042 "D3D10_1_SRV_DIMENSION_TEXTURECUBEARRAY",
1043])
1044
Jose Fonsecaa92e0c42015-03-14 10:49:23 +00001045D3D10_TEXCUBE_ARRAY_SRV1 = Struct("D3D10_TEXCUBE_ARRAY_SRV1", [
1046 (UINT, "MostDetailedMip"),
1047 (UINT, "MipLevels"),
1048 (UINT, "First2DArrayFace"),
1049 (UINT, "NumCubes"),
1050])
1051
1052D3D10_SHADER_RESOURCE_VIEW_DESC1 = Struct("D3D10_SHADER_RESOURCE_VIEW_DESC1", [
1053 (DXGI_FORMAT, "Format"),
1054 (D3D10_SRV_DIMENSION1, "ViewDimension"),
1055 (Union("{self}.ViewDimension", [
1056 ("D3D10_1_SRV_DIMENSION_BUFFER", D3D10_BUFFER_SRV, "Buffer"),
1057 ("D3D10_1_SRV_DIMENSION_TEXTURE1D", D3D10_TEX1D_SRV, "Texture1D"),
1058 ("D3D10_1_SRV_DIMENSION_TEXTURE1DARRAY", D3D10_TEX1D_ARRAY_SRV, "Texture1DArray"),
1059 ("D3D10_1_SRV_DIMENSION_TEXTURE2D", D3D10_TEX2D_SRV, "Texture2D"),
1060 ("D3D10_1_SRV_DIMENSION_TEXTURE2DARRAY", D3D10_TEX2D_ARRAY_SRV, "Texture2DArray"),
1061 ("D3D10_1_SRV_DIMENSION_TEXTURE2DMS", D3D10_TEX2DMS_SRV, "Texture2DMS"),
1062 ("D3D10_1_SRV_DIMENSION_TEXTURE2DMSARRAY", D3D10_TEX2DMS_ARRAY_SRV, "Texture2DMSArray"),
1063 ("D3D10_1_SRV_DIMENSION_TEXTURE3D", D3D10_TEX3D_SRV, "Texture3D"),
1064 ("D3D10_1_SRV_DIMENSION_TEXTURECUBE", D3D10_TEXCUBE_SRV, "TextureCube"),
1065 ("D3D10_1_SRV_DIMENSION_TEXTURECUBEARRAY", D3D10_TEXCUBE_ARRAY_SRV1, "TextureCubeArray"),
1066 ]), None),
1067])
1068
1069ID3D10ShaderResourceView1 = Interface("ID3D10ShaderResourceView1", ID3D10ShaderResourceView)
1070ID3D10ShaderResourceView1.methods += [
1071 StdMethod(Void, "GetDesc1", [Out(Pointer(D3D10_SHADER_RESOURCE_VIEW_DESC1), "pDesc")], sideeffects=False),
1072]
1073
1074ID3D10Device1 = Interface("ID3D10Device1", ID3D10Device)
1075ID3D10Device1.methods += [
1076 StdMethod(HRESULT, "CreateShaderResourceView1", [(ObjPointer(ID3D10Resource), "pResource"), (Pointer(Const(D3D10_SHADER_RESOURCE_VIEW_DESC1)), "pDesc"), Out(Pointer(ObjPointer(ID3D10ShaderResourceView1)), "ppSRView")]),
1077 StdMethod(HRESULT, "CreateBlendState1", [(Pointer(Const(D3D10_BLEND_DESC1)), "pBlendStateDesc"), Out(Pointer(ObjPointer(ID3D10BlendState1)), "ppBlendState")]),
1078 StdMethod(D3D10_FEATURE_LEVEL1, "GetFeatureLevel", [], sideeffects=False),
1079]
1080
1081
1082d3d10_1 = Module("d3d10_1")
1083
1084d3d10_1.addFunctions([
1085 StdFunction(HRESULT, "D3D10CreateDevice1", [(ObjPointer(IDXGIAdapter), "pAdapter"), (D3D10_DRIVER_TYPE, "DriverType"), (HMODULE, "Software"), (D3D10_CREATE_DEVICE_FLAG, "Flags"), (D3D10_FEATURE_LEVEL1, "HardwareLevel"), (UINT, "SDKVersion"), Out(Pointer(ObjPointer(ID3D10Device1)), "ppDevice")]),
1086 StdFunction(HRESULT, "D3D10CreateDeviceAndSwapChain1", [(ObjPointer(IDXGIAdapter), "pAdapter"), (D3D10_DRIVER_TYPE, "DriverType"), (HMODULE, "Software"), (D3D10_CREATE_DEVICE_FLAG, "Flags"), (D3D10_FEATURE_LEVEL1, "HardwareLevel"), (UINT, "SDKVersion"), (Pointer(DXGI_SWAP_CHAIN_DESC), "pSwapChainDesc"), Out(Pointer(ObjPointer(IDXGISwapChain)), "ppSwapChain"), Out(Pointer(ObjPointer(ID3D10Device1)), "ppDevice")]),
1087])
1088
1089d3d10_1.addInterfaces([
1090 ID3D10Debug,
1091 ID3D10InfoQueue,
1092 ID3D10Multithread,
1093 ID3D10SwitchToRef,
1094])