1 ##########################################################################
3 # Copyright 2011 Jose Fonseca
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:
13 # The above copyright notice and this permission notice shall be included in
14 # all copies or substantial portions of the Software.
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
24 ##########################################################################/
28 from d3dcommon import *
31 HRESULT = MAKE_HRESULT([
32 "D3D10_ERROR_FILE_NOT_FOUND",
33 "D3D10_ERROR_TOO_MANY_UNIQUE_STATE_OBJECTS",
35 "D3DERR_WASSTILLDRAWING",
38 D3D10_BLEND = Enum("D3D10_BLEND", [
41 "D3D10_BLEND_SRC_COLOR",
42 "D3D10_BLEND_INV_SRC_COLOR",
43 "D3D10_BLEND_SRC_ALPHA",
44 "D3D10_BLEND_INV_SRC_ALPHA",
45 "D3D10_BLEND_DEST_ALPHA",
46 "D3D10_BLEND_INV_DEST_ALPHA",
47 "D3D10_BLEND_DEST_COLOR",
48 "D3D10_BLEND_INV_DEST_COLOR",
49 "D3D10_BLEND_SRC_ALPHA_SAT",
50 "D3D10_BLEND_BLEND_FACTOR",
51 "D3D10_BLEND_INV_BLEND_FACTOR",
52 "D3D10_BLEND_SRC1_COLOR",
53 "D3D10_BLEND_INV_SRC1_COLOR",
54 "D3D10_BLEND_SRC1_ALPHA",
55 "D3D10_BLEND_INV_SRC1_ALPHA",
58 D3D10_BLEND_OP = Enum("D3D10_BLEND_OP", [
60 "D3D10_BLEND_OP_SUBTRACT",
61 "D3D10_BLEND_OP_REV_SUBTRACT",
66 D3D10_BLEND_DESC = Struct("D3D10_BLEND_DESC", [
67 (BOOL, "AlphaToCoverageEnable"),
68 (Array(BOOL, 8), "BlendEnable"),
69 (D3D10_BLEND, "SrcBlend"),
70 (D3D10_BLEND, "DestBlend"),
71 (D3D10_BLEND_OP, "BlendOp"),
72 (D3D10_BLEND, "SrcBlendAlpha"),
73 (D3D10_BLEND, "DestBlendAlpha"),
74 (D3D10_BLEND_OP, "BlendOpAlpha"),
75 (Array(UINT8, 8), "RenderTargetWriteMask"),
78 D3D10_DEPTH_WRITE_MASK = Enum("D3D10_DEPTH_WRITE_MASK", [
79 "D3D10_DEPTH_WRITE_MASK_ZERO",
80 "D3D10_DEPTH_WRITE_MASK_ALL",
83 D3D10_COMPARISON_FUNC = Enum("D3D10_COMPARISON_FUNC", [
84 "D3D10_COMPARISON_NEVER",
85 "D3D10_COMPARISON_LESS",
86 "D3D10_COMPARISON_EQUAL",
87 "D3D10_COMPARISON_LESS_EQUAL",
88 "D3D10_COMPARISON_GREATER",
89 "D3D10_COMPARISON_NOT_EQUAL",
90 "D3D10_COMPARISON_GREATER_EQUAL",
91 "D3D10_COMPARISON_ALWAYS",
94 D3D10_STENCIL_OP = Enum("D3D10_STENCIL_OP", [
95 "D3D10_STENCIL_OP_KEEP",
96 "D3D10_STENCIL_OP_ZERO",
97 "D3D10_STENCIL_OP_REPLACE",
98 "D3D10_STENCIL_OP_INCR_SAT",
99 "D3D10_STENCIL_OP_DECR_SAT",
100 "D3D10_STENCIL_OP_INVERT",
101 "D3D10_STENCIL_OP_INCR",
102 "D3D10_STENCIL_OP_DECR",
105 D3D10_DEPTH_STENCILOP_DESC = Struct("D3D10_DEPTH_STENCILOP_DESC", [
106 (D3D10_STENCIL_OP, "StencilFailOp"),
107 (D3D10_STENCIL_OP, "StencilDepthFailOp"),
108 (D3D10_STENCIL_OP, "StencilPassOp"),
109 (D3D10_COMPARISON_FUNC, "StencilFunc"),
112 D3D10_DEPTH_STENCIL_DESC = Struct("D3D10_DEPTH_STENCIL_DESC", [
113 (BOOL, "DepthEnable"),
114 (D3D10_DEPTH_WRITE_MASK, "DepthWriteMask"),
115 (D3D10_COMPARISON_FUNC, "DepthFunc"),
116 (BOOL, "StencilEnable"),
117 (UINT8, "StencilReadMask"),
118 (UINT8, "StencilWriteMask"),
119 (D3D10_DEPTH_STENCILOP_DESC, "FrontFace"),
120 (D3D10_DEPTH_STENCILOP_DESC, "BackFace"),
123 D3D10_FILL_MODE = Enum("D3D10_FILL_MODE", [
124 "D3D10_FILL_WIREFRAME",
128 D3D10_CULL_MODE = Enum("D3D10_CULL_MODE", [
134 D3D10_RASTERIZER_DESC = Struct("D3D10_RASTERIZER_DESC", [
135 (D3D10_FILL_MODE, "FillMode"),
136 (D3D10_CULL_MODE, "CullMode"),
137 (BOOL, "FrontCounterClockwise"),
139 (FLOAT, "DepthBiasClamp"),
140 (FLOAT, "SlopeScaledDepthBias"),
141 (BOOL, "DepthClipEnable"),
142 (BOOL, "ScissorEnable"),
143 (BOOL, "MultisampleEnable"),
144 (BOOL, "AntialiasedLineEnable"),
147 D3D10_FILTER = Enum("D3D10_FILTER", [
148 "D3D10_FILTER_MIN_MAG_MIP_POINT",
149 "D3D10_FILTER_MIN_MAG_POINT_MIP_LINEAR",
150 "D3D10_FILTER_MIN_POINT_MAG_LINEAR_MIP_POINT",
151 "D3D10_FILTER_MIN_POINT_MAG_MIP_LINEAR",
152 "D3D10_FILTER_MIN_LINEAR_MAG_MIP_POINT",
153 "D3D10_FILTER_MIN_LINEAR_MAG_POINT_MIP_LINEAR",
154 "D3D10_FILTER_MIN_MAG_LINEAR_MIP_POINT",
155 "D3D10_FILTER_MIN_MAG_MIP_LINEAR",
156 "D3D10_FILTER_ANISOTROPIC",
157 "D3D10_FILTER_COMPARISON_MIN_MAG_MIP_POINT",
158 "D3D10_FILTER_COMPARISON_MIN_MAG_POINT_MIP_LINEAR",
159 "D3D10_FILTER_COMPARISON_MIN_POINT_MAG_LINEAR_MIP_POINT",
160 "D3D10_FILTER_COMPARISON_MIN_POINT_MAG_MIP_LINEAR",
161 "D3D10_FILTER_COMPARISON_MIN_LINEAR_MAG_MIP_POINT",
162 "D3D10_FILTER_COMPARISON_MIN_LINEAR_MAG_POINT_MIP_LINEAR",
163 "D3D10_FILTER_COMPARISON_MIN_MAG_LINEAR_MIP_POINT",
164 "D3D10_FILTER_COMPARISON_MIN_MAG_MIP_LINEAR",
165 "D3D10_FILTER_COMPARISON_ANISOTROPIC",
166 "D3D10_FILTER_TEXT_1BIT",
169 D3D10_TEXTURE_ADDRESS_MODE = Enum("D3D10_TEXTURE_ADDRESS_MODE", [
170 "D3D10_TEXTURE_ADDRESS_WRAP",
171 "D3D10_TEXTURE_ADDRESS_MIRROR",
172 "D3D10_TEXTURE_ADDRESS_CLAMP",
173 "D3D10_TEXTURE_ADDRESS_BORDER",
174 "D3D10_TEXTURE_ADDRESS_MIRROR_ONCE",
177 D3D10_SAMPLER_DESC = Struct("D3D10_SAMPLER_DESC", [
178 (D3D10_FILTER, "Filter"),
179 (D3D10_TEXTURE_ADDRESS_MODE, "AddressU"),
180 (D3D10_TEXTURE_ADDRESS_MODE, "AddressV"),
181 (D3D10_TEXTURE_ADDRESS_MODE, "AddressW"),
182 (FLOAT, "MipLODBias"),
183 (UINT, "MaxAnisotropy"),
184 (D3D10_COMPARISON_FUNC, "ComparisonFunc"),
185 (Array(FLOAT, 4), "BorderColor"),
190 D3D10_FORMAT_SUPPORT = Flags(UINT, [
191 "D3D10_FORMAT_SUPPORT_BUFFER",
192 "D3D10_FORMAT_SUPPORT_IA_VERTEX_BUFFER",
193 "D3D10_FORMAT_SUPPORT_IA_INDEX_BUFFER",
194 "D3D10_FORMAT_SUPPORT_SO_BUFFER",
195 "D3D10_FORMAT_SUPPORT_TEXTURE1D",
196 "D3D10_FORMAT_SUPPORT_TEXTURE2D",
197 "D3D10_FORMAT_SUPPORT_TEXTURE3D",
198 "D3D10_FORMAT_SUPPORT_TEXTURECUBE",
199 "D3D10_FORMAT_SUPPORT_SHADER_LOAD",
200 "D3D10_FORMAT_SUPPORT_SHADER_SAMPLE",
201 "D3D10_FORMAT_SUPPORT_SHADER_SAMPLE_COMPARISON",
202 "D3D10_FORMAT_SUPPORT_SHADER_SAMPLE_MONO_TEXT",
203 "D3D10_FORMAT_SUPPORT_MIP",
204 "D3D10_FORMAT_SUPPORT_MIP_AUTOGEN",
205 "D3D10_FORMAT_SUPPORT_RENDER_TARGET",
206 "D3D10_FORMAT_SUPPORT_BLENDABLE",
207 "D3D10_FORMAT_SUPPORT_DEPTH_STENCIL",
208 "D3D10_FORMAT_SUPPORT_CPU_LOCKABLE",
209 "D3D10_FORMAT_SUPPORT_MULTISAMPLE_RESOLVE",
210 "D3D10_FORMAT_SUPPORT_DISPLAY",
211 "D3D10_FORMAT_SUPPORT_CAST_WITHIN_BIT_LAYOUT",
212 "D3D10_FORMAT_SUPPORT_MULTISAMPLE_RENDERTARGET",
213 "D3D10_FORMAT_SUPPORT_MULTISAMPLE_LOAD",
214 "D3D10_FORMAT_SUPPORT_SHADER_GATHER",
215 "D3D10_FORMAT_SUPPORT_BACK_BUFFER_CAST",
218 D3D10_COUNTER = Enum("D3D10_COUNTER", [
219 "D3D10_COUNTER_GPU_IDLE",
220 "D3D10_COUNTER_VERTEX_PROCESSING",
221 "D3D10_COUNTER_GEOMETRY_PROCESSING",
222 "D3D10_COUNTER_PIXEL_PROCESSING",
223 "D3D10_COUNTER_OTHER_GPU_PROCESSING",
224 "D3D10_COUNTER_HOST_ADAPTER_BANDWIDTH_UTILIZATION",
225 "D3D10_COUNTER_LOCAL_VIDMEM_BANDWIDTH_UTILIZATION",
226 "D3D10_COUNTER_VERTEX_THROUGHPUT_UTILIZATION",
227 "D3D10_COUNTER_TRIANGLE_SETUP_THROUGHPUT_UTILIZATION",
228 "D3D10_COUNTER_FILLRATE_THROUGHPUT_UTILIZATION",
229 "D3D10_COUNTER_VS_MEMORY_LIMITED",
230 "D3D10_COUNTER_VS_COMPUTATION_LIMITED",
231 "D3D10_COUNTER_GS_MEMORY_LIMITED",
232 "D3D10_COUNTER_GS_COMPUTATION_LIMITED",
233 "D3D10_COUNTER_PS_MEMORY_LIMITED",
234 "D3D10_COUNTER_PS_COMPUTATION_LIMITED",
235 "D3D10_COUNTER_POST_TRANSFORM_CACHE_HIT_RATE",
236 "D3D10_COUNTER_TEXTURE_CACHE_HIT_RATE",
237 "D3D10_COUNTER_DEVICE_DEPENDENT_0",
240 D3D10_COUNTER_DESC = Struct("D3D10_COUNTER_DESC", [
241 (D3D10_COUNTER, "Counter"),
245 D3D10_COUNTER_TYPE = Enum("D3D10_COUNTER_TYPE", [
246 "D3D10_COUNTER_TYPE_FLOAT32",
247 "D3D10_COUNTER_TYPE_UINT16",
248 "D3D10_COUNTER_TYPE_UINT32",
249 "D3D10_COUNTER_TYPE_UINT64",
252 D3D10_COUNTER_INFO = Struct("D3D10_COUNTER_INFO", [
253 (D3D10_COUNTER, "LastDeviceDependentCounter"),
254 (UINT, "NumSimultaneousCounters"),
255 (UINT8, "NumDetectableParallelUnits"),
258 D3D10_RESOURCE_DIMENSION = Enum("D3D10_RESOURCE_DIMENSION", [
259 "D3D10_RESOURCE_DIMENSION_UNKNOWN",
260 "D3D10_RESOURCE_DIMENSION_BUFFER",
261 "D3D10_RESOURCE_DIMENSION_TEXTURE1D",
262 "D3D10_RESOURCE_DIMENSION_TEXTURE2D",
263 "D3D10_RESOURCE_DIMENSION_TEXTURE3D",
266 D3D10_USAGE = Enum("D3D10_USAGE", [
267 "D3D10_USAGE_DEFAULT",
268 "D3D10_USAGE_IMMUTABLE",
269 "D3D10_USAGE_DYNAMIC",
270 "D3D10_USAGE_STAGING",
273 D3D10_BIND_FLAG = Flags(UINT, [
274 "D3D10_BIND_VERTEX_BUFFER",
275 "D3D10_BIND_INDEX_BUFFER",
276 "D3D10_BIND_CONSTANT_BUFFER",
277 "D3D10_BIND_SHADER_RESOURCE",
278 "D3D10_BIND_STREAM_OUTPUT",
279 "D3D10_BIND_RENDER_TARGET",
280 "D3D10_BIND_DEPTH_STENCIL",
283 D3D10_CPU_ACCESS_FLAG = Flags(UINT, [
284 "D3D10_CPU_ACCESS_WRITE",
285 "D3D10_CPU_ACCESS_READ",
288 D3D10_RESOURCE_MISC_FLAG = Flags(UINT, [
289 "D3D10_RESOURCE_MISC_GENERATE_MIPS",
290 "D3D10_RESOURCE_MISC_SHARED",
291 "D3D10_RESOURCE_MISC_TEXTURECUBE",
292 "D3D10_RESOURCE_MISC_SHARED_KEYEDMUTEX",
293 "D3D10_RESOURCE_MISC_GDI_COMPATIBLE",
296 D3D10_BUFFER_DESC = Struct("D3D10_BUFFER_DESC", [
298 (D3D10_USAGE, "Usage"),
299 (D3D10_BIND_FLAG, "BindFlags"),
300 (D3D10_CPU_ACCESS_FLAG, "CPUAccessFlags"),
301 (D3D10_RESOURCE_MISC_FLAG, "MiscFlags"),
304 D3D10_MAP = Enum("D3D10_MAP", [
307 "D3D10_MAP_READ_WRITE",
308 "D3D10_MAP_WRITE_DISCARD",
309 "D3D10_MAP_WRITE_NO_OVERWRITE",
312 D3D10_TEXTURE1D_DESC = Struct("D3D10_TEXTURE1D_DESC", [
316 (DXGI_FORMAT, "Format"),
317 (D3D10_USAGE, "Usage"),
318 (D3D10_BIND_FLAG, "BindFlags"),
319 (D3D10_CPU_ACCESS_FLAG, "CPUAccessFlags"),
320 (D3D10_RESOURCE_MISC_FLAG, "MiscFlags"),
323 D3D10_TEXTURE2D_DESC = Struct("D3D10_TEXTURE2D_DESC", [
328 (DXGI_FORMAT, "Format"),
329 (DXGI_SAMPLE_DESC, "SampleDesc"),
330 (D3D10_USAGE, "Usage"),
331 (D3D10_BIND_FLAG, "BindFlags"),
332 (D3D10_CPU_ACCESS_FLAG, "CPUAccessFlags"),
333 (D3D10_RESOURCE_MISC_FLAG, "MiscFlags"),
336 D3D10_TEXTURE3D_DESC = Struct("D3D10_TEXTURE3D_DESC", [
341 (DXGI_FORMAT, "Format"),
342 (D3D10_USAGE, "Usage"),
343 (D3D10_BIND_FLAG, "BindFlags"),
344 (D3D10_CPU_ACCESS_FLAG, "CPUAccessFlags"),
345 (D3D10_RESOURCE_MISC_FLAG, "MiscFlags"),
348 D3D10_DSV_DIMENSION = Enum("D3D10_DSV_DIMENSION", [
349 "D3D10_DSV_DIMENSION_UNKNOWN",
350 "D3D10_DSV_DIMENSION_TEXTURE1D",
351 "D3D10_DSV_DIMENSION_TEXTURE1DARRAY",
352 "D3D10_DSV_DIMENSION_TEXTURE2D",
353 "D3D10_DSV_DIMENSION_TEXTURE2DARRAY",
354 "D3D10_DSV_DIMENSION_TEXTURE2DMS",
355 "D3D10_DSV_DIMENSION_TEXTURE2DMSARRAY",
358 D3D10_TEX1D_DSV = Struct("D3D10_TEX1D_DSV", [
362 D3D10_TEX1D_ARRAY_DSV = Struct("D3D10_TEX1D_ARRAY_DSV", [
364 (UINT, "FirstArraySlice"),
368 D3D10_TEX2D_DSV = Struct("D3D10_TEX2D_DSV", [
372 D3D10_TEX2D_ARRAY_DSV = Struct("D3D10_TEX2D_ARRAY_DSV", [
374 (UINT, "FirstArraySlice"),
378 D3D10_TEX2DMS_DSV = Struct("D3D10_TEX2DMS_DSV", [
379 (UINT, "UnusedField_NothingToDefine"),
382 D3D10_TEX2DMS_ARRAY_DSV = Struct("D3D10_TEX2DMS_ARRAY_DSV", [
383 (UINT, "FirstArraySlice"),
387 D3D10_DEPTH_STENCIL_VIEW_DESC = Struct("D3D10_DEPTH_STENCIL_VIEW_DESC", [
388 (DXGI_FORMAT, "Format"),
389 (D3D10_DSV_DIMENSION, "ViewDimension"),
390 (Union("{self}.ViewDimension", [
391 ("D3D10_DSV_DIMENSION_TEXTURE1D", D3D10_TEX1D_DSV, "Texture1D"),
392 ("D3D10_DSV_DIMENSION_TEXTURE1DARRAY", D3D10_TEX1D_ARRAY_DSV, "Texture1DArray"),
393 ("D3D10_DSV_DIMENSION_TEXTURE2D", D3D10_TEX2D_DSV, "Texture2D"),
394 ("D3D10_DSV_DIMENSION_TEXTURE2DARRAY", D3D10_TEX2D_ARRAY_DSV, "Texture2DArray"),
395 ("D3D10_DSV_DIMENSION_TEXTURE2DMS", D3D10_TEX2DMS_DSV, "Texture2DMS"),
396 ("D3D10_DSV_DIMENSION_TEXTURE2DMSARRAY", D3D10_TEX2DMS_ARRAY_DSV, "Texture2DMSArray"),
400 D3D10_RTV_DIMENSION = Enum("D3D10_RTV_DIMENSION", [
401 "D3D10_RTV_DIMENSION_UNKNOWN",
402 "D3D10_RTV_DIMENSION_BUFFER",
403 "D3D10_RTV_DIMENSION_TEXTURE1D",
404 "D3D10_RTV_DIMENSION_TEXTURE1DARRAY",
405 "D3D10_RTV_DIMENSION_TEXTURE2D",
406 "D3D10_RTV_DIMENSION_TEXTURE2DARRAY",
407 "D3D10_RTV_DIMENSION_TEXTURE2DMS",
408 "D3D10_RTV_DIMENSION_TEXTURE2DMSARRAY",
409 "D3D10_RTV_DIMENSION_TEXTURE3D",
412 D3D10_BUFFER_RTV = Struct("D3D10_BUFFER_RTV", [
413 (UINT, "FirstElement"),
414 (UINT, "NumElements"),
417 D3D10_TEX1D_RTV = Struct("D3D10_TEX1D_RTV", [
421 D3D10_TEX1D_ARRAY_RTV = Struct("D3D10_TEX1D_ARRAY_RTV", [
423 (UINT, "FirstArraySlice"),
427 D3D10_TEX2D_RTV = Struct("D3D10_TEX2D_RTV", [
431 D3D10_TEX2D_ARRAY_RTV = Struct("D3D10_TEX2D_ARRAY_RTV", [
433 (UINT, "FirstArraySlice"),
437 D3D10_TEX2DMS_RTV = Struct("D3D10_TEX2DMS_RTV", [
438 (UINT, "UnusedField_NothingToDefine"),
441 D3D10_TEX2DMS_ARRAY_RTV = Struct("D3D10_TEX2DMS_ARRAY_RTV", [
442 (UINT, "FirstArraySlice"),
446 D3D10_TEX3D_RTV = Struct("D3D10_TEX3D_RTV", [
448 (UINT, "FirstWSlice"),
452 D3D10_RENDER_TARGET_VIEW_DESC = Struct("D3D10_RENDER_TARGET_VIEW_DESC", [
453 (DXGI_FORMAT, "Format"),
454 (D3D10_RTV_DIMENSION, "ViewDimension"),
455 (Union("{self}.ViewDimension", [
456 ("D3D10_RTV_DIMENSION_BUFFER", D3D10_BUFFER_RTV, "Buffer"),
457 ("D3D10_RTV_DIMENSION_TEXTURE1D", D3D10_TEX1D_RTV, "Texture1D"),
458 ("D3D10_RTV_DIMENSION_TEXTURE1DARRAY", D3D10_TEX1D_ARRAY_RTV, "Texture1DArray"),
459 ("D3D10_RTV_DIMENSION_TEXTURE2D", D3D10_TEX2D_RTV, "Texture2D"),
460 ("D3D10_RTV_DIMENSION_TEXTURE2DARRAY", D3D10_TEX2D_ARRAY_RTV, "Texture2DArray"),
461 ("D3D10_RTV_DIMENSION_TEXTURE2DMS", D3D10_TEX2DMS_RTV, "Texture2DMS"),
462 ("D3D10_RTV_DIMENSION_TEXTURE2DMSARRAY", D3D10_TEX2DMS_ARRAY_RTV, "Texture2DMSArray"),
463 ("D3D10_RTV_DIMENSION_TEXTURE3D", D3D10_TEX3D_RTV, "Texture3D"),
467 D3D10_SRV_DIMENSION = Enum("D3D10_SRV_DIMENSION", [
468 "D3D10_SRV_DIMENSION_UNKNOWN",
469 "D3D10_SRV_DIMENSION_BUFFER",
470 "D3D10_SRV_DIMENSION_TEXTURE1D",
471 "D3D10_SRV_DIMENSION_TEXTURE1DARRAY",
472 "D3D10_SRV_DIMENSION_TEXTURE2D",
473 "D3D10_SRV_DIMENSION_TEXTURE2DARRAY",
474 "D3D10_SRV_DIMENSION_TEXTURE2DMS",
475 "D3D10_SRV_DIMENSION_TEXTURE2DMSARRAY",
476 "D3D10_SRV_DIMENSION_TEXTURE3D",
477 "D3D10_SRV_DIMENSION_TEXTURECUBE",
480 D3D10_BUFFER_SRV = Struct("D3D10_BUFFER_SRV", [
481 (UINT, "FirstElement"),
482 (UINT, "NumElements"),
485 D3D10_TEX1D_SRV = Struct("D3D10_TEX1D_SRV", [
486 (UINT, "MostDetailedMip"),
490 D3D10_TEX1D_ARRAY_SRV = Struct("D3D10_TEX1D_ARRAY_SRV", [
491 (UINT, "MostDetailedMip"),
493 (UINT, "FirstArraySlice"),
497 D3D10_TEX2D_SRV = Struct("D3D10_TEX2D_SRV", [
498 (UINT, "MostDetailedMip"),
502 D3D10_TEX2D_ARRAY_SRV = Struct("D3D10_TEX2D_ARRAY_SRV", [
503 (UINT, "MostDetailedMip"),
505 (UINT, "FirstArraySlice"),
509 D3D10_TEX2DMS_SRV = Struct("D3D10_TEX2DMS_SRV", [
510 (UINT, "UnusedField_NothingToDefine"),
513 D3D10_TEX2DMS_ARRAY_SRV = Struct("D3D10_TEX2DMS_ARRAY_SRV", [
514 (UINT, "FirstArraySlice"),
518 D3D10_TEX3D_SRV = Struct("D3D10_TEX3D_SRV", [
519 (UINT, "MostDetailedMip"),
523 D3D10_TEXCUBE_SRV = Struct("D3D10_TEXCUBE_SRV", [
524 (UINT, "MostDetailedMip"),
528 D3D10_SHADER_RESOURCE_VIEW_DESC = Struct("D3D10_SHADER_RESOURCE_VIEW_DESC", [
529 (DXGI_FORMAT, "Format"),
530 (D3D10_SRV_DIMENSION, "ViewDimension"),
531 (Union("{self}.ViewDimension", [
532 ("D3D10_SRV_DIMENSION_BUFFER", D3D10_BUFFER_SRV, "Buffer"),
533 ("D3D10_SRV_DIMENSION_TEXTURE1D", D3D10_TEX1D_SRV, "Texture1D"),
534 ("D3D10_SRV_DIMENSION_TEXTURE1DARRAY", D3D10_TEX1D_ARRAY_SRV, "Texture1DArray"),
535 ("D3D10_SRV_DIMENSION_TEXTURE2D", D3D10_TEX2D_SRV, "Texture2D"),
536 ("D3D10_SRV_DIMENSION_TEXTURE2DARRAY", D3D10_TEX2D_ARRAY_SRV, "Texture2DArray"),
537 ("D3D10_SRV_DIMENSION_TEXTURE2DMS", D3D10_TEX2DMS_SRV, "Texture2DMS"),
538 ("D3D10_SRV_DIMENSION_TEXTURE2DMSARRAY", D3D10_TEX2DMS_ARRAY_SRV, "Texture2DMSArray"),
539 ("D3D10_SRV_DIMENSION_TEXTURE3D", D3D10_TEX3D_SRV, "Texture3D"),
540 ("D3D10_SRV_DIMENSION_TEXTURECUBE", D3D10_TEXCUBE_SRV, "TextureCube"),
544 D3D10_BOX = Struct("D3D10_BOX", [
553 D3D10_SUBRESOURCE_DATA = Struct("D3D10_SUBRESOURCE_DATA", [
554 (Blob(Const(Void), "_calcSubresourceSize(pDesc, {i}, {self}.SysMemPitch, {self}.SysMemSlicePitch)"), "pSysMem"),
555 (UINT, "SysMemPitch"),
556 (UINT, "SysMemSlicePitch"),
559 D3D10_SO_DECLARATION_ENTRY = Struct("D3D10_SO_DECLARATION_ENTRY", [
560 (LPCSTR, "SemanticName"),
561 (UINT, "SemanticIndex"),
562 (BYTE, "StartComponent"),
563 (BYTE, "ComponentCount"),
564 (BYTE, "OutputSlot"),
567 D3D10_INPUT_CLASSIFICATION = Enum("D3D10_INPUT_CLASSIFICATION", [
568 "D3D10_INPUT_PER_VERTEX_DATA",
569 "D3D10_INPUT_PER_INSTANCE_DATA",
572 D3D10_INPUT_ELEMENT_DESC = Struct("D3D10_INPUT_ELEMENT_DESC", [
573 (LPCSTR, "SemanticName"),
574 (UINT, "SemanticIndex"),
575 (DXGI_FORMAT, "Format"),
577 (UINT, "AlignedByteOffset"),
578 (D3D10_INPUT_CLASSIFICATION, "InputSlotClass"),
579 (UINT, "InstanceDataStepRate"),
582 D3D10_QUERY = Enum("D3D10_QUERY", [
584 "D3D10_QUERY_OCCLUSION",
585 "D3D10_QUERY_TIMESTAMP",
586 "D3D10_QUERY_TIMESTAMP_DISJOINT",
587 "D3D10_QUERY_PIPELINE_STATISTICS",
588 "D3D10_QUERY_OCCLUSION_PREDICATE",
589 "D3D10_QUERY_SO_STATISTICS",
590 "D3D10_QUERY_SO_OVERFLOW_PREDICATE",
593 D3D10_QUERY_MISC_FLAG = Flags(UINT, [
594 "D3D10_QUERY_MISC_PREDICATEHINT",
597 D3D10_QUERY_DESC = Struct("D3D10_QUERY_DESC", [
598 (D3D10_QUERY, "Query"),
599 (D3D10_QUERY_MISC_FLAG, "MiscFlags"),
602 D3D10_RECT = Alias("D3D10_RECT", RECT)
603 D3D10_VIEWPORT = Struct("D3D10_VIEWPORT", [
612 D3D10_MAPPED_TEXTURE2D = Struct("D3D10_MAPPED_TEXTURE2D", [
613 (LinearPointer(Void, "_MappedSize"), "pData"),
617 D3D10_MAPPED_TEXTURE3D = Struct("D3D10_MAPPED_TEXTURE3D", [
618 (LinearPointer(Void, "_MappedSize"), "pData"),
620 (UINT, "DepthPitch"),
623 D3D10_MAP_FLAG = Flags(UINT, [
624 "D3D10_MAP_FLAG_DO_NOT_WAIT",
627 D3D10_CLEAR_FLAG = Flags(UINT, [
629 "D3D10_CLEAR_STENCIL",
632 D3D10_COLOR_WRITE_ENABLE = Flags(UINT, [
633 "D3D10_COLOR_WRITE_ENABLE_ALL",
634 "D3D10_COLOR_WRITE_ENABLE_RED",
635 "D3D10_COLOR_WRITE_ENABLE_GREEN",
636 "D3D10_COLOR_WRITE_ENABLE_BLUE",
637 "D3D10_COLOR_WRITE_ENABLE_ALPHA",
640 D3D10_TEXTURECUBE_FACE = Enum("D3D10_TEXTURECUBE_FACE", [
641 "D3D10_TEXTURECUBE_FACE_POSITIVE_X",
642 "D3D10_TEXTURECUBE_FACE_NEGATIVE_X",
643 "D3D10_TEXTURECUBE_FACE_POSITIVE_Y",
644 "D3D10_TEXTURECUBE_FACE_NEGATIVE_Y",
645 "D3D10_TEXTURECUBE_FACE_POSITIVE_Z",
646 "D3D10_TEXTURECUBE_FACE_NEGATIVE_Z",
649 D3D10_ASYNC_GETDATA_FLAG = Flags(UINT, [
650 "D3D10_ASYNC_GETDATA_DONOTFLUSH",
653 D3D10_FILTER_TYPE = Enum("D3D10_FILTER_TYPE", [
654 "D3D10_FILTER_TYPE_POINT",
655 "D3D10_FILTER_TYPE_LINEAR",
658 D3D10_QUERY_DATA_TIMESTAMP_DISJOINT = Struct("D3D10_QUERY_DATA_TIMESTAMP_DISJOINT", [
659 (UINT64, "Frequency"),
663 D3D10_QUERY_DATA_PIPELINE_STATISTICS = Struct("D3D10_QUERY_DATA_PIPELINE_STATISTICS", [
664 (UINT64, "IAVertices"),
665 (UINT64, "IAPrimitives"),
666 (UINT64, "VSInvocations"),
667 (UINT64, "GSInvocations"),
668 (UINT64, "GSPrimitives"),
669 (UINT64, "CInvocations"),
670 (UINT64, "CPrimitives"),
671 (UINT64, "PSInvocations"),
674 D3D10_QUERY_DATA_SO_STATISTICS = Struct("D3D10_QUERY_DATA_SO_STATISTICS", [
675 (UINT64, "NumPrimitivesWritten"),
676 (UINT64, "PrimitivesStorageNeeded"),
679 D3D10_CREATE_DEVICE_FLAG = Flags(UINT, [
680 "D3D10_CREATE_DEVICE_SINGLETHREADED",
681 "D3D10_CREATE_DEVICE_DEBUG",
682 "D3D10_CREATE_DEVICE_SWITCH_TO_REF",
683 "D3D10_CREATE_DEVICE_PREVENT_INTERNAL_THREADING_OPTIMIZATIONS",
684 "D3D10_CREATE_DEVICE_ALLOW_NULL_FROM_MAP",
685 "D3D10_CREATE_DEVICE_BGRA_SUPPORT",
686 "D3D10_CREATE_DEVICE_STRICT_VALIDATION",
687 "D3D10_CREATE_DEVICE_BGRA_SUPPORT",
688 "D3D10_CREATE_DEVICE_PREVENT_ALTERING_LAYER_SETTINGS_FROM_REGISTRY",
689 "D3D10_CREATE_DEVICE_STRICT_VALIDATION",
690 "D3D10_CREATE_DEVICE_DEBUGGABLE",
693 D3D10_RAISE_FLAG = Flags(UINT, [
694 "D3D10_RAISE_FLAG_DRIVER_INTERNAL_ERROR",
697 ID3D10DeviceChild = Interface("ID3D10DeviceChild", IUnknown)
698 ID3D10Resource = Interface("ID3D10Resource", ID3D10DeviceChild)
699 ID3D10Buffer = Interface("ID3D10Buffer", ID3D10Resource)
700 ID3D10Texture1D = Interface("ID3D10Texture1D", ID3D10Resource)
701 ID3D10Texture2D = Interface("ID3D10Texture2D", ID3D10Resource)
702 ID3D10Texture3D = Interface("ID3D10Texture3D", ID3D10Resource)
703 ID3D10View = Interface("ID3D10View", ID3D10DeviceChild)
704 ID3D10DepthStencilView = Interface("ID3D10DepthStencilView", ID3D10View)
705 ID3D10RenderTargetView = Interface("ID3D10RenderTargetView", ID3D10View)
706 ID3D10ShaderResourceView = Interface("ID3D10ShaderResourceView", ID3D10View)
707 ID3D10BlendState = Interface("ID3D10BlendState", ID3D10DeviceChild)
708 ID3D10DepthStencilState = Interface("ID3D10DepthStencilState", ID3D10DeviceChild)
709 ID3D10GeometryShader = Interface("ID3D10GeometryShader", ID3D10DeviceChild)
710 ID3D10InputLayout = Interface("ID3D10InputLayout", ID3D10DeviceChild)
711 ID3D10PixelShader = Interface("ID3D10PixelShader", ID3D10DeviceChild)
712 ID3D10RasterizerState = Interface("ID3D10RasterizerState", ID3D10DeviceChild)
713 ID3D10SamplerState = Interface("ID3D10SamplerState", ID3D10DeviceChild)
714 ID3D10VertexShader = Interface("ID3D10VertexShader", ID3D10DeviceChild)
715 ID3D10Asynchronous = Interface("ID3D10Asynchronous", ID3D10DeviceChild)
716 ID3D10Counter = Interface("ID3D10Counter", ID3D10Asynchronous)
717 ID3D10Query = Interface("ID3D10Query", ID3D10Asynchronous)
718 ID3D10Predicate = Interface("ID3D10Predicate", ID3D10Query)
719 ID3D10Device = Interface("ID3D10Device", IUnknown)
720 ID3D10Multithread = Interface("ID3D10Multithread", IUnknown)
722 ID3D10DeviceChild.methods += [
723 StdMethod(Void, "GetDevice", [Out(Pointer(ObjPointer(ID3D10Device)), "ppDevice")]),
724 StdMethod(HRESULT, "GetPrivateData", [(REFGUID, "guid"), Out(Pointer(UINT), "pDataSize"), Out(OpaquePointer(Void), "pData")], sideeffects=False),
725 StdMethod(HRESULT, "SetPrivateData", [(REFGUID, "guid"), (UINT, "DataSize"), (OpaqueBlob(Const(Void), "DataSize"), "pData")], sideeffects=False),
726 StdMethod(HRESULT, "SetPrivateDataInterface", [(REFGUID, "guid"), (OpaquePointer(Const(IUnknown)), "pData")], sideeffects=False),
729 ID3D10Resource.methods += [
730 StdMethod(Void, "GetType", [Out(Pointer(D3D10_RESOURCE_DIMENSION), "rType")], sideeffects=False),
731 StdMethod(Void, "SetEvictionPriority", [(UINT, "EvictionPriority")]),
732 StdMethod(UINT, "GetEvictionPriority", [], sideeffects=False),
735 ID3D10Buffer.methods += [
736 StdMethod(HRESULT, "Map", [(D3D10_MAP, "MapType"), (D3D10_MAP_FLAG, "MapFlags"), Out(Pointer(LinearPointer(Void, "_MappedSize")), "ppData")]),
737 StdMethod(Void, "Unmap", []),
738 StdMethod(Void, "GetDesc", [Out(Pointer(D3D10_BUFFER_DESC), "pDesc")], sideeffects=False),
741 ID3D10Texture1D.methods += [
742 StdMethod(HRESULT, "Map", [(UINT, "Subresource"), (D3D10_MAP, "MapType"), (D3D10_MAP_FLAG, "MapFlags"), Out(Pointer(LinearPointer(Void, "_MappedSize")), "ppData")]),
743 StdMethod(Void, "Unmap", [(UINT, "Subresource")]),
744 StdMethod(Void, "GetDesc", [Out(Pointer(D3D10_TEXTURE1D_DESC), "pDesc")], sideeffects=False),
747 ID3D10Texture2D.methods += [
748 StdMethod(HRESULT, "Map", [(UINT, "Subresource"), (D3D10_MAP, "MapType"), (D3D10_MAP_FLAG, "MapFlags"), Out(Pointer(D3D10_MAPPED_TEXTURE2D), "pMappedTex2D")]),
749 StdMethod(Void, "Unmap", [(UINT, "Subresource")]),
750 StdMethod(Void, "GetDesc", [Out(Pointer(D3D10_TEXTURE2D_DESC), "pDesc")], sideeffects=False),
753 ID3D10Texture3D.methods += [
754 StdMethod(HRESULT, "Map", [(UINT, "Subresource"), (D3D10_MAP, "MapType"), (D3D10_MAP_FLAG, "MapFlags"), Out(Pointer(D3D10_MAPPED_TEXTURE3D), "pMappedTex3D")]),
755 StdMethod(Void, "Unmap", [(UINT, "Subresource")]),
756 StdMethod(Void, "GetDesc", [Out(Pointer(D3D10_TEXTURE3D_DESC), "pDesc")], sideeffects=False),
759 ID3D10View.methods += [
760 StdMethod(Void, "GetResource", [Out(Pointer(ObjPointer(ID3D10Resource)), "ppResource")]),
763 ID3D10DepthStencilView.methods += [
764 StdMethod(Void, "GetDesc", [Out(Pointer(D3D10_DEPTH_STENCIL_VIEW_DESC), "pDesc")], sideeffects=False),
767 ID3D10RenderTargetView.methods += [
768 StdMethod(Void, "GetDesc", [Out(Pointer(D3D10_RENDER_TARGET_VIEW_DESC), "pDesc")], sideeffects=False),
771 ID3D10ShaderResourceView.methods += [
772 StdMethod(Void, "GetDesc", [Out(Pointer(D3D10_SHADER_RESOURCE_VIEW_DESC), "pDesc")], sideeffects=False),
775 ID3D10BlendState.methods += [
776 StdMethod(Void, "GetDesc", [Out(Pointer(D3D10_BLEND_DESC), "pDesc")], sideeffects=False),
779 ID3D10DepthStencilState.methods += [
780 StdMethod(Void, "GetDesc", [Out(Pointer(D3D10_DEPTH_STENCIL_DESC), "pDesc")], sideeffects=False),
783 ID3D10RasterizerState.methods += [
784 StdMethod(Void, "GetDesc", [Out(Pointer(D3D10_RASTERIZER_DESC), "pDesc")], sideeffects=False),
787 ID3D10SamplerState.methods += [
788 StdMethod(Void, "GetDesc", [Out(Pointer(D3D10_SAMPLER_DESC), "pDesc")], sideeffects=False),
791 ID3D10Asynchronous.methods += [
792 StdMethod(Void, "Begin", []),
793 StdMethod(Void, "End", []),
794 StdMethod(HRESULT, "GetData", [Out(Blob(Void, "DataSize"), "pData"), (UINT, "DataSize"), (D3D10_ASYNC_GETDATA_FLAG, "GetDataFlags")], sideeffects=False),
795 StdMethod(UINT, "GetDataSize", [], sideeffects=False),
798 ID3D10Counter.methods += [
799 StdMethod(Void, "GetDesc", [Out(Pointer(D3D10_COUNTER_DESC), "pDesc")], sideeffects=False),
802 ID3D10Query.methods += [
803 StdMethod(Void, "GetDesc", [Out(Pointer(D3D10_QUERY_DESC), "pDesc")], sideeffects=False),
806 ID3D10Device.methods += [
807 StdMethod(Void, "VSSetConstantBuffers", [(UINT, "StartSlot"), (UINT, "NumBuffers"), (Array(Const(ObjPointer(ID3D10Buffer)), "NumBuffers"), "ppConstantBuffers")]),
808 StdMethod(Void, "PSSetShaderResources", [(UINT, "StartSlot"), (UINT, "NumViews"), (Array(Const(ObjPointer(ID3D10ShaderResourceView)), "NumViews"), "ppShaderResourceViews")]),
809 StdMethod(Void, "PSSetShader", [(ObjPointer(ID3D10PixelShader), "pPixelShader")]),
810 StdMethod(Void, "PSSetSamplers", [(UINT, "StartSlot"), (UINT, "NumSamplers"), (Array(Const(ObjPointer(ID3D10SamplerState)), "NumSamplers"), "ppSamplers")]),
811 StdMethod(Void, "VSSetShader", [(ObjPointer(ID3D10VertexShader), "pVertexShader")]),
812 StdMethod(Void, "DrawIndexed", [(UINT, "IndexCount"), (UINT, "StartIndexLocation"), (INT, "BaseVertexLocation")]),
813 StdMethod(Void, "Draw", [(UINT, "VertexCount"), (UINT, "StartVertexLocation")]),
814 StdMethod(Void, "PSSetConstantBuffers", [(UINT, "StartSlot"), (UINT, "NumBuffers"), (Array(Const(ObjPointer(ID3D10Buffer)), "NumBuffers"), "ppConstantBuffers")]),
815 StdMethod(Void, "IASetInputLayout", [(ObjPointer(ID3D10InputLayout), "pInputLayout")]),
816 StdMethod(Void, "IASetVertexBuffers", [(UINT, "StartSlot"), (UINT, "NumBuffers"), (Array(Const(ObjPointer(ID3D10Buffer)), "NumBuffers"), "ppVertexBuffers"), (Array(Const(UINT), "NumBuffers"), "pStrides"), (Array(Const(UINT), "NumBuffers"), "pOffsets")]),
817 StdMethod(Void, "IASetIndexBuffer", [(ObjPointer(ID3D10Buffer), "pIndexBuffer"), (DXGI_FORMAT, "Format"), (UINT, "Offset")]),
818 StdMethod(Void, "DrawIndexedInstanced", [(UINT, "IndexCountPerInstance"), (UINT, "InstanceCount"), (UINT, "StartIndexLocation"), (INT, "BaseVertexLocation"), (UINT, "StartInstanceLocation")]),
819 StdMethod(Void, "DrawInstanced", [(UINT, "VertexCountPerInstance"), (UINT, "InstanceCount"), (UINT, "StartVertexLocation"), (UINT, "StartInstanceLocation")]),
820 StdMethod(Void, "GSSetConstantBuffers", [(UINT, "StartSlot"), (UINT, "NumBuffers"), (Array(Const(ObjPointer(ID3D10Buffer)), "NumBuffers"), "ppConstantBuffers")]),
821 StdMethod(Void, "GSSetShader", [(ObjPointer(ID3D10GeometryShader), "pShader")]),
822 StdMethod(Void, "IASetPrimitiveTopology", [(D3D10_PRIMITIVE_TOPOLOGY, "Topology")]),
823 StdMethod(Void, "VSSetShaderResources", [(UINT, "StartSlot"), (UINT, "NumViews"), (Array(Const(ObjPointer(ID3D10ShaderResourceView)), "NumViews"), "ppShaderResourceViews")]),
824 StdMethod(Void, "VSSetSamplers", [(UINT, "StartSlot"), (UINT, "NumSamplers"), (Array(Const(ObjPointer(ID3D10SamplerState)), "NumSamplers"), "ppSamplers")]),
825 StdMethod(Void, "SetPredication", [(ObjPointer(ID3D10Predicate), "pPredicate"), (BOOL, "PredicateValue")]),
826 StdMethod(Void, "GSSetShaderResources", [(UINT, "StartSlot"), (UINT, "NumViews"), (Array(Const(ObjPointer(ID3D10ShaderResourceView)), "NumViews"), "ppShaderResourceViews")]),
827 StdMethod(Void, "GSSetSamplers", [(UINT, "StartSlot"), (UINT, "NumSamplers"), (Array(Const(ObjPointer(ID3D10SamplerState)), "NumSamplers"), "ppSamplers")]),
828 StdMethod(Void, "OMSetRenderTargets", [(UINT, "NumViews"), (Array(Const(ObjPointer(ID3D10RenderTargetView)), "NumViews"), "ppRenderTargetViews"), (ObjPointer(ID3D10DepthStencilView), "pDepthStencilView")]),
829 StdMethod(Void, "OMSetBlendState", [(ObjPointer(ID3D10BlendState), "pBlendState"), (Array(Const(FLOAT), 4), "BlendFactor"), (UINT, "SampleMask")]),
830 StdMethod(Void, "OMSetDepthStencilState", [(ObjPointer(ID3D10DepthStencilState), "pDepthStencilState"), (UINT, "StencilRef")]),
831 StdMethod(Void, "SOSetTargets", [(UINT, "NumBuffers"), (Array(Const(ObjPointer(ID3D10Buffer)), "NumBuffers"), "ppSOTargets"), (Array(Const(UINT), "NumBuffers"), "pOffsets")]),
832 StdMethod(Void, "DrawAuto", []),
833 StdMethod(Void, "RSSetState", [(ObjPointer(ID3D10RasterizerState), "pRasterizerState")]),
834 StdMethod(Void, "RSSetViewports", [(UINT, "NumViewports"), (Array(Const(D3D10_VIEWPORT), "NumViewports"), "pViewports")]),
835 StdMethod(Void, "RSSetScissorRects", [(UINT, "NumRects"), (Array(Const(D3D10_RECT), "NumRects"), "pRects")]),
836 StdMethod(Void, "CopySubresourceRegion", [(ObjPointer(ID3D10Resource), "pDstResource"), (UINT, "DstSubresource"), (UINT, "DstX"), (UINT, "DstY"), (UINT, "DstZ"), (ObjPointer(ID3D10Resource), "pSrcResource"), (UINT, "SrcSubresource"), (Pointer(Const(D3D10_BOX)), "pSrcBox")]),
837 StdMethod(Void, "CopyResource", [(ObjPointer(ID3D10Resource), "pDstResource"), (ObjPointer(ID3D10Resource), "pSrcResource")]),
838 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")]),
839 StdMethod(Void, "ClearRenderTargetView", [(ObjPointer(ID3D10RenderTargetView), "pRenderTargetView"), (Array(Const(FLOAT), 4), "ColorRGBA")]),
840 StdMethod(Void, "ClearDepthStencilView", [(ObjPointer(ID3D10DepthStencilView), "pDepthStencilView"), (D3D10_CLEAR_FLAG, "ClearFlags"), (FLOAT, "Depth"), (UINT8, "Stencil")]),
841 StdMethod(Void, "GenerateMips", [(ObjPointer(ID3D10ShaderResourceView), "pShaderResourceView")]),
842 StdMethod(Void, "ResolveSubresource", [(ObjPointer(ID3D10Resource), "pDstResource"), (UINT, "DstSubresource"), (ObjPointer(ID3D10Resource), "pSrcResource"), (UINT, "SrcSubresource"), (DXGI_FORMAT, "Format")]),
843 StdMethod(Void, "VSGetConstantBuffers", [(UINT, "StartSlot"), (UINT, "NumBuffers"), Out(Array(ObjPointer(ID3D10Buffer), "NumBuffers"), "ppConstantBuffers")]),
844 StdMethod(Void, "PSGetShaderResources", [(UINT, "StartSlot"), (UINT, "NumViews"), Out(Array(ObjPointer(ID3D10ShaderResourceView), "NumViews"), "ppShaderResourceViews")]),
845 StdMethod(Void, "PSGetShader", [Out(Pointer(ObjPointer(ID3D10PixelShader)), "ppPixelShader")]),
846 StdMethod(Void, "PSGetSamplers", [(UINT, "StartSlot"), (UINT, "NumSamplers"), Out(Array(ObjPointer(ID3D10SamplerState), "NumSamplers"), "ppSamplers")]),
847 StdMethod(Void, "VSGetShader", [Out(Pointer(ObjPointer(ID3D10VertexShader)), "ppVertexShader")]),
848 StdMethod(Void, "PSGetConstantBuffers", [(UINT, "StartSlot"), (UINT, "NumBuffers"), Out(Array(ObjPointer(ID3D10Buffer), "NumBuffers"), "ppConstantBuffers")]),
849 StdMethod(Void, "IAGetInputLayout", [Out(Pointer(ObjPointer(ID3D10InputLayout)), "ppInputLayout")]),
850 StdMethod(Void, "IAGetVertexBuffers", [(UINT, "StartSlot"), (UINT, "NumBuffers"), Out(Array(ObjPointer(ID3D10Buffer), "NumBuffers"), "ppVertexBuffers"), Out(Array(UINT, "NumBuffers"), "pStrides"), Out(Array(UINT, "NumBuffers"), "pOffsets")]),
851 StdMethod(Void, "IAGetIndexBuffer", [Out(Pointer(ObjPointer(ID3D10Buffer)), "pIndexBuffer"), Out(Pointer(DXGI_FORMAT), "Format"), Out(Pointer(UINT), "Offset")]),
852 StdMethod(Void, "GSGetConstantBuffers", [(UINT, "StartSlot"), (UINT, "NumBuffers"), Out(Array(ObjPointer(ID3D10Buffer), "NumBuffers"), "ppConstantBuffers")]),
853 StdMethod(Void, "GSGetShader", [Out(Pointer(ObjPointer(ID3D10GeometryShader)), "ppGeometryShader")]),
854 StdMethod(Void, "IAGetPrimitiveTopology", [Out(Pointer(D3D10_PRIMITIVE_TOPOLOGY), "pTopology")], sideeffects=False),
855 StdMethod(Void, "VSGetShaderResources", [(UINT, "StartSlot"), (UINT, "NumViews"), Out(Array(ObjPointer(ID3D10ShaderResourceView), "NumViews"), "ppShaderResourceViews")]),
856 StdMethod(Void, "VSGetSamplers", [(UINT, "StartSlot"), (UINT, "NumSamplers"), Out(Array(ObjPointer(ID3D10SamplerState), "NumSamplers"), "ppSamplers")]),
857 StdMethod(Void, "GetPredication", [Out(Pointer(ObjPointer(ID3D10Predicate)), "ppPredicate"), Out(Pointer(BOOL), "pPredicateValue")]),
858 StdMethod(Void, "GSGetShaderResources", [(UINT, "StartSlot"), (UINT, "NumViews"), Out(Array(ObjPointer(ID3D10ShaderResourceView), "NumViews"), "ppShaderResourceViews")]),
859 StdMethod(Void, "GSGetSamplers", [(UINT, "StartSlot"), (UINT, "NumSamplers"), Out(Array(ObjPointer(ID3D10SamplerState), "NumSamplers"), "ppSamplers")]),
860 StdMethod(Void, "OMGetRenderTargets", [(UINT, "NumViews"), Out(Array(ObjPointer(ID3D10RenderTargetView), "NumViews"), "ppRenderTargetViews"), Out(Pointer(ObjPointer(ID3D10DepthStencilView)), "ppDepthStencilView")]),
861 StdMethod(Void, "OMGetBlendState", [Out(Pointer(ObjPointer(ID3D10BlendState)), "ppBlendState"), Out(Array(FLOAT, 4), "BlendFactor"), Out(Pointer(UINT), "pSampleMask")]),
862 StdMethod(Void, "OMGetDepthStencilState", [Out(Pointer(ObjPointer(ID3D10DepthStencilState)), "ppDepthStencilState"), Out(Pointer(UINT), "pStencilRef")]),
863 StdMethod(Void, "SOGetTargets", [(UINT, "NumBuffers"), Out(Array(ObjPointer(ID3D10Buffer), "NumBuffers"), "ppSOTargets"), Out(Array(UINT, "NumBuffers"), "pOffsets")]),
864 StdMethod(Void, "RSGetState", [Out(Pointer(ObjPointer(ID3D10RasterizerState)), "ppRasterizerState")]),
865 StdMethod(Void, "RSGetViewports", [Out(Pointer(UINT), "NumViewports"), Out(Array(D3D10_VIEWPORT, "*NumViewports"), "pViewports")], sideeffects=False),
866 StdMethod(Void, "RSGetScissorRects", [Out(Pointer(UINT), "NumRects"), Out(Array(D3D10_RECT, "*NumRects"), "pRects")], sideeffects=False),
867 StdMethod(HRESULT, "GetDeviceRemovedReason", [], sideeffects=False),
868 StdMethod(HRESULT, "SetExceptionMode", [(D3D10_RAISE_FLAG, "RaiseFlags")]),
869 StdMethod(D3D10_RAISE_FLAG, "GetExceptionMode", [], sideeffects=False),
870 StdMethod(HRESULT, "GetPrivateData", [(REFGUID, "guid"), Out(Pointer(UINT), "pDataSize"), Out(OpaquePointer(Void), "pData")], sideeffects=False),
871 StdMethod(HRESULT, "SetPrivateData", [(REFGUID, "guid"), (UINT, "DataSize"), (OpaqueBlob(Const(Void), "DataSize"), "pData")], sideeffects=False),
872 StdMethod(HRESULT, "SetPrivateDataInterface", [(REFGUID, "guid"), (OpaquePointer(Const(IUnknown)), "pData")], sideeffects=False),
873 StdMethod(Void, "ClearState", []),
874 StdMethod(Void, "Flush", []),
875 StdMethod(HRESULT, "CreateBuffer", [(Pointer(Const(D3D10_BUFFER_DESC)), "pDesc"), (Array(Const(D3D10_SUBRESOURCE_DATA), "1"), "pInitialData"), Out(Pointer(ObjPointer(ID3D10Buffer)), "ppBuffer")]),
876 StdMethod(HRESULT, "CreateTexture1D", [(Pointer(Const(D3D10_TEXTURE1D_DESC)), "pDesc"), (Array(Const(D3D10_SUBRESOURCE_DATA), "_getNumSubResources(pDesc)"), "pInitialData"), Out(Pointer(ObjPointer(ID3D10Texture1D)), "ppTexture1D")]),
877 StdMethod(HRESULT, "CreateTexture2D", [(Pointer(Const(D3D10_TEXTURE2D_DESC)), "pDesc"), (Array(Const(D3D10_SUBRESOURCE_DATA), "_getNumSubResources(pDesc)"), "pInitialData"), Out(Pointer(ObjPointer(ID3D10Texture2D)), "ppTexture2D")]),
878 StdMethod(HRESULT, "CreateTexture3D", [(Pointer(Const(D3D10_TEXTURE3D_DESC)), "pDesc"), (Array(Const(D3D10_SUBRESOURCE_DATA), "_getNumSubResources(pDesc)"), "pInitialData"), Out(Pointer(ObjPointer(ID3D10Texture3D)), "ppTexture3D")]),
879 StdMethod(HRESULT, "CreateShaderResourceView", [(ObjPointer(ID3D10Resource), "pResource"), (Pointer(Const(D3D10_SHADER_RESOURCE_VIEW_DESC)), "pDesc"), Out(Pointer(ObjPointer(ID3D10ShaderResourceView)), "ppSRView")]),
880 StdMethod(HRESULT, "CreateRenderTargetView", [(ObjPointer(ID3D10Resource), "pResource"), (Pointer(Const(D3D10_RENDER_TARGET_VIEW_DESC)), "pDesc"), Out(Pointer(ObjPointer(ID3D10RenderTargetView)), "ppRTView")]),
881 StdMethod(HRESULT, "CreateDepthStencilView", [(ObjPointer(ID3D10Resource), "pResource"), (Pointer(Const(D3D10_DEPTH_STENCIL_VIEW_DESC)), "pDesc"), Out(Pointer(ObjPointer(ID3D10DepthStencilView)), "ppDepthStencilView")]),
882 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")]),
883 StdMethod(HRESULT, "CreateVertexShader", [(Blob(Const(Void), "BytecodeLength"), "pShaderBytecode"), (SIZE_T, "BytecodeLength"), Out(Pointer(ObjPointer(ID3D10VertexShader)), "ppVertexShader")]),
884 StdMethod(HRESULT, "CreateGeometryShader", [(Blob(Const(Void), "BytecodeLength"), "pShaderBytecode"), (SIZE_T, "BytecodeLength"), Out(Pointer(ObjPointer(ID3D10GeometryShader)), "ppGeometryShader")]),
885 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")]),
886 StdMethod(HRESULT, "CreatePixelShader", [(Blob(Const(Void), "BytecodeLength"), "pShaderBytecode"), (SIZE_T, "BytecodeLength"), Out(Pointer(ObjPointer(ID3D10PixelShader)), "ppPixelShader")]),
887 StdMethod(HRESULT, "CreateBlendState", [(Pointer(Const(D3D10_BLEND_DESC)), "pBlendStateDesc"), Out(Pointer(ObjPointer(ID3D10BlendState)), "ppBlendState")]),
888 StdMethod(HRESULT, "CreateDepthStencilState", [(Pointer(Const(D3D10_DEPTH_STENCIL_DESC)), "pDepthStencilDesc"), Out(Pointer(ObjPointer(ID3D10DepthStencilState)), "ppDepthStencilState")]),
889 StdMethod(HRESULT, "CreateRasterizerState", [(Pointer(Const(D3D10_RASTERIZER_DESC)), "pRasterizerDesc"), Out(Pointer(ObjPointer(ID3D10RasterizerState)), "ppRasterizerState")]),
890 StdMethod(HRESULT, "CreateSamplerState", [(Pointer(Const(D3D10_SAMPLER_DESC)), "pSamplerDesc"), Out(Pointer(ObjPointer(ID3D10SamplerState)), "ppSamplerState")]),
891 StdMethod(HRESULT, "CreateQuery", [(Pointer(Const(D3D10_QUERY_DESC)), "pQueryDesc"), Out(Pointer(ObjPointer(ID3D10Query)), "ppQuery")]),
892 StdMethod(HRESULT, "CreatePredicate", [(Pointer(Const(D3D10_QUERY_DESC)), "pPredicateDesc"), Out(Pointer(ObjPointer(ID3D10Predicate)), "ppPredicate")]),
893 StdMethod(HRESULT, "CreateCounter", [(Pointer(Const(D3D10_COUNTER_DESC)), "pCounterDesc"), Out(Pointer(ObjPointer(ID3D10Counter)), "ppCounter")]),
894 StdMethod(HRESULT, "CheckFormatSupport", [(DXGI_FORMAT, "Format"), Out(Pointer(D3D10_FORMAT_SUPPORT), "pFormatSupport")], sideeffects=False),
895 StdMethod(HRESULT, "CheckMultisampleQualityLevels", [(DXGI_FORMAT, "Format"), (UINT, "SampleCount"), Out(Pointer(UINT), "pNumQualityLevels")], sideeffects=False),
896 StdMethod(Void, "CheckCounterInfo", [Out(Pointer(D3D10_COUNTER_INFO), "pCounterInfo")], sideeffects=False),
897 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),
898 StdMethod(D3D10_CREATE_DEVICE_FLAG, "GetCreationFlags", [], sideeffects=False),
899 StdMethod(HRESULT, "OpenSharedResource", [(HANDLE, "hResource"), (REFIID, "ReturnedInterface"), Out(Pointer(ObjPointer(Void)), "ppResource")]),
900 StdMethod(Void, "SetTextFilterSize", [(UINT, "Width"), (UINT, "Height")]),
901 StdMethod(Void, "GetTextFilterSize", [Out(Pointer(UINT), "pWidth"), Out(Pointer(UINT), "pHeight")], sideeffects=False),
904 ID3D10Multithread.methods += [
905 StdMethod(Void, "Enter", []),
906 StdMethod(Void, "Leave", []),
907 StdMethod(BOOL, "SetMultithreadProtected", [(BOOL, "bMTProtect")]),
908 StdMethod(BOOL, "GetMultithreadProtected", [], sideeffects=False),
912 d3d10 = Module("d3d10")
915 from d3d10sdklayers import *