source: Daodan/MSYS2/mingw32/i686-w64-mingw32/include/d3d12.idl@ 1167

Last change on this file since 1167 was 1166, checked in by rossy, 3 years ago

Daodan: Replace MinGW build env with an up-to-date MSYS2 env

File size: 80.1 KB
Line 
1/*
2 * Copyright 2016 Józef Kucia for CodeWeavers
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17 */
18
19import "oaidl.idl";
20import "ocidl.idl";
21import "dxgi.idl";
22import "d3dcommon.idl";
23
24cpp_quote("#ifndef _D3D12_CONSTANTS")
25cpp_quote("#define _D3D12_CONSTANTS")
26
27const UINT D3D12_CS_TGSM_REGISTER_COUNT = 8192;
28const UINT D3D12_MAX_ROOT_COST = 64;
29const UINT D3D12_VIEWPORT_BOUNDS_MAX = 32767;
30const UINT D3D12_VIEWPORT_BOUNDS_MIN = -32768;
31
32const UINT D3D12_COMMONSHADER_CONSTANT_BUFFER_REGISTER_COUNT = 15;
33
34const UINT D3D12_APPEND_ALIGNED_ELEMENT = 0xffffffff;
35cpp_quote("#define D3D12_DEFAULT_BLEND_FACTOR_ALPHA (1.0f)")
36cpp_quote("#define D3D12_DEFAULT_BLEND_FACTOR_BLUE (1.0f)")
37cpp_quote("#define D3D12_DEFAULT_BLEND_FACTOR_GREEN (1.0f)")
38cpp_quote("#define D3D12_DEFAULT_BLEND_FACTOR_RED (1.0f)")
39const UINT D3D12_DEFAULT_DEPTH_BIAS = 0;
40cpp_quote("#define D3D12_DEFAULT_DEPTH_BIAS_CLAMP (0.0f)")
41cpp_quote("#define D3D12_DEFAULT_SLOPE_SCALED_DEPTH_BIAS (0.0f)")
42const UINT D3D12_DEFAULT_STENCIL_READ_MASK = 0xff;
43const UINT D3D12_DEFAULT_STENCIL_WRITE_MASK = 0xff;
44const UINT D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND = 0xffffffff;
45cpp_quote("#define D3D12_FLOAT32_MAX (3.402823466e+38f)")
46const UINT D3D12_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT = 32;
47const UINT D3D12_UAV_SLOT_COUNT = 64;
48const UINT D3D12_REQ_CONSTANT_BUFFER_ELEMENT_COUNT = 4096;
49const UINT D3D12_REQ_IMMEDIATE_CONSTANT_BUFFER_ELEMENT_COUNT = 4096;
50const UINT D3D12_REQ_MIP_LEVELS = 15;
51const UINT D3D12_REQ_TEXTURE1D_ARRAY_AXIS_DIMENSION = 2048;
52const UINT D3D12_REQ_TEXTURE1D_U_DIMENSION = 16384;
53const UINT D3D12_REQ_TEXTURE2D_ARRAY_AXIS_DIMENSION = 2048;
54const UINT D3D12_REQ_TEXTURE2D_U_OR_V_DIMENSION = 16384;
55const UINT D3D12_REQ_TEXTURE3D_U_V_OR_W_DIMENSION = 2048;
56const UINT D3D12_REQ_TEXTURECUBE_DIMENSION = 16384;
57const UINT D3D12_RESOURCE_BARRIER_ALL_SUBRESOURCES = 0xffffffff;
58const UINT D3D12_SIMULTANEOUS_RENDER_TARGET_COUNT = 8;
59const UINT D3D12_SO_BUFFER_MAX_STRIDE_IN_BYTES = 2048;
60const UINT D3D12_SO_BUFFER_SLOT_COUNT = 4;
61const UINT D3D12_SO_DDI_REGISTER_INDEX_DENOTING_GAP = 0xffffffff;
62const UINT D3D12_SO_NO_RASTERIZED_STREAM = 0xffffffff;
63const UINT D3D12_SO_OUTPUT_COMPONENT_COUNT = 128;
64const UINT D3D12_SO_STREAM_COUNT = 4;
65const UINT D3D12_CONSTANT_BUFFER_DATA_PLACEMENT_ALIGNMENT = 256;
66const UINT D3D12_DEFAULT_MSAA_RESOURCE_PLACEMENT_ALIGNMENT = 4194304;
67const UINT D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT = 65536;
68const UINT D3D12_RAW_UAV_SRV_BYTE_ALIGNMENT = 16;
69const UINT D3D12_SMALL_MSAA_RESOURCE_PLACEMENT_ALIGNMENT = 65536;
70const UINT D3D12_SMALL_RESOURCE_PLACEMENT_ALIGNMENT = 4096;
71const UINT D3D12_STANDARD_MAXIMUM_ELEMENT_ALIGNMENT_BYTE_MULTIPLE = 4;
72const UINT D3D12_TEXTURE_DATA_PITCH_ALIGNMENT = 256;
73const UINT D3D12_TEXTURE_DATA_PLACEMENT_ALIGNMENT = 512;
74const UINT D3D12_UAV_COUNTER_PLACEMENT_ALIGNMENT = 4096;
75const UINT D3D12_VS_INPUT_REGISTER_COUNT = 32;
76const UINT D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE = 16;
77
78cpp_quote("#endif")
79
80const UINT D3D12_SHADER_COMPONENT_MAPPING_MASK = 0x7;
81const UINT D3D12_SHADER_COMPONENT_MAPPING_SHIFT = 3;
82const UINT D3D12_SHADER_COMPONENT_MAPPING_ALWAYS_SET_BIT_AVOIDING_ZEROMEM_MISTAKES
83 = 1 << (D3D12_SHADER_COMPONENT_MAPPING_SHIFT * 4);
84
85typedef enum D3D12_SHADER_MIN_PRECISION_SUPPORT
86{
87 D3D12_SHADER_MIN_PRECISION_SUPPORT_NONE = 0x0,
88 D3D12_SHADER_MIN_PRECISION_SUPPORT_10_BIT = 0x1,
89 D3D12_SHADER_MIN_PRECISION_SUPPORT_16_BIT = 0x2,
90} D3D12_SHADER_MIN_PRECISION_SUPPORT;
91cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_SHADER_MIN_PRECISION_SUPPORT);")
92
93typedef enum D3D12_TILED_RESOURCES_TIER
94{
95 D3D12_TILED_RESOURCES_TIER_NOT_SUPPORTED = 0,
96 D3D12_TILED_RESOURCES_TIER_1 = 1,
97 D3D12_TILED_RESOURCES_TIER_2 = 2,
98 D3D12_TILED_RESOURCES_TIER_3 = 3,
99} D3D12_TILED_RESOURCES_TIER;
100
101typedef enum D3D12_RESOURCE_BINDING_TIER
102{
103 D3D12_RESOURCE_BINDING_TIER_1 = 1,
104 D3D12_RESOURCE_BINDING_TIER_2 = 2,
105 D3D12_RESOURCE_BINDING_TIER_3 = 3,
106} D3D12_RESOURCE_BINDING_TIER;
107
108typedef enum D3D12_CONSERVATIVE_RASTERIZATION_TIER
109{
110 D3D12_CONSERVATIVE_RASTERIZATION_TIER_NOT_SUPPORTED = 0,
111 D3D12_CONSERVATIVE_RASTERIZATION_TIER_1 = 1,
112 D3D12_CONSERVATIVE_RASTERIZATION_TIER_2 = 2,
113 D3D12_CONSERVATIVE_RASTERIZATION_TIER_3 = 3,
114} D3D12_CONSERVATIVE_RASTERIZATION_TIER;
115
116typedef enum D3D12_CROSS_NODE_SHARING_TIER
117{
118 D3D12_CROSS_NODE_SHARING_TIER_NOT_SUPPORTED = 0,
119 D3D12_CROSS_NODE_SHARING_TIER_1_EMULATED = 1,
120 D3D12_CROSS_NODE_SHARING_TIER_1 = 2,
121 D3D12_CROSS_NODE_SHARING_TIER_2 = 3,
122} D3D12_CROSS_NODE_SHARING_TIER;
123
124typedef enum D3D12_RESOURCE_HEAP_TIER
125{
126 D3D12_RESOURCE_HEAP_TIER_1 = 1,
127 D3D12_RESOURCE_HEAP_TIER_2 = 2,
128} D3D12_RESOURCE_HEAP_TIER;
129
130typedef enum D3D12_FORMAT_SUPPORT1
131{
132 D3D12_FORMAT_SUPPORT1_NONE = 0x00000000,
133 D3D12_FORMAT_SUPPORT1_BUFFER = 0x00000001,
134 D3D12_FORMAT_SUPPORT1_IA_VERTEX_BUFFER = 0x00000002,
135 D3D12_FORMAT_SUPPORT1_IA_INDEX_BUFFER = 0x00000004,
136 D3D12_FORMAT_SUPPORT1_SO_BUFFER = 0x00000008,
137 D3D12_FORMAT_SUPPORT1_TEXTURE1D = 0x00000010,
138 D3D12_FORMAT_SUPPORT1_TEXTURE2D = 0x00000020,
139 D3D12_FORMAT_SUPPORT1_TEXTURE3D = 0x00000040,
140 D3D12_FORMAT_SUPPORT1_TEXTURECUBE = 0x00000080,
141 D3D12_FORMAT_SUPPORT1_SHADER_LOAD = 0x00000100,
142 D3D12_FORMAT_SUPPORT1_SHADER_SAMPLE = 0x00000200,
143 D3D12_FORMAT_SUPPORT1_SHADER_SAMPLE_COMPARISON = 0x00000400,
144 D3D12_FORMAT_SUPPORT1_SHADER_SAMPLE_MONO_TEXT = 0x00000800,
145 D3D12_FORMAT_SUPPORT1_MIP = 0x00001000,
146 D3D12_FORMAT_SUPPORT1_RENDER_TARGET = 0x00004000,
147 D3D12_FORMAT_SUPPORT1_BLENDABLE = 0x00008000,
148 D3D12_FORMAT_SUPPORT1_DEPTH_STENCIL = 0x00010000,
149 D3D12_FORMAT_SUPPORT1_MULTISAMPLE_RESOLVE = 0x00040000,
150 D3D12_FORMAT_SUPPORT1_DISPLAY = 0x00080000,
151 D3D12_FORMAT_SUPPORT1_CAST_WITHIN_BIT_LAYOUT = 0x00100000,
152 D3D12_FORMAT_SUPPORT1_MULTISAMPLE_RENDERTARGET = 0x00200000,
153 D3D12_FORMAT_SUPPORT1_MULTISAMPLE_LOAD = 0x00400000,
154 D3D12_FORMAT_SUPPORT1_SHADER_GATHER = 0x00800000,
155 D3D12_FORMAT_SUPPORT1_BACK_BUFFER_CAST = 0x01000000,
156 D3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW = 0x02000000,
157 D3D12_FORMAT_SUPPORT1_SHADER_GATHER_COMPARISON = 0x04000000,
158 D3D12_FORMAT_SUPPORT1_DECODER_OUTPUT = 0x08000000,
159 D3D12_FORMAT_SUPPORT1_VIDEO_PROCESSOR_OUTPUT = 0x10000000,
160 D3D12_FORMAT_SUPPORT1_VIDEO_PROCESSOR_INPUT = 0x20000000,
161 D3D12_FORMAT_SUPPORT1_VIDEO_ENCODER = 0x40000000,
162} D3D12_FORMAT_SUPPORT1;
163cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_FORMAT_SUPPORT1);")
164
165typedef enum D3D12_FORMAT_SUPPORT2
166{
167 D3D12_FORMAT_SUPPORT2_NONE = 0x00000000,
168 D3D12_FORMAT_SUPPORT2_UAV_ATOMIC_ADD = 0x00000001,
169 D3D12_FORMAT_SUPPORT2_UAV_ATOMIC_BITWISE_OPS = 0x00000002,
170 D3D12_FORMAT_SUPPORT2_UAV_ATOMIC_COMPARE_STORE_OR_COMPARE_EXCHANGE = 0x00000004,
171 D3D12_FORMAT_SUPPORT2_UAV_ATOMIC_EXCHANGE = 0x00000008,
172 D3D12_FORMAT_SUPPORT2_UAV_ATOMIC_SIGNED_MIN_OR_MAX = 0x00000010,
173 D3D12_FORMAT_SUPPORT2_UAV_ATOMIC_UNSIGNED_MIN_OR_MAX = 0x00000020,
174 D3D12_FORMAT_SUPPORT2_UAV_TYPED_LOAD = 0x00000040,
175 D3D12_FORMAT_SUPPORT2_UAV_TYPED_STORE = 0x00000080,
176 D3D12_FORMAT_SUPPORT2_OUTPUT_MERGER_LOGIC_OP = 0x00000100,
177 D3D12_FORMAT_SUPPORT2_TILED = 0x00000200,
178 D3D12_FORMAT_SUPPORT2_MULTIPLANE_OVERLAY = 0x00004000,
179} D3D12_FORMAT_SUPPORT2;
180cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_FORMAT_SUPPORT2);")
181
182typedef enum D3D12_WRITEBUFFERIMMEDIATE_MODE
183{
184 D3D12_WRITEBUFFERIMMEDIATE_MODE_DEFAULT = 0x0,
185 D3D12_WRITEBUFFERIMMEDIATE_MODE_MARKER_IN = 0x1,
186 D3D12_WRITEBUFFERIMMEDIATE_MODE_MARKER_OUT = 0x2,
187} D3D12_WRITEBUFFERIMMEDIATE_MODE;
188
189typedef enum D3D12_PROGRAMMABLE_SAMPLE_POSITIONS_TIER
190{
191 D3D12_PROGRAMMABLE_SAMPLE_POSITIONS_TIER_NOT_SUPPORTED = 0x0,
192 D3D12_PROGRAMMABLE_SAMPLE_POSITIONS_TIER_1 = 0x1,
193 D3D12_PROGRAMMABLE_SAMPLE_POSITIONS_TIER_2 = 0x2,
194} D3D12_PROGRAMMABLE_SAMPLE_POSITIONS_TIER;
195
196typedef enum D3D12_SHADER_CACHE_SUPPORT_FLAGS
197{
198 D3D12_SHADER_CACHE_SUPPORT_NONE = 0x0,
199 D3D12_SHADER_CACHE_SUPPORT_SINGLE_PSO = 0x1,
200 D3D12_SHADER_CACHE_SUPPORT_LIBRARY = 0x2,
201 D3D12_SHADER_CACHE_SUPPORT_AUTOMATIC_INPROC_CACHE = 0x4,
202 D3D12_SHADER_CACHE_SUPPORT_AUTOMATIC_DISK_CACHE = 0x8,
203} D3D12_SHADER_CACHE_SUPPORT_FLAGS;
204cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_SHADER_CACHE_SUPPORT_FLAGS);")
205
206typedef enum D3D12_COMMAND_LIST_SUPPORT_FLAGS
207{
208 D3D12_COMMAND_LIST_SUPPORT_FLAG_NONE = 0x0,
209 D3D12_COMMAND_LIST_SUPPORT_FLAG_DIRECT = 0x1,
210 D3D12_COMMAND_LIST_SUPPORT_FLAG_BUNDLE = 0x2,
211 D3D12_COMMAND_LIST_SUPPORT_FLAG_COMPUTE = 0x4,
212 D3D12_COMMAND_LIST_SUPPORT_FLAG_COPY = 0x8,
213 D3D12_COMMAND_LIST_SUPPORT_FLAG_VIDEO_DECODE = 0x10,
214 D3D12_COMMAND_LIST_SUPPORT_FLAG_VIDEO_PROCESS = 0x20,
215 D3D12_COMMAND_LIST_SUPPORT_FLAG_VIDEO_ENCODE = 0x40,
216} D3D12_COMMAND_LIST_SUPPORT_FLAGS;
217cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_COMMAND_LIST_SUPPORT_FLAGS);")
218
219typedef enum D3D12_VIEW_INSTANCING_TIER
220{
221 D3D12_VIEW_INSTANCING_TIER_NOT_SUPPORTED = 0x0,
222 D3D12_VIEW_INSTANCING_TIER_1 = 0x1,
223 D3D12_VIEW_INSTANCING_TIER_2 = 0x2,
224 D3D12_VIEW_INSTANCING_TIER_3 = 0x3,
225} D3D12_VIEW_INSTANCING_TIER;
226
227typedef enum D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER
228{
229 D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER_0 = 0x0,
230 D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER_1 = 0x1,
231} D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER;
232
233typedef enum D3D12_HEAP_SERIALIZATION_TIER
234{
235 D3D12_HEAP_SERIALIZATION_TIER_0 = 0x0,
236 D3D12_HEAP_SERIALIZATION_TIER_10 = 0xa,
237} D3D12_HEAP_SERIALIZATION_TIER;
238
239typedef enum D3D12_RENDER_PASS_TIER
240{
241 D3D12_RENDER_PASS_TIER_0 = 0x0,
242 D3D12_RENDER_PASS_TIER_1 = 0x1,
243 D3D12_RENDER_PASS_TIER_2 = 0x2,
244} D3D12_RENDER_PASS_TIER;
245
246typedef enum D3D12_RAYTRACING_TIER
247{
248 D3D12_RAYTRACING_TIER_NOT_SUPPORTED = 0x0,
249 D3D12_RAYTRACING_TIER_1_0 = 0xa,
250} D3D12_RAYTRACING_TIER;
251
252interface ID3D12Fence;
253interface ID3D12RootSignature;
254interface ID3D12Heap;
255interface ID3D12DescriptorHeap;
256interface ID3D12Resource;
257interface ID3D12CommandAllocator;
258interface ID3D12GraphicsCommandList;
259interface ID3D12CommandQueue;
260interface ID3D12PipelineState;
261interface ID3D12Device;
262
263typedef RECT D3D12_RECT;
264
265typedef struct D3D12_BOX
266{
267 UINT left;
268 UINT top;
269 UINT front;
270 UINT right;
271 UINT bottom;
272 UINT back;
273} D3D12_BOX;
274
275typedef struct D3D12_VIEWPORT
276{
277 FLOAT TopLeftX;
278 FLOAT TopLeftY;
279 FLOAT Width;
280 FLOAT Height;
281 FLOAT MinDepth;
282 FLOAT MaxDepth;
283} D3D12_VIEWPORT;
284
285typedef struct D3D12_RANGE
286{
287 SIZE_T Begin;
288 SIZE_T End;
289} D3D12_RANGE;
290
291typedef struct D3D12_RANGE_UINT64
292{
293 UINT64 Begin;
294 UINT64 End;
295} D3D12_RANGE_UINT64;
296
297typedef struct D3D12_SUBRESOURCE_RANGE_UINT64
298{
299 UINT Subresource;
300 D3D12_RANGE_UINT64 Range;
301} D3D12_SUBRESOURCE_RANGE_UINT64;
302
303typedef struct D3D12_RESOURCE_ALLOCATION_INFO
304{
305 UINT64 SizeInBytes;
306 UINT64 Alignment;
307} D3D12_RESOURCE_ALLOCATION_INFO;
308
309typedef struct D3D12_DRAW_ARGUMENTS
310{
311 UINT VertexCountPerInstance;
312 UINT InstanceCount;
313 UINT StartVertexLocation;
314 UINT StartInstanceLocation;
315} D3D12_DRAW_ARGUMENTS;
316
317typedef struct D3D12_DRAW_INDEXED_ARGUMENTS
318{
319 UINT IndexCountPerInstance;
320 UINT InstanceCount;
321 UINT StartIndexLocation;
322 INT BaseVertexLocation;
323 UINT StartInstanceLocation;
324} D3D12_DRAW_INDEXED_ARGUMENTS;
325
326typedef struct D3D12_DISPATCH_ARGUMENTS
327{
328 UINT ThreadGroupCountX;
329 UINT ThreadGroupCountY;
330 UINT ThreadGroupCountZ;
331} D3D12_DISPATCH_ARGUMENTS;
332
333typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS
334{
335 BOOL DoublePrecisionFloatShaderOps;
336 BOOL OutputMergerLogicOp;
337 D3D12_SHADER_MIN_PRECISION_SUPPORT MinPrecisionSupport;
338 D3D12_TILED_RESOURCES_TIER TiledResourcesTier;
339 D3D12_RESOURCE_BINDING_TIER ResourceBindingTier;
340 BOOL PSSpecifiedStencilRefSupported;
341 BOOL TypedUAVLoadAdditionalFormats;
342 BOOL ROVsSupported;
343 D3D12_CONSERVATIVE_RASTERIZATION_TIER ConservativeRasterizationTier;
344 UINT MaxGPUVirtualAddressBitsPerResource;
345 BOOL StandardSwizzle64KBSupported;
346 D3D12_CROSS_NODE_SHARING_TIER CrossNodeSharingTier;
347 BOOL CrossAdapterRowMajorTextureSupported;
348 BOOL VPAndRTArrayIndexFromAnyShaderFeedingRasterizerSupportedWithoutGSEmulation;
349 D3D12_RESOURCE_HEAP_TIER ResourceHeapTier;
350} D3D12_FEATURE_DATA_D3D12_OPTIONS;
351
352typedef struct D3D12_FEATURE_DATA_FORMAT_SUPPORT
353{
354 DXGI_FORMAT Format;
355 D3D12_FORMAT_SUPPORT1 Support1;
356 D3D12_FORMAT_SUPPORT2 Support2;
357} D3D12_FEATURE_DATA_FORMAT_SUPPORT;
358
359typedef enum D3D12_MULTISAMPLE_QUALITY_LEVEL_FLAGS
360{
361 D3D12_MULTISAMPLE_QUALITY_LEVELS_FLAG_NONE = 0x00000000,
362 D3D12_MULTISAMPLE_QUALITY_LEVELS_FLAG_TILED_RESOURCE = 0x00000001,
363} D3D12_MULTISAMPLE_QUALITY_LEVEL_FLAGS;
364cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_MULTISAMPLE_QUALITY_LEVEL_FLAGS);")
365
366typedef struct D3D12_FEATURE_DATA_MULTISAMPLE_QUALITY_LEVELS
367{
368 DXGI_FORMAT Format;
369 UINT SampleCount;
370 D3D12_MULTISAMPLE_QUALITY_LEVEL_FLAGS Flags;
371 UINT NumQualityLevels;
372} D3D12_FEATURE_DATA_MULTISAMPLE_QUALITY_LEVELS;
373
374typedef enum D3D12_HEAP_TYPE
375{
376 D3D12_HEAP_TYPE_DEFAULT = 1,
377 D3D12_HEAP_TYPE_UPLOAD = 2,
378 D3D12_HEAP_TYPE_READBACK = 3,
379 D3D12_HEAP_TYPE_CUSTOM = 4,
380} D3D12_HEAP_TYPE;
381
382typedef enum D3D12_CPU_PAGE_PROPERTY
383{
384 D3D12_CPU_PAGE_PROPERTY_UNKNOWN = 0,
385 D3D12_CPU_PAGE_PROPERTY_NOT_AVAILABLE = 1,
386 D3D12_CPU_PAGE_PROPERTY_WRITE_COMBINE = 2,
387 D3D12_CPU_PAGE_PROPERTY_WRITE_BACK = 3,
388} D3D12_CPU_PAGE_PROPERTY;
389
390typedef enum D3D12_MEMORY_POOL
391{
392 D3D12_MEMORY_POOL_UNKNOWN = 0,
393 D3D12_MEMORY_POOL_L0 = 1,
394 D3D12_MEMORY_POOL_L1 = 2,
395} D3D12_MEMORY_POOL;
396
397typedef struct D3D12_HEAP_PROPERTIES
398{
399 D3D12_HEAP_TYPE Type;
400 D3D12_CPU_PAGE_PROPERTY CPUPageProperty;
401 D3D12_MEMORY_POOL MemoryPoolPreference;
402 UINT CreationNodeMask;
403 UINT VisibleNodeMask;
404} D3D12_HEAP_PROPERTIES;
405
406typedef enum D3D12_HEAP_FLAGS
407{
408 D3D12_HEAP_FLAG_NONE = 0x00,
409 D3D12_HEAP_FLAG_SHARED = 0x01,
410 D3D12_HEAP_FLAG_DENY_BUFFERS = 0x04,
411 D3D12_HEAP_FLAG_ALLOW_DISPLAY = 0x08,
412 D3D12_HEAP_FLAG_SHARED_CROSS_ADAPTER = 0x20,
413 D3D12_HEAP_FLAG_DENY_RT_DS_TEXTURES = 0x40,
414 D3D12_HEAP_FLAG_DENY_NON_RT_DS_TEXTURES = 0x80,
415 D3D12_HEAP_FLAG_ALLOW_ALL_BUFFERS_AND_TEXTURES = 0x00,
416 D3D12_HEAP_FLAG_ALLOW_ONLY_BUFFERS = 0xc0,
417 D3D12_HEAP_FLAG_ALLOW_ONLY_NON_RT_DS_TEXTURES = 0x44,
418 D3D12_HEAP_FLAG_ALLOW_ONLY_RT_DS_TEXTURES = 0x84,
419} D3D12_HEAP_FLAGS;
420cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_HEAP_FLAGS);")
421
422typedef struct D3D12_HEAP_DESC
423{
424 UINT64 SizeInBytes;
425 D3D12_HEAP_PROPERTIES Properties;
426 UINT64 Alignment;
427 D3D12_HEAP_FLAGS Flags;
428} D3D12_HEAP_DESC;
429
430typedef struct D3D12_TILED_RESOURCE_COORDINATE
431{
432 UINT X;
433 UINT Y;
434 UINT Z;
435 UINT Subresource;
436} D3D12_TILED_RESOURCE_COORDINATE;
437
438typedef struct D3D12_TILE_REGION_SIZE
439{
440 UINT NumTiles;
441 BOOL UseBox;
442 UINT Width;
443 UINT16 Height;
444 UINT16 Depth;
445} D3D12_TILE_REGION_SIZE;
446
447typedef struct D3D12_SUBRESOURCE_TILING
448{
449 UINT WidthInTiles;
450 UINT16 HeightInTiles;
451 UINT16 DepthInTiles;
452 UINT StartTileIndexInOverallResource;
453} D3D12_SUBRESOURCE_TILING;
454
455typedef struct D3D12_TILE_SHAPE
456{
457 UINT WidthInTexels;
458 UINT HeightInTexels;
459 UINT DepthInTexels;
460} D3D12_TILE_SHAPE;
461
462typedef struct D3D12_SHADER_BYTECODE
463{
464 const void *pShaderBytecode;
465 SIZE_T BytecodeLength;
466} D3D12_SHADER_BYTECODE;
467
468typedef struct D3D12_DEPTH_STENCIL_VALUE
469{
470 FLOAT Depth;
471 UINT8 Stencil;
472} D3D12_DEPTH_STENCIL_VALUE;
473
474typedef struct D3D12_CLEAR_VALUE
475{
476 DXGI_FORMAT Format;
477 union
478 {
479 FLOAT Color[4];
480 D3D12_DEPTH_STENCIL_VALUE DepthStencil;
481 };
482} D3D12_CLEAR_VALUE;
483
484typedef struct D3D12_PACKED_MIP_INFO
485{
486 UINT8 NumStandardMips;
487 UINT8 NumPackedMips;
488 UINT NumTilesForPackedMips;
489 UINT StartTileIndexInOverallResource;
490} D3D12_PACKED_MIP_INFO;
491
492typedef enum D3D12_RESOURCE_STATES
493{
494 D3D12_RESOURCE_STATE_COMMON = 0,
495 D3D12_RESOURCE_STATE_VERTEX_AND_CONSTANT_BUFFER = 0x1,
496 D3D12_RESOURCE_STATE_INDEX_BUFFER = 0x2,
497 D3D12_RESOURCE_STATE_RENDER_TARGET = 0x4,
498 D3D12_RESOURCE_STATE_UNORDERED_ACCESS = 0x8,
499 D3D12_RESOURCE_STATE_DEPTH_WRITE = 0x10,
500 D3D12_RESOURCE_STATE_DEPTH_READ = 0x20,
501 D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE = 0x40,
502 D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE = 0x80,
503 D3D12_RESOURCE_STATE_STREAM_OUT = 0x100,
504 D3D12_RESOURCE_STATE_INDIRECT_ARGUMENT = 0x200,
505 D3D12_RESOURCE_STATE_COPY_DEST = 0x400,
506 D3D12_RESOURCE_STATE_COPY_SOURCE = 0x800,
507 D3D12_RESOURCE_STATE_RESOLVE_DEST = 0x1000,
508 D3D12_RESOURCE_STATE_RESOLVE_SOURCE = 0x2000,
509 D3D12_RESOURCE_STATE_GENERIC_READ = 0x1 | 0x2 | 0x40 | 0x80 | 0x200 | 0x800,
510 D3D12_RESOURCE_STATE_PRESENT = 0x0,
511 D3D12_RESOURCE_STATE_PREDICATION = 0x200,
512 D3D12_RESOURCE_STATE_VIDEO_DECODE_READ = 0x10000,
513 D3D12_RESOURCE_STATE_VIDEO_DECODE_WRITE = 0x20000,
514 D3D12_RESOURCE_STATE_VIDEO_PROCESS_READ = 0x40000,
515 D3D12_RESOURCE_STATE_VIDEO_PROCESS_WRITE = 0x80000,
516 D3D12_RESOURCE_STATE_VIDEO_ENCODE_READ = 0x200000,
517 D3D12_RESOURCE_STATE_VIDEO_ENCODE_WRITE = 0x800000,
518} D3D12_RESOURCE_STATES;
519cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_RESOURCE_STATES);")
520
521typedef enum D3D12_RESOURCE_BARRIER_TYPE
522{
523 D3D12_RESOURCE_BARRIER_TYPE_TRANSITION = 0,
524 D3D12_RESOURCE_BARRIER_TYPE_ALIASING = 1,
525 D3D12_RESOURCE_BARRIER_TYPE_UAV = 2,
526} D3D12_RESOURCE_BARRIER_TYPE;
527
528typedef enum D3D12_RESOURCE_BARRIER_FLAGS
529{
530 D3D12_RESOURCE_BARRIER_FLAG_NONE = 0x0,
531 D3D12_RESOURCE_BARRIER_FLAG_BEGIN_ONLY = 0x1,
532 D3D12_RESOURCE_BARRIER_FLAG_END_ONLY = 0x2,
533} D3D12_RESOURCE_BARRIER_FLAGS;
534cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_RESOURCE_BARRIER_FLAGS);")
535
536typedef struct D3D12_RESOURCE_TRANSITION_BARRIER
537{
538 ID3D12Resource *pResource;
539 UINT Subresource;
540 D3D12_RESOURCE_STATES StateBefore;
541 D3D12_RESOURCE_STATES StateAfter;
542} D3D12_RESOURCE_TRANSITION_BARRIER;
543
544typedef struct D3D12_RESOURCE_ALIASING_BARRIER_ALIASING
545{
546 ID3D12Resource *pResourceBefore;
547 ID3D12Resource *pResourceAfter;
548} D3D12_RESOURCE_ALIASING_BARRIER;
549
550typedef struct D3D12_RESOURCE_UAV_BARRIER
551{
552 ID3D12Resource *pResource;
553} D3D12_RESOURCE_UAV_BARRIER;
554
555typedef struct D3D12_RESOURCE_BARRIER
556{
557 D3D12_RESOURCE_BARRIER_TYPE Type;
558 D3D12_RESOURCE_BARRIER_FLAGS Flags;
559 union
560 {
561 D3D12_RESOURCE_TRANSITION_BARRIER Transition;
562 D3D12_RESOURCE_ALIASING_BARRIER Aliasing;
563 D3D12_RESOURCE_UAV_BARRIER UAV;
564 };
565} D3D12_RESOURCE_BARRIER;
566
567typedef enum D3D12_RESOURCE_DIMENSION
568{
569 D3D12_RESOURCE_DIMENSION_UNKNOWN = 0,
570 D3D12_RESOURCE_DIMENSION_BUFFER = 1,
571 D3D12_RESOURCE_DIMENSION_TEXTURE1D = 2,
572 D3D12_RESOURCE_DIMENSION_TEXTURE2D = 3,
573 D3D12_RESOURCE_DIMENSION_TEXTURE3D = 4,
574} D3D12_RESOURCE_DIMENSION;
575
576typedef enum D3D12_TEXTURE_LAYOUT
577{
578 D3D12_TEXTURE_LAYOUT_UNKNOWN = 0,
579 D3D12_TEXTURE_LAYOUT_ROW_MAJOR = 1,
580 D3D12_TEXTURE_LAYOUT_64KB_UNDEFINED_SWIZZLE = 2,
581 D3D12_TEXTURE_LAYOUT_64KB_STANDARD_SWIZZLE = 3,
582} D3D12_TEXTURE_LAYOUT;
583
584typedef enum D3D12_RESOURCE_FLAGS
585{
586 D3D12_RESOURCE_FLAG_NONE = 0x0,
587 D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET = 0x1,
588 D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL = 0x2,
589 D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS = 0x4,
590 D3D12_RESOURCE_FLAG_DENY_SHADER_RESOURCE = 0x8,
591 D3D12_RESOURCE_FLAG_ALLOW_CROSS_ADAPTER = 0x10,
592 D3D12_RESOURCE_FLAG_ALLOW_SIMULTANEOUS_ACCESS = 0x20,
593} D3D12_RESOURCE_FLAGS;
594cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_RESOURCE_FLAGS);")
595
596typedef struct D3D12_RESOURCE_DESC
597{
598 D3D12_RESOURCE_DIMENSION Dimension;
599 UINT64 Alignment;
600 UINT64 Width;
601 UINT Height;
602 UINT16 DepthOrArraySize;
603 UINT16 MipLevels;
604 DXGI_FORMAT Format;
605 DXGI_SAMPLE_DESC SampleDesc;
606 D3D12_TEXTURE_LAYOUT Layout;
607 D3D12_RESOURCE_FLAGS Flags;
608} D3D12_RESOURCE_DESC;
609
610typedef enum D3D12_RESOLVE_MODE
611{
612 D3D12_RESOLVE_MODE_DECOMPRESS = 0,
613 D3D12_RESOLVE_MODE_MIN = 1,
614 D3D12_RESOLVE_MODE_MAX = 2,
615 D3D12_RESOLVE_MODE_AVERAGE = 3,
616} D3D12_RESOLVE_MODE;
617
618typedef struct D3D12_SAMPLE_POSITION
619{
620 INT8 X;
621 INT8 Y;
622} D3D12_SAMPLE_POSITION;
623
624typedef enum D3D12_TEXTURE_COPY_TYPE
625{
626 D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX = 0,
627 D3D12_TEXTURE_COPY_TYPE_PLACED_FOOTPRINT = 1,
628} D3D12_TEXTURE_COPY_TYPE;
629
630typedef struct D3D12_SUBRESOURCE_FOOTPRINT
631{
632 DXGI_FORMAT Format;
633 UINT Width;
634 UINT Height;
635 UINT Depth;
636 UINT RowPitch;
637} D3D12_SUBRESOURCE_FOOTPRINT;
638
639typedef struct D3D12_PLACED_SUBRESOURCE_FOOTPRINT
640{
641 UINT64 Offset;
642 D3D12_SUBRESOURCE_FOOTPRINT Footprint;
643} D3D12_PLACED_SUBRESOURCE_FOOTPRINT;
644
645typedef struct D3D12_TEXTURE_COPY_LOCATION
646{
647 ID3D12Resource *pResource;
648 D3D12_TEXTURE_COPY_TYPE Type;
649 union
650 {
651 D3D12_PLACED_SUBRESOURCE_FOOTPRINT PlacedFootprint;
652 UINT SubresourceIndex;
653 };
654} D3D12_TEXTURE_COPY_LOCATION;
655
656typedef enum D3D12_DESCRIPTOR_RANGE_TYPE
657{
658 D3D12_DESCRIPTOR_RANGE_TYPE_SRV = 0,
659 D3D12_DESCRIPTOR_RANGE_TYPE_UAV = 1,
660 D3D12_DESCRIPTOR_RANGE_TYPE_CBV = 2,
661 D3D12_DESCRIPTOR_RANGE_TYPE_SAMPLER = 3,
662} D3D12_DESCRIPTOR_RANGE_TYPE;
663
664typedef struct D3D12_DESCRIPTOR_RANGE
665{
666 D3D12_DESCRIPTOR_RANGE_TYPE RangeType;
667 UINT NumDescriptors;
668 UINT BaseShaderRegister;
669 UINT RegisterSpace;
670 UINT OffsetInDescriptorsFromTableStart;
671} D3D12_DESCRIPTOR_RANGE;
672
673typedef enum D3D12_DESCRIPTOR_RANGE_FLAGS
674{
675 D3D12_DESCRIPTOR_RANGE_FLAG_NONE = 0x0,
676 D3D12_DESCRIPTOR_RANGE_FLAG_DESCRIPTORS_VOLATILE = 0x1,
677 D3D12_DESCRIPTOR_RANGE_FLAG_DATA_VOLATILE = 0x2,
678 D3D12_DESCRIPTOR_RANGE_FLAG_DATA_STATIC_WHILE_SET_AT_EXECUTE = 0x4,
679 D3D12_DESCRIPTOR_RANGE_FLAG_DATA_STATIC = 0x8,
680} D3D12_DESCRIPTOR_RANGE_FLAGS;
681cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_DESCRIPTOR_RANGE_FLAGS);")
682
683typedef struct D3D12_DESCRIPTOR_RANGE1
684{
685 D3D12_DESCRIPTOR_RANGE_TYPE RangeType;
686 UINT NumDescriptors;
687 UINT BaseShaderRegister;
688 UINT RegisterSpace;
689 D3D12_DESCRIPTOR_RANGE_FLAGS Flags;
690 UINT OffsetInDescriptorsFromTableStart;
691} D3D12_DESCRIPTOR_RANGE1;
692
693typedef struct D3D12_ROOT_DESCRIPTOR_TABLE
694{
695 UINT NumDescriptorRanges;
696 const D3D12_DESCRIPTOR_RANGE *pDescriptorRanges;
697} D3D12_ROOT_DESCRIPTOR_TABLE;
698
699typedef struct D3D12_ROOT_DESCRIPTOR_TABLE1
700{
701 UINT NumDescriptorRanges;
702 const D3D12_DESCRIPTOR_RANGE1 *pDescriptorRanges;
703} D3D12_ROOT_DESCRIPTOR_TABLE1;
704
705typedef struct D3D12_ROOT_CONSTANTS
706{
707 UINT ShaderRegister;
708 UINT RegisterSpace;
709 UINT Num32BitValues;
710} D3D12_ROOT_CONSTANTS;
711
712typedef struct D3D12_ROOT_DESCRIPTOR
713{
714 UINT ShaderRegister;
715 UINT RegisterSpace;
716} D3D12_ROOT_DESCRIPTOR;
717
718typedef enum D3D12_ROOT_DESCRIPTOR_FLAGS
719{
720 D3D12_ROOT_DESCRIPTOR_FLAG_NONE = 0x0,
721 D3D12_ROOT_DESCRIPTOR_FLAG_DATA_VOLATILE = 0x2,
722 D3D12_ROOT_DESCRIPTOR_FLAG_DATA_STATIC_WHILE_SET_AT_EXECUTE = 0x4,
723 D3D12_ROOT_DESCRIPTOR_FLAG_DATA_STATIC = 0x8,
724} D3D12_ROOT_DESCRIPTOR_FLAGS;
725cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_ROOT_DESCRIPTOR_FLAGS);")
726
727typedef struct D3D12_ROOT_DESCRIPTOR1
728{
729 UINT ShaderRegister;
730 UINT RegisterSpace;
731 D3D12_ROOT_DESCRIPTOR_FLAGS Flags;
732} D3D12_ROOT_DESCRIPTOR1;
733
734typedef enum D3D12_ROOT_PARAMETER_TYPE
735{
736 D3D12_ROOT_PARAMETER_TYPE_DESCRIPTOR_TABLE = 0,
737 D3D12_ROOT_PARAMETER_TYPE_32BIT_CONSTANTS = 1,
738 D3D12_ROOT_PARAMETER_TYPE_CBV = 2,
739 D3D12_ROOT_PARAMETER_TYPE_SRV = 3,
740 D3D12_ROOT_PARAMETER_TYPE_UAV = 4,
741} D3D12_ROOT_PARAMETER_TYPE;
742
743typedef enum D3D12_SHADER_VISIBILITY
744{
745 D3D12_SHADER_VISIBILITY_ALL = 0,
746 D3D12_SHADER_VISIBILITY_VERTEX = 1,
747 D3D12_SHADER_VISIBILITY_HULL = 2,
748 D3D12_SHADER_VISIBILITY_DOMAIN = 3,
749 D3D12_SHADER_VISIBILITY_GEOMETRY = 4,
750 D3D12_SHADER_VISIBILITY_PIXEL = 5,
751} D3D12_SHADER_VISIBILITY;
752
753typedef struct D3D12_ROOT_PARAMETER
754{
755 D3D12_ROOT_PARAMETER_TYPE ParameterType;
756 union
757 {
758 D3D12_ROOT_DESCRIPTOR_TABLE DescriptorTable;
759 D3D12_ROOT_CONSTANTS Constants;
760 D3D12_ROOT_DESCRIPTOR Descriptor;
761 };
762 D3D12_SHADER_VISIBILITY ShaderVisibility;
763} D3D12_ROOT_PARAMETER;
764
765typedef struct D3D12_ROOT_PARAMETER1
766{
767 D3D12_ROOT_PARAMETER_TYPE ParameterType;
768 union
769 {
770 D3D12_ROOT_DESCRIPTOR_TABLE1 DescriptorTable;
771 D3D12_ROOT_CONSTANTS Constants;
772 D3D12_ROOT_DESCRIPTOR1 Descriptor;
773 };
774 D3D12_SHADER_VISIBILITY ShaderVisibility;
775} D3D12_ROOT_PARAMETER1;
776
777typedef enum D3D12_STATIC_BORDER_COLOR
778{
779 D3D12_STATIC_BORDER_COLOR_TRANSPARENT_BLACK = 0,
780 D3D12_STATIC_BORDER_COLOR_OPAQUE_BLACK = 1,
781 D3D12_STATIC_BORDER_COLOR_OPAQUE_WHITE = 2,
782} D3D12_STATIC_BORDER_COLOR;
783
784typedef enum D3D12_FILTER
785{
786 D3D12_FILTER_MIN_MAG_MIP_POINT = 0x00,
787 D3D12_FILTER_MIN_MAG_POINT_MIP_LINEAR = 0x01,
788 D3D12_FILTER_MIN_POINT_MAG_LINEAR_MIP_POINT = 0x04,
789 D3D12_FILTER_MIN_POINT_MAG_MIP_LINEAR = 0x05,
790 D3D12_FILTER_MIN_LINEAR_MAG_MIP_POINT = 0x10,
791 D3D12_FILTER_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x11,
792 D3D12_FILTER_MIN_MAG_LINEAR_MIP_POINT = 0x14,
793 D3D12_FILTER_MIN_MAG_MIP_LINEAR = 0x15,
794 D3D12_FILTER_ANISOTROPIC = 0x55,
795 D3D12_FILTER_COMPARISON_MIN_MAG_MIP_POINT = 0x80,
796 D3D12_FILTER_COMPARISON_MIN_MAG_POINT_MIP_LINEAR = 0x81,
797 D3D12_FILTER_COMPARISON_MIN_POINT_MAG_LINEAR_MIP_POINT = 0x84,
798 D3D12_FILTER_COMPARISON_MIN_POINT_MAG_MIP_LINEAR = 0x85,
799 D3D12_FILTER_COMPARISON_MIN_LINEAR_MAG_MIP_POINT = 0x90,
800 D3D12_FILTER_COMPARISON_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x91,
801 D3D12_FILTER_COMPARISON_MIN_MAG_LINEAR_MIP_POINT = 0x94,
802 D3D12_FILTER_COMPARISON_MIN_MAG_MIP_LINEAR = 0x95,
803 D3D12_FILTER_COMPARISON_ANISOTROPIC = 0xd5,
804 D3D12_FILTER_MINIMUM_MIN_MAG_MIP_POINT = 0x100,
805 D3D12_FILTER_MINIMUM_MIN_MAG_POINT_MIP_LINEAR = 0x101,
806 D3D12_FILTER_MINIMUM_MIN_POINT_MAG_LINEAR_MIP_POINT = 0x104,
807 D3D12_FILTER_MINIMUM_MIN_POINT_MAG_MIP_LINEAR = 0x105,
808 D3D12_FILTER_MINIMUM_MIN_LINEAR_MAG_MIP_POINT = 0x110,
809 D3D12_FILTER_MINIMUM_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x111,
810 D3D12_FILTER_MINIMUM_MIN_MAG_LINEAR_MIP_POINT = 0x114,
811 D3D12_FILTER_MINIMUM_MIN_MAG_MIP_LINEAR = 0x115,
812 D3D12_FILTER_MINIMUM_ANISOTROPIC = 0x155,
813 D3D12_FILTER_MAXIMUM_MIN_MAG_MIP_POINT = 0x180,
814 D3D12_FILTER_MAXIMUM_MIN_MAG_POINT_MIP_LINEAR = 0x181,
815 D3D12_FILTER_MAXIMUM_MIN_POINT_MAG_LINEAR_MIP_POINT = 0x184,
816 D3D12_FILTER_MAXIMUM_MIN_POINT_MAG_MIP_LINEAR = 0x185,
817 D3D12_FILTER_MAXIMUM_MIN_LINEAR_MAG_MIP_POINT = 0x190,
818 D3D12_FILTER_MAXIMUM_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x191,
819 D3D12_FILTER_MAXIMUM_MIN_MAG_LINEAR_MIP_POINT = 0x194,
820 D3D12_FILTER_MAXIMUM_MIN_MAG_MIP_LINEAR = 0x195,
821 D3D12_FILTER_MAXIMUM_ANISOTROPIC = 0x1d5,
822} D3D12_FILTER;
823
824typedef enum D3D12_FILTER_TYPE
825{
826 D3D12_FILTER_TYPE_POINT = 0,
827 D3D12_FILTER_TYPE_LINEAR = 1,
828} D3D12_FILTER_TYPE;
829
830const UINT D3D12_MIP_FILTER_SHIFT = 0;
831const UINT D3D12_MAG_FILTER_SHIFT = 2;
832const UINT D3D12_MIN_FILTER_SHIFT = 4;
833const UINT D3D12_FILTER_TYPE_MASK = 0x3;
834
835const UINT D3D12_ANISOTROPIC_FILTERING_BIT = 0x40;
836
837typedef enum D3D12_FILTER_REDUCTION_TYPE
838{
839 D3D12_FILTER_REDUCTION_TYPE_STANDARD = 0,
840 D3D12_FILTER_REDUCTION_TYPE_COMPARISON = 1,
841 D3D12_FILTER_REDUCTION_TYPE_MINIMUM = 2,
842 D3D12_FILTER_REDUCTION_TYPE_MAXIMUM = 3,
843} D3D12_FILTER_REDUCTION_TYPE;
844
845const UINT D3D12_FILTER_REDUCTION_TYPE_MASK = 0x3;
846const UINT D3D12_FILTER_REDUCTION_TYPE_SHIFT = 7;
847
848cpp_quote("#define D3D12_DECODE_MAG_FILTER(filter) \\")
849cpp_quote(" ((D3D12_FILTER_TYPE)(((filter) >> D3D12_MAG_FILTER_SHIFT) & D3D12_FILTER_TYPE_MASK))")
850
851cpp_quote("#define D3D12_DECODE_MIN_FILTER(filter) \\")
852cpp_quote(" ((D3D12_FILTER_TYPE)(((filter) >> D3D12_MIN_FILTER_SHIFT) & D3D12_FILTER_TYPE_MASK))")
853
854cpp_quote("#define D3D12_DECODE_MIP_FILTER(filter) \\")
855cpp_quote(" ((D3D12_FILTER_TYPE)(((filter) >> D3D12_MIP_FILTER_SHIFT) & D3D12_FILTER_TYPE_MASK))")
856
857cpp_quote("#define D3D12_DECODE_IS_ANISOTROPIC_FILTER(filter) \\")
858cpp_quote(" (((filter) & D3D12_ANISOTROPIC_FILTERING_BIT) \\")
859cpp_quote(" && (D3D12_DECODE_MIN_FILTER(filter) == D3D12_FILTER_TYPE_LINEAR) \\")
860cpp_quote(" && (D3D12_DECODE_MAG_FILTER(filter) == D3D12_FILTER_TYPE_LINEAR) \\")
861cpp_quote(" && (D3D12_DECODE_MIP_FILTER(filter) == D3D12_FILTER_TYPE_LINEAR))")
862
863cpp_quote("#define D3D12_DECODE_FILTER_REDUCTION(filter) \\")
864cpp_quote(" ((D3D12_FILTER_REDUCTION_TYPE)(((filter) >> D3D12_FILTER_REDUCTION_TYPE_SHIFT) \\")
865cpp_quote(" & D3D12_FILTER_REDUCTION_TYPE_MASK))")
866
867cpp_quote("#define D3D12_DECODE_IS_COMPARISON_FILTER(filter) \\")
868cpp_quote(" (D3D12_DECODE_FILTER_REDUCTION(filter) == D3D12_FILTER_REDUCTION_TYPE_COMPARISON)")
869
870typedef enum D3D12_TEXTURE_ADDRESS_MODE
871{
872 D3D12_TEXTURE_ADDRESS_MODE_WRAP = 1,
873 D3D12_TEXTURE_ADDRESS_MODE_MIRROR = 2,
874 D3D12_TEXTURE_ADDRESS_MODE_CLAMP = 3,
875 D3D12_TEXTURE_ADDRESS_MODE_BORDER = 4,
876 D3D12_TEXTURE_ADDRESS_MODE_MIRROR_ONCE = 5,
877} D3D12_TEXTURE_ADDRESS_MODE;
878
879typedef enum D3D12_COMPARISON_FUNC
880{
881 D3D12_COMPARISON_FUNC_NEVER = 1,
882 D3D12_COMPARISON_FUNC_LESS = 2,
883 D3D12_COMPARISON_FUNC_EQUAL = 3,
884 D3D12_COMPARISON_FUNC_LESS_EQUAL = 4,
885 D3D12_COMPARISON_FUNC_GREATER = 5,
886 D3D12_COMPARISON_FUNC_NOT_EQUAL = 6,
887 D3D12_COMPARISON_FUNC_GREATER_EQUAL = 7,
888 D3D12_COMPARISON_FUNC_ALWAYS = 8,
889} D3D12_COMPARISON_FUNC;
890
891typedef struct D3D12_STATIC_SAMPLER_DESC
892{
893 D3D12_FILTER Filter;
894 D3D12_TEXTURE_ADDRESS_MODE AddressU;
895 D3D12_TEXTURE_ADDRESS_MODE AddressV;
896 D3D12_TEXTURE_ADDRESS_MODE AddressW;
897 FLOAT MipLODBias;
898 UINT MaxAnisotropy;
899 D3D12_COMPARISON_FUNC ComparisonFunc;
900 D3D12_STATIC_BORDER_COLOR BorderColor;
901 FLOAT MinLOD;
902 FLOAT MaxLOD;
903 UINT ShaderRegister;
904 UINT RegisterSpace;
905 D3D12_SHADER_VISIBILITY ShaderVisibility;
906} D3D12_STATIC_SAMPLER_DESC;
907
908typedef enum D3D12_ROOT_SIGNATURE_FLAGS
909{
910 D3D12_ROOT_SIGNATURE_FLAG_NONE = 0x00,
911 D3D12_ROOT_SIGNATURE_FLAG_ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT = 0x01,
912 D3D12_ROOT_SIGNATURE_FLAG_DENY_VERTEX_SHADER_ROOT_ACCESS = 0x02,
913 D3D12_ROOT_SIGNATURE_FLAG_DENY_HULL_SHADER_ROOT_ACCESS = 0x04,
914 D3D12_ROOT_SIGNATURE_FLAG_DENY_DOMAIN_SHADER_ROOT_ACCESS = 0x08,
915 D3D12_ROOT_SIGNATURE_FLAG_DENY_GEOMETRY_SHADER_ROOT_ACCESS = 0x10,
916 D3D12_ROOT_SIGNATURE_FLAG_DENY_PIXEL_SHADER_ROOT_ACCESS = 0x20,
917 D3D12_ROOT_SIGNATURE_FLAG_ALLOW_STREAM_OUTPUT = 0x40,
918} D3D12_ROOT_SIGNATURE_FLAGS;
919cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_ROOT_SIGNATURE_FLAGS);")
920
921typedef struct D3D12_ROOT_SIGNATURE_DESC
922{
923 UINT NumParameters;
924 const D3D12_ROOT_PARAMETER *pParameters;
925 UINT NumStaticSamplers;
926 const D3D12_STATIC_SAMPLER_DESC *pStaticSamplers;
927 D3D12_ROOT_SIGNATURE_FLAGS Flags;
928} D3D12_ROOT_SIGNATURE_DESC;
929
930typedef struct D3D12_ROOT_SIGNATURE_DESC1
931{
932 UINT NumParameters;
933 const D3D12_ROOT_PARAMETER1 *pParameters;
934 UINT NumStaticSamplers;
935 const D3D12_STATIC_SAMPLER_DESC *pStaticSamplers;
936 D3D12_ROOT_SIGNATURE_FLAGS Flags;
937} D3D12_ROOT_SIGNATURE_DESC1;
938
939typedef enum D3D_ROOT_SIGNATURE_VERSION
940{
941 D3D_ROOT_SIGNATURE_VERSION_1 = 0x1,
942 D3D_ROOT_SIGNATURE_VERSION_1_0 = 0x1,
943 D3D_ROOT_SIGNATURE_VERSION_1_1 = 0x2,
944} D3D_ROOT_SIGNATURE_VERSION;
945
946typedef struct D3D12_VERSIONED_ROOT_SIGNATURE_DESC
947{
948 D3D_ROOT_SIGNATURE_VERSION Version;
949 union
950 {
951 D3D12_ROOT_SIGNATURE_DESC Desc_1_0;
952 D3D12_ROOT_SIGNATURE_DESC1 Desc_1_1;
953 };
954} D3D12_VERSIONED_ROOT_SIGNATURE_DESC;
955
956typedef enum D3D12_DESCRIPTOR_HEAP_TYPE
957{
958 D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV,
959 D3D12_DESCRIPTOR_HEAP_TYPE_SAMPLER,
960 D3D12_DESCRIPTOR_HEAP_TYPE_RTV,
961 D3D12_DESCRIPTOR_HEAP_TYPE_DSV,
962 D3D12_DESCRIPTOR_HEAP_TYPE_NUM_TYPES,
963} D3D12_DESCRIPTOR_HEAP_TYPE;
964
965typedef enum D3D12_DESCRIPTOR_HEAP_FLAGS
966{
967 D3D12_DESCRIPTOR_HEAP_FLAG_NONE = 0x0,
968 D3D12_DESCRIPTOR_HEAP_FLAG_SHADER_VISIBLE = 0x1,
969} D3D12_DESCRIPTOR_HEAP_FLAGS;
970cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_DESCRIPTOR_HEAP_FLAGS);")
971
972typedef struct D3D12_DESCRIPTOR_HEAP_DESC
973{
974 D3D12_DESCRIPTOR_HEAP_TYPE Type;
975 UINT NumDescriptors;
976 D3D12_DESCRIPTOR_HEAP_FLAGS Flags;
977 UINT NodeMask;
978} D3D12_DESCRIPTOR_HEAP_DESC;
979
980typedef UINT64 D3D12_GPU_VIRTUAL_ADDRESS;
981
982typedef struct D3D12_CONSTANT_BUFFER_VIEW_DESC
983{
984 D3D12_GPU_VIRTUAL_ADDRESS BufferLocation;
985 UINT SizeInBytes;
986} D3D12_CONSTANT_BUFFER_VIEW_DESC;
987
988typedef enum D3D12_SRV_DIMENSION
989{
990 D3D12_SRV_DIMENSION_UNKNOWN = 0,
991 D3D12_SRV_DIMENSION_BUFFER = 1,
992 D3D12_SRV_DIMENSION_TEXTURE1D = 2,
993 D3D12_SRV_DIMENSION_TEXTURE1DARRAY = 3,
994 D3D12_SRV_DIMENSION_TEXTURE2D = 4,
995 D3D12_SRV_DIMENSION_TEXTURE2DARRAY = 5,
996 D3D12_SRV_DIMENSION_TEXTURE2DMS = 6,
997 D3D12_SRV_DIMENSION_TEXTURE2DMSARRAY = 7,
998 D3D12_SRV_DIMENSION_TEXTURE3D = 8,
999 D3D12_SRV_DIMENSION_TEXTURECUBE = 9,
1000 D3D12_SRV_DIMENSION_TEXTURECUBEARRAY = 10,
1001} D3D12_SRV_DIMENSION;
1002
1003typedef enum D3D12_BUFFER_SRV_FLAGS
1004{
1005 D3D12_BUFFER_SRV_FLAG_NONE = 0x0,
1006 D3D12_BUFFER_SRV_FLAG_RAW = 0x1,
1007} D3D12_BUFFER_SRV_FLAGS;
1008cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_BUFFER_SRV_FLAGS);")
1009
1010typedef enum D3D12_SHADER_COMPONENT_MAPPING
1011{
1012 D3D12_SHADER_COMPONENT_MAPPING_FROM_MEMORY_COMPONENT_0 = 0,
1013 D3D12_SHADER_COMPONENT_MAPPING_FROM_MEMORY_COMPONENT_1 = 1,
1014 D3D12_SHADER_COMPONENT_MAPPING_FROM_MEMORY_COMPONENT_2 = 2,
1015 D3D12_SHADER_COMPONENT_MAPPING_FROM_MEMORY_COMPONENT_3 = 3,
1016 D3D12_SHADER_COMPONENT_MAPPING_FORCE_VALUE_0 = 4,
1017 D3D12_SHADER_COMPONENT_MAPPING_FORCE_VALUE_1 = 5,
1018} D3D12_SHADER_COMPONENT_MAPPING;
1019
1020cpp_quote("#define D3D12_ENCODE_SHADER_4_COMPONENT_MAPPING(x, y, z, w) \\")
1021cpp_quote(" (((x) & D3D12_SHADER_COMPONENT_MAPPING_MASK) \\")
1022cpp_quote(" | (((y) & D3D12_SHADER_COMPONENT_MAPPING_MASK) << D3D12_SHADER_COMPONENT_MAPPING_SHIFT) \\")
1023cpp_quote(" | (((z) & D3D12_SHADER_COMPONENT_MAPPING_MASK) << (D3D12_SHADER_COMPONENT_MAPPING_SHIFT * 2)) \\")
1024cpp_quote(" | (((w) & D3D12_SHADER_COMPONENT_MAPPING_MASK) << (D3D12_SHADER_COMPONENT_MAPPING_SHIFT * 3)) \\")
1025cpp_quote(" | D3D12_SHADER_COMPONENT_MAPPING_ALWAYS_SET_BIT_AVOIDING_ZEROMEM_MISTAKES)")
1026cpp_quote("#define D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING D3D12_ENCODE_SHADER_4_COMPONENT_MAPPING(0, 1, 2, 3)")
1027
1028cpp_quote("#define D3D12_DECODE_SHADER_4_COMPONENT_MAPPING(i, mapping) \\")
1029cpp_quote(" ((D3D12_SHADER_COMPONENT_MAPPING)(mapping >> (i * D3D12_SHADER_COMPONENT_MAPPING_SHIFT) \\")
1030cpp_quote(" & D3D12_SHADER_COMPONENT_MAPPING_MASK))")
1031
1032typedef struct D3D12_BUFFER_SRV
1033{
1034 UINT64 FirstElement;
1035 UINT NumElements;
1036 UINT StructureByteStride;
1037 D3D12_BUFFER_SRV_FLAGS Flags;
1038} D3D12_BUFFER_SRV;
1039
1040typedef struct D3D12_TEX1D_SRV
1041{
1042 UINT MostDetailedMip;
1043 UINT MipLevels;
1044 FLOAT ResourceMinLODClamp;
1045} D3D12_TEX1D_SRV;
1046
1047typedef struct D3D12_TEX1D_ARRAY_SRV
1048{
1049 UINT MostDetailedMip;
1050 UINT MipLevels;
1051 UINT FirstArraySlice;
1052 UINT ArraySize;
1053 FLOAT ResourceMinLODClamp;
1054} D3D12_TEX1D_ARRAY_SRV;
1055
1056typedef struct D3D12_TEX2D_SRV
1057{
1058 UINT MostDetailedMip;
1059 UINT MipLevels;
1060 UINT PlaneSlice;
1061 FLOAT ResourceMinLODClamp;
1062} D3D12_TEX2D_SRV;
1063
1064typedef struct D3D12_TEX2D_ARRAY_SRV
1065{
1066 UINT MostDetailedMip;
1067 UINT MipLevels;
1068 UINT FirstArraySlice;
1069 UINT ArraySize;
1070 UINT PlaneSlice;
1071 FLOAT ResourceMinLODClamp;
1072} D3D12_TEX2D_ARRAY_SRV;
1073
1074typedef struct D3D12_TEX2DMS_SRV
1075{
1076 UINT UnusedField_NothingToDefine;
1077} D3D12_TEX2DMS_SRV;
1078
1079typedef struct D3D12_TEX2DMS_ARRAY_SRV
1080{
1081 UINT FirstArraySlice;
1082 UINT ArraySize;
1083} D3D12_TEX2DMS_ARRAY_SRV;
1084
1085typedef struct D3D12_TEX3D_SRV
1086{
1087 UINT MostDetailedMip;
1088 UINT MipLevels;
1089 FLOAT ResourceMinLODClamp;
1090} D3D12_TEX3D_SRV;
1091
1092typedef struct D3D12_TEXCUBE_SRV
1093{
1094 UINT MostDetailedMip;
1095 UINT MipLevels;
1096 FLOAT ResourceMinLODClamp;
1097} D3D12_TEXCUBE_SRV;
1098
1099typedef struct D3D12_TEXCUBE_ARRAY_SRV
1100{
1101 UINT MostDetailedMip;
1102 UINT MipLevels;
1103 UINT First2DArrayFace;
1104 UINT NumCubes;
1105 FLOAT ResourceMinLODClamp;
1106} D3D12_TEXCUBE_ARRAY_SRV;
1107
1108typedef struct D3D12_SHADER_RESOURCE_VIEW_DESC
1109{
1110 DXGI_FORMAT Format;
1111 D3D12_SRV_DIMENSION ViewDimension;
1112 UINT Shader4ComponentMapping;
1113 union
1114 {
1115 D3D12_BUFFER_SRV Buffer;
1116 D3D12_TEX1D_SRV Texture1D;
1117 D3D12_TEX1D_ARRAY_SRV Texture1DArray;
1118 D3D12_TEX2D_SRV Texture2D;
1119 D3D12_TEX2D_ARRAY_SRV Texture2DArray;
1120 D3D12_TEX2DMS_SRV Texture2DMS;
1121 D3D12_TEX2DMS_ARRAY_SRV Texture2DMSArray;
1122 D3D12_TEX3D_SRV Texture3D;
1123 D3D12_TEXCUBE_SRV TextureCube;
1124 D3D12_TEXCUBE_ARRAY_SRV TextureCubeArray;
1125 };
1126} D3D12_SHADER_RESOURCE_VIEW_DESC;
1127
1128typedef enum D3D12_UAV_DIMENSION
1129{
1130 D3D12_UAV_DIMENSION_UNKNOWN = 0,
1131 D3D12_UAV_DIMENSION_BUFFER = 1,
1132 D3D12_UAV_DIMENSION_TEXTURE1D = 2,
1133 D3D12_UAV_DIMENSION_TEXTURE1DARRAY = 3,
1134 D3D12_UAV_DIMENSION_TEXTURE2D = 4,
1135 D3D12_UAV_DIMENSION_TEXTURE2DARRAY = 5,
1136 D3D12_UAV_DIMENSION_TEXTURE3D = 8,
1137} D3D12_UAV_DIMENSION;
1138
1139typedef enum D3D12_BUFFER_UAV_FLAGS
1140{
1141 D3D12_BUFFER_UAV_FLAG_NONE = 0x0,
1142 D3D12_BUFFER_UAV_FLAG_RAW = 0x1,
1143} D3D12_BUFFER_UAV_FLAGS;
1144cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_BUFFER_UAV_FLAGS);")
1145
1146typedef struct D3D12_BUFFER_UAV
1147{
1148 UINT64 FirstElement;
1149 UINT NumElements;
1150 UINT StructureByteStride;
1151 UINT64 CounterOffsetInBytes;
1152 D3D12_BUFFER_UAV_FLAGS Flags;
1153} D3D12_BUFFER_UAV;
1154
1155typedef struct D3D12_TEX1D_UAV
1156{
1157 UINT MipSlice;
1158} D3D12_TEX1D_UAV;
1159
1160typedef struct D3D12_TEX1D_ARRAY_UAV
1161{
1162 UINT MipSlice;
1163 UINT FirstArraySlice;
1164 UINT ArraySize;
1165} D3D12_TEX1D_ARRAY_UAV;
1166
1167typedef struct D3D12_TEX2D_UAV
1168{
1169 UINT MipSlice;
1170 UINT PlaneSlice;
1171} D3D12_TEX2D_UAV;
1172
1173typedef struct D3D12_TEX2D_ARRAY_UAV
1174{
1175 UINT MipSlice;
1176 UINT FirstArraySlice;
1177 UINT ArraySize;
1178 UINT PlaneSlice;
1179} D3D12_TEX2D_ARRAY_UAV;
1180
1181typedef struct D3D12_TEX3D_UAV
1182{
1183 UINT MipSlice;
1184 UINT FirstWSlice;
1185 UINT WSize;
1186} D3D12_TEX3D_UAV;
1187
1188typedef struct D3D12_UNORDERED_ACCESS_VIEW_DESC
1189{
1190 DXGI_FORMAT Format;
1191 D3D12_UAV_DIMENSION ViewDimension;
1192 union
1193 {
1194 D3D12_BUFFER_UAV Buffer;
1195 D3D12_TEX1D_UAV Texture1D;
1196 D3D12_TEX1D_ARRAY_UAV Texture1DArray;
1197 D3D12_TEX2D_UAV Texture2D;
1198 D3D12_TEX2D_ARRAY_UAV Texture2DArray;
1199 D3D12_TEX3D_UAV Texture3D;
1200 };
1201} D3D12_UNORDERED_ACCESS_VIEW_DESC;
1202
1203typedef enum D3D12_RTV_DIMENSION
1204{
1205 D3D12_RTV_DIMENSION_UNKNOWN = 0,
1206 D3D12_RTV_DIMENSION_BUFFER = 1,
1207 D3D12_RTV_DIMENSION_TEXTURE1D = 2,
1208 D3D12_RTV_DIMENSION_TEXTURE1DARRAY = 3,
1209 D3D12_RTV_DIMENSION_TEXTURE2D = 4,
1210 D3D12_RTV_DIMENSION_TEXTURE2DARRAY = 5,
1211 D3D12_RTV_DIMENSION_TEXTURE2DMS = 6,
1212 D3D12_RTV_DIMENSION_TEXTURE2DMSARRAY = 7,
1213 D3D12_RTV_DIMENSION_TEXTURE3D = 8,
1214} D3D12_RTV_DIMENSION;
1215
1216typedef struct D3D12_BUFFER_RTV
1217{
1218 UINT64 FirstElement;
1219 UINT NumElements;
1220} D3D12_BUFFER_RTV;
1221
1222typedef struct D3D12_TEX1D_RTV
1223{
1224 UINT MipSlice;
1225} D3D12_TEX1D_RTV;
1226
1227typedef struct D3D12_TEX1D_ARRAY_RTV
1228{
1229 UINT MipSlice;
1230 UINT FirstArraySlice;
1231 UINT ArraySize;
1232} D3D12_TEX1D_ARRAY_RTV;
1233
1234typedef struct D3D12_TEX2D_RTV
1235{
1236 UINT MipSlice;
1237 UINT PlaneSlice;
1238} D3D12_TEX2D_RTV;
1239
1240typedef struct D3D12_TEX2D_ARRAY_RTV
1241{
1242 UINT MipSlice;
1243 UINT FirstArraySlice;
1244 UINT ArraySize;
1245 UINT PlaneSlice;
1246} D3D12_TEX2D_ARRAY_RTV;
1247
1248typedef struct D3D12_TEX2DMS_RTV
1249{
1250 UINT UnusedField_NothingToDefine;
1251} D3D12_TEX2DMS_RTV;
1252
1253typedef struct D3D12_TEX2DMS_ARRAY_RTV
1254{
1255 UINT FirstArraySlice;
1256 UINT ArraySize;
1257} D3D12_TEX2DMS_ARRAY_RTV;
1258
1259typedef struct D3D12_TEX3D_RTV
1260{
1261 UINT MipSlice;
1262 UINT FirstWSlice;
1263 UINT WSize;
1264} D3D12_TEX3D_RTV;
1265
1266typedef struct D3D12_RENDER_TARGET_VIEW_DESC
1267{
1268 DXGI_FORMAT Format;
1269 D3D12_RTV_DIMENSION ViewDimension;
1270 union
1271 {
1272 D3D12_BUFFER_RTV Buffer;
1273 D3D12_TEX1D_RTV Texture1D;
1274 D3D12_TEX1D_ARRAY_RTV Texture1DArray;
1275 D3D12_TEX2D_RTV Texture2D;
1276 D3D12_TEX2D_ARRAY_RTV Texture2DArray;
1277 D3D12_TEX2DMS_RTV Texture2DMS;
1278 D3D12_TEX2DMS_ARRAY_RTV Texture2DMSArray;
1279 D3D12_TEX3D_RTV Texture3D;
1280 };
1281} D3D12_RENDER_TARGET_VIEW_DESC;
1282
1283typedef enum D3D12_DSV_DIMENSION
1284{
1285 D3D12_DSV_DIMENSION_UNKNOWN = 0,
1286 D3D12_DSV_DIMENSION_TEXTURE1D = 1,
1287 D3D12_DSV_DIMENSION_TEXTURE1DARRAY = 2,
1288 D3D12_DSV_DIMENSION_TEXTURE2D = 3,
1289 D3D12_DSV_DIMENSION_TEXTURE2DARRAY = 4,
1290 D3D12_DSV_DIMENSION_TEXTURE2DMS = 5,
1291 D3D12_DSV_DIMENSION_TEXTURE2DMSARRAY = 6,
1292} D3D12_DSV_DIMENSION;
1293
1294typedef enum D3D12_DSV_FLAGS
1295{
1296 D3D12_DSV_FLAG_NONE = 0x0,
1297 D3D12_DSV_FLAG_READ_ONLY_DEPTH = 0x1,
1298 D3D12_DSV_FLAG_READ_ONLY_STENCIL = 0x2,
1299} D3D12_DSV_FLAGS;
1300cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_DSV_FLAGS);")
1301
1302typedef struct D3D12_TEX1D_DSV
1303{
1304 UINT MipSlice;
1305} D3D12_TEX1D_DSV;
1306
1307typedef struct D3D12_TEX1D_ARRAY_DSV
1308{
1309 UINT MipSlice;
1310 UINT FirstArraySlice;
1311 UINT ArraySize;
1312} D3D12_TEX1D_ARRAY_DSV;
1313
1314typedef struct D3D12_TEX2D_DSV
1315{
1316 UINT MipSlice;
1317} D3D12_TEX2D_DSV;
1318
1319typedef struct D3D12_TEX2D_ARRAY_DSV
1320{
1321 UINT MipSlice;
1322 UINT FirstArraySlice;
1323 UINT ArraySize;
1324} D3D12_TEX2D_ARRAY_DSV;
1325
1326typedef struct D3D12_TEX2DMS_DSV
1327{
1328 UINT UnusedField_NothingToDefine;
1329} D3D12_TEX2DMS_DSV;
1330
1331typedef struct D3D12_TEX2DMS_ARRAY_DSV
1332{
1333 UINT FirstArraySlice;
1334 UINT ArraySize;
1335} D3D12_TEX2DMS_ARRAY_DSV;
1336
1337typedef struct D3D12_DEPTH_STENCIL_VIEW_DESC
1338{
1339 DXGI_FORMAT Format;
1340 D3D12_DSV_DIMENSION ViewDimension;
1341 D3D12_DSV_FLAGS Flags;
1342 union
1343 {
1344 D3D12_TEX1D_DSV Texture1D;
1345 D3D12_TEX1D_ARRAY_DSV Texture1DArray;
1346 D3D12_TEX2D_DSV Texture2D;
1347 D3D12_TEX2D_ARRAY_DSV Texture2DArray;
1348 D3D12_TEX2DMS_DSV Texture2DMS;
1349 D3D12_TEX2DMS_ARRAY_DSV Texture2DMSArray;
1350 };
1351} D3D12_DEPTH_STENCIL_VIEW_DESC;
1352
1353typedef struct D3D12_SAMPLER_DESC
1354{
1355 D3D12_FILTER Filter;
1356 D3D12_TEXTURE_ADDRESS_MODE AddressU;
1357 D3D12_TEXTURE_ADDRESS_MODE AddressV;
1358 D3D12_TEXTURE_ADDRESS_MODE AddressW;
1359 FLOAT MipLODBias;
1360 UINT MaxAnisotropy;
1361 D3D12_COMPARISON_FUNC ComparisonFunc;
1362 FLOAT BorderColor[4];
1363 FLOAT MinLOD;
1364 FLOAT MaxLOD;
1365} D3D12_SAMPLER_DESC;
1366
1367typedef struct D3D12_CPU_DESCRIPTOR_HANDLE
1368{
1369 SIZE_T ptr;
1370} D3D12_CPU_DESCRIPTOR_HANDLE;
1371
1372typedef struct D3D12_GPU_DESCRIPTOR_HANDLE
1373{
1374 UINT64 ptr;
1375} D3D12_GPU_DESCRIPTOR_HANDLE;
1376
1377typedef enum D3D12_STENCIL_OP
1378{
1379 D3D12_STENCIL_OP_KEEP = 1,
1380 D3D12_STENCIL_OP_ZERO = 2,
1381 D3D12_STENCIL_OP_REPLACE = 3,
1382 D3D12_STENCIL_OP_INCR_SAT = 4,
1383 D3D12_STENCIL_OP_DECR_SAT = 5,
1384 D3D12_STENCIL_OP_INVERT = 6,
1385 D3D12_STENCIL_OP_INCR = 7,
1386 D3D12_STENCIL_OP_DECR = 8,
1387} D3D12_STENCIL_OP;
1388
1389typedef struct D3D12_DEPTH_STENCILOP_DESC
1390{
1391 D3D12_STENCIL_OP StencilFailOp;
1392 D3D12_STENCIL_OP StencilDepthFailOp;
1393 D3D12_STENCIL_OP StencilPassOp;
1394 D3D12_COMPARISON_FUNC StencilFunc;
1395} D3D12_DEPTH_STENCILOP_DESC;
1396
1397typedef enum D3D12_DEPTH_WRITE_MASK
1398{
1399 D3D12_DEPTH_WRITE_MASK_ZERO = 0,
1400 D3D12_DEPTH_WRITE_MASK_ALL = 1,
1401} D3D12_DEPTH_WRITE_MASK;
1402
1403typedef struct D3D12_DEPTH_STENCIL_DESC
1404{
1405 BOOL DepthEnable;
1406 D3D12_DEPTH_WRITE_MASK DepthWriteMask;
1407 D3D12_COMPARISON_FUNC DepthFunc;
1408 BOOL StencilEnable;
1409 UINT8 StencilReadMask;
1410 UINT8 StencilWriteMask;
1411 D3D12_DEPTH_STENCILOP_DESC FrontFace;
1412 D3D12_DEPTH_STENCILOP_DESC BackFace;
1413} D3D12_DEPTH_STENCIL_DESC;
1414
1415typedef enum D3D12_BLEND
1416{
1417 D3D12_BLEND_ZERO = 1,
1418 D3D12_BLEND_ONE = 2,
1419 D3D12_BLEND_SRC_COLOR = 3,
1420 D3D12_BLEND_INV_SRC_COLOR = 4,
1421 D3D12_BLEND_SRC_ALPHA = 5,
1422 D3D12_BLEND_INV_SRC_ALPHA = 6,
1423 D3D12_BLEND_DEST_ALPHA = 7,
1424 D3D12_BLEND_INV_DEST_ALPHA = 8,
1425 D3D12_BLEND_DEST_COLOR = 9,
1426 D3D12_BLEND_INV_DEST_COLOR = 10,
1427 D3D12_BLEND_SRC_ALPHA_SAT = 11,
1428 D3D12_BLEND_BLEND_FACTOR = 14,
1429 D3D12_BLEND_INV_BLEND_FACTOR = 15,
1430 D3D12_BLEND_SRC1_COLOR = 16,
1431 D3D12_BLEND_INV_SRC1_COLOR = 17,
1432 D3D12_BLEND_SRC1_ALPHA = 18,
1433 D3D12_BLEND_INV_SRC1_ALPHA = 19,
1434} D3D12_BLEND;
1435
1436typedef enum D3D12_BLEND_OP
1437{
1438 D3D12_BLEND_OP_ADD = 1,
1439 D3D12_BLEND_OP_SUBTRACT = 2,
1440 D3D12_BLEND_OP_REV_SUBTRACT = 3,
1441 D3D12_BLEND_OP_MIN = 4,
1442 D3D12_BLEND_OP_MAX = 5,
1443} D3D12_BLEND_OP;
1444
1445typedef enum D3D12_LOGIC_OP
1446{
1447 D3D12_LOGIC_OP_CLEAR = 0,
1448 D3D12_LOGIC_OP_SET = 1,
1449 D3D12_LOGIC_OP_COPY = 2,
1450 D3D12_LOGIC_OP_COPY_INVERTED = 3,
1451 D3D12_LOGIC_OP_NOOP = 4,
1452} D3D12_LOGIC_OP;
1453
1454typedef enum D3D12_COLOR_WRITE_ENABLE
1455{
1456 D3D12_COLOR_WRITE_ENABLE_RED = 0x1,
1457 D3D12_COLOR_WRITE_ENABLE_GREEN = 0x2,
1458 D3D12_COLOR_WRITE_ENABLE_BLUE = 0x4,
1459 D3D12_COLOR_WRITE_ENABLE_ALPHA = 0x8,
1460 D3D12_COLOR_WRITE_ENABLE_ALL = (D3D12_COLOR_WRITE_ENABLE_RED
1461 | D3D12_COLOR_WRITE_ENABLE_GREEN | D3D12_COLOR_WRITE_ENABLE_BLUE
1462 | D3D12_COLOR_WRITE_ENABLE_ALPHA),
1463} D3D12_COLOR_WRITE_ENABLE;
1464
1465typedef struct D3D12_RENDER_TARGET_BLEND_DESC
1466{
1467 BOOL BlendEnable;
1468 BOOL LogicOpEnable;
1469 D3D12_BLEND SrcBlend;
1470 D3D12_BLEND DestBlend;
1471 D3D12_BLEND_OP BlendOp;
1472 D3D12_BLEND SrcBlendAlpha;
1473 D3D12_BLEND DestBlendAlpha;
1474 D3D12_BLEND_OP BlendOpAlpha;
1475 D3D12_LOGIC_OP LogicOp;
1476 UINT8 RenderTargetWriteMask;
1477} D3D12_RENDER_TARGET_BLEND_DESC;
1478
1479typedef struct D3D12_BLEND_DESC
1480{
1481 BOOL AlphaToCoverageEnable;
1482 BOOL IndependentBlendEnable;
1483 D3D12_RENDER_TARGET_BLEND_DESC RenderTarget[D3D12_SIMULTANEOUS_RENDER_TARGET_COUNT];
1484} D3D12_BLEND_DESC;
1485
1486typedef enum D3D12_FILL_MODE
1487{
1488 D3D12_FILL_MODE_WIREFRAME = 2,
1489 D3D12_FILL_MODE_SOLID = 3,
1490} D3D12_FILL_MODE;
1491
1492typedef enum D3D12_CULL_MODE
1493{
1494 D3D12_CULL_MODE_NONE = 1,
1495 D3D12_CULL_MODE_FRONT = 2,
1496 D3D12_CULL_MODE_BACK = 3,
1497} D3D12_CULL_MODE;
1498
1499typedef enum D3D12_CONSERVATIVE_RASTERIZATION_MODE
1500{
1501 D3D12_CONSERVATIVE_RASTERIZATION_MODE_OFF = 0,
1502 D3D12_CONSERVATIVE_RASTERIZATION_MODE_ON = 1,
1503} D3D12_CONSERVATIVE_RASTERIZATION_MODE;
1504
1505typedef struct D3D12_RASTERIZER_DESC
1506{
1507 D3D12_FILL_MODE FillMode;
1508 D3D12_CULL_MODE CullMode;
1509 BOOL FrontCounterClockwise;
1510 INT DepthBias;
1511 FLOAT DepthBiasClamp;
1512 FLOAT SlopeScaledDepthBias;
1513 BOOL DepthClipEnable;
1514 BOOL MultisampleEnable;
1515 BOOL AntialiasedLineEnable;
1516 UINT ForcedSampleCount;
1517 D3D12_CONSERVATIVE_RASTERIZATION_MODE ConservativeRaster;
1518} D3D12_RASTERIZER_DESC;
1519
1520typedef struct D3D12_SO_DECLARATION_ENTRY
1521{
1522 UINT Stream;
1523 const char *SemanticName;
1524 UINT SemanticIndex;
1525 BYTE StartComponent;
1526 BYTE ComponentCount;
1527 BYTE OutputSlot;
1528} D3D12_SO_DECLARATION_ENTRY;
1529
1530typedef struct D3D12_STREAM_OUTPUT_DESC
1531{
1532 const D3D12_SO_DECLARATION_ENTRY *pSODeclaration;
1533 UINT NumEntries;
1534 const UINT *pBufferStrides;
1535 UINT NumStrides;
1536 UINT RasterizedStream;
1537} D3D12_STREAM_OUTPUT_DESC;
1538
1539typedef enum D3D12_INPUT_CLASSIFICATION
1540{
1541 D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA = 0,
1542 D3D12_INPUT_CLASSIFICATION_PER_INSTANCE_DATA = 1,
1543} D3D12_INPUT_CLASSIFICATION;
1544
1545typedef struct D3D12_INPUT_ELEMENT_DESC
1546{
1547 const char *SemanticName;
1548 UINT SemanticIndex;
1549 DXGI_FORMAT Format;
1550 UINT InputSlot;
1551 UINT AlignedByteOffset;
1552 D3D12_INPUT_CLASSIFICATION InputSlotClass;
1553 UINT InstanceDataStepRate;
1554} D3D12_INPUT_ELEMENT_DESC;
1555
1556typedef struct D3D12_INPUT_LAYOUT_DESC
1557{
1558 const D3D12_INPUT_ELEMENT_DESC *pInputElementDescs;
1559 UINT NumElements;
1560} D3D12_INPUT_LAYOUT_DESC;
1561
1562typedef enum D3D12_INDEX_BUFFER_STRIP_CUT_VALUE
1563{
1564 D3D12_INDEX_BUFFER_STRIP_CUT_VALUE_DISABLED = 0,
1565 D3D12_INDEX_BUFFER_STRIP_CUT_VALUE_0xFFFF = 1,
1566 D3D12_INDEX_BUFFER_STRIP_CUT_VALUE_0xFFFFFFFF = 2,
1567} D3D12_INDEX_BUFFER_STRIP_CUT_VALUE;
1568
1569typedef D3D_PRIMITIVE_TOPOLOGY D3D12_PRIMITIVE_TOPOLOGY;
1570
1571typedef enum D3D12_PRIMITIVE_TOPOLOGY_TYPE
1572{
1573 D3D12_PRIMITIVE_TOPOLOGY_TYPE_UNDEFINED = 0,
1574 D3D12_PRIMITIVE_TOPOLOGY_TYPE_POINT = 1,
1575 D3D12_PRIMITIVE_TOPOLOGY_TYPE_LINE = 2,
1576 D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE = 3,
1577 D3D12_PRIMITIVE_TOPOLOGY_TYPE_PATCH = 4,
1578} D3D12_PRIMITIVE_TOPOLOGY_TYPE;
1579
1580typedef struct D3D12_CACHED_PIPELINE_STATE
1581{
1582 const void *pCachedBlob;
1583 SIZE_T CachedBlobSizeInBytes;
1584} D3D12_CACHED_PIPELINE_STATE;
1585
1586typedef enum D3D12_PIPELINE_STATE_FLAGS
1587{
1588 D3D12_PIPELINE_STATE_FLAG_NONE = 0x0,
1589 D3D12_PIPELINE_STATE_FLAG_DEBUG = 0x1,
1590} D3D12_PIPELINE_STATE_FLAGS;
1591cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_PIPELINE_STATE_FLAGS);")
1592
1593typedef struct D3D12_GRAPHICS_PIPELINE_STATE_DESC
1594{
1595 ID3D12RootSignature *pRootSignature;
1596 D3D12_SHADER_BYTECODE VS;
1597 D3D12_SHADER_BYTECODE PS;
1598 D3D12_SHADER_BYTECODE DS;
1599 D3D12_SHADER_BYTECODE HS;
1600 D3D12_SHADER_BYTECODE GS;
1601 D3D12_STREAM_OUTPUT_DESC StreamOutput;
1602 D3D12_BLEND_DESC BlendState;
1603 UINT SampleMask;
1604 D3D12_RASTERIZER_DESC RasterizerState;
1605 D3D12_DEPTH_STENCIL_DESC DepthStencilState;
1606 D3D12_INPUT_LAYOUT_DESC InputLayout;
1607 D3D12_INDEX_BUFFER_STRIP_CUT_VALUE IBStripCutValue;
1608 D3D12_PRIMITIVE_TOPOLOGY_TYPE PrimitiveTopologyType;
1609 UINT NumRenderTargets;
1610 DXGI_FORMAT RTVFormats[D3D12_SIMULTANEOUS_RENDER_TARGET_COUNT];
1611 DXGI_FORMAT DSVFormat;
1612 DXGI_SAMPLE_DESC SampleDesc;
1613 UINT NodeMask;
1614 D3D12_CACHED_PIPELINE_STATE CachedPSO;
1615 D3D12_PIPELINE_STATE_FLAGS Flags;
1616} D3D12_GRAPHICS_PIPELINE_STATE_DESC;
1617
1618typedef struct D3D12_COMPUTE_PIPELINE_STATE_DESC
1619{
1620 ID3D12RootSignature *pRootSignature;
1621 D3D12_SHADER_BYTECODE CS;
1622 UINT NodeMask;
1623 D3D12_CACHED_PIPELINE_STATE CachedPSO;
1624 D3D12_PIPELINE_STATE_FLAGS Flags;
1625} D3D12_COMPUTE_PIPELINE_STATE_DESC;
1626
1627typedef enum D3D12_COMMAND_LIST_TYPE
1628{
1629 D3D12_COMMAND_LIST_TYPE_DIRECT = 0,
1630 D3D12_COMMAND_LIST_TYPE_BUNDLE = 1,
1631 D3D12_COMMAND_LIST_TYPE_COMPUTE = 2,
1632 D3D12_COMMAND_LIST_TYPE_COPY = 3,
1633} D3D12_COMMAND_LIST_TYPE;
1634
1635typedef enum D3D12_COMMAND_QUEUE_PRIORITY
1636{
1637 D3D12_COMMAND_QUEUE_PRIORITY_NORMAL = 0,
1638 D3D12_COMMAND_QUEUE_PRIORITY_HIGH = 100,
1639 D3D12_COMMAND_QUEUE_PRIORITY_GLOBAL_REALTIME = 10000,
1640} D3D12_COMMAND_QUEUE_PRIORITY;
1641
1642typedef enum D3D12_COMMAND_QUEUE_FLAGS
1643{
1644 D3D12_COMMAND_QUEUE_FLAG_NONE = 0x0,
1645 D3D12_COMMAND_QUEUE_FLAG_DISABLE_GPU_TIMEOUT = 0x1,
1646} D3D12_COMMAND_QUEUE_FLAGS;
1647cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_COMMAND_QUEUE_FLAGS);")
1648
1649typedef struct D3D12_COMMAND_QUEUE_DESC
1650{
1651 D3D12_COMMAND_LIST_TYPE Type;
1652 INT Priority;
1653 D3D12_COMMAND_QUEUE_FLAGS Flags;
1654 UINT NodeMask;
1655} D3D12_COMMAND_QUEUE_DESC;
1656
1657typedef struct D3D12_FEATURE_DATA_ARCHITECTURE
1658{
1659 UINT NodeIndex;
1660 BOOL TileBasedRenderer;
1661 BOOL UMA;
1662 BOOL CacheCoherentUMA;
1663} D3D12_FEATURE_DATA_ARCHITECTURE;
1664
1665typedef struct D3D12_FEATURE_DATA_FORMAT_INFO
1666{
1667 DXGI_FORMAT Format;
1668 UINT8 PlaneCount;
1669} D3D12_FEATURE_DATA_FORMAT_INFO;
1670
1671typedef struct D3D12_FEATURE_DATA_FEATURE_LEVELS
1672{
1673 UINT NumFeatureLevels;
1674 const D3D_FEATURE_LEVEL *pFeatureLevelsRequested;
1675 D3D_FEATURE_LEVEL MaxSupportedFeatureLevel;
1676} D3D12_FEATURE_DATA_FEATURE_LEVELS;
1677
1678typedef struct D3D12_FEATURE_DATA_ROOT_SIGNATURE
1679{
1680 D3D_ROOT_SIGNATURE_VERSION HighestVersion;
1681} D3D12_FEATURE_DATA_ROOT_SIGNATURE;
1682
1683typedef struct D3D12_FEATURE_DATA_GPU_VIRTUAL_ADDRESS_SUPPORT
1684{
1685 UINT MaxGPUVirtualAddressBitsPerResource;
1686 UINT MaxGPUVirtualAddressBitsPerProcess;
1687} D3D12_FEATURE_DATA_GPU_VIRTUAL_ADDRESS_SUPPORT;
1688
1689typedef enum D3D_SHADER_MODEL
1690{
1691 D3D_SHADER_MODEL_5_1 = 0x51,
1692 D3D_SHADER_MODEL_6_0 = 0x60,
1693} D3D_SHADER_MODEL;
1694
1695typedef struct D3D12_FEATURE_DATA_SHADER_MODEL
1696{
1697 D3D_SHADER_MODEL HighestShaderModel;
1698} D3D12_FEATURE_DATA_SHADER_MODEL;
1699
1700typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS1
1701{
1702 BOOL WaveOps;
1703 UINT WaveLaneCountMin;
1704 UINT WaveLaneCountMax;
1705 UINT TotalLaneCount;
1706 BOOL ExpandedComputeResourceStates;
1707 BOOL Int64ShaderOps;
1708} D3D12_FEATURE_DATA_D3D12_OPTIONS1;
1709
1710typedef struct D3D12_FEATURE_DATA_ARCHITECTURE1
1711{
1712 UINT NodeIndex;
1713 BOOL TileBasedRenderer;
1714 BOOL UMA;
1715 BOOL CacheCoherentUMA;
1716 BOOL IsolatedMMU;
1717} D3D12_FEATURE_DATA_ARCHITECTURE1;
1718
1719typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS2
1720{
1721 BOOL DepthBoundsTestSupported;
1722 D3D12_PROGRAMMABLE_SAMPLE_POSITIONS_TIER ProgrammableSamplePositionsTier;
1723} D3D12_FEATURE_DATA_D3D12_OPTIONS2;
1724
1725typedef struct D3D12_FEATURE_DATA_SHADER_CACHE
1726{
1727 D3D12_SHADER_CACHE_SUPPORT_FLAGS SupportFlags;
1728} D3D12_FEATURE_DATA_SHADER_CACHE;
1729
1730typedef struct D3D12_FEATURE_DATA_COMMAND_QUEUE_PRIORITY
1731{
1732 D3D12_COMMAND_LIST_TYPE CommandListType;
1733 UINT Priority;
1734 BOOL PriorityForTypeIsSupported;
1735} D3D12_FEATURE_DATA_COMMAND_QUEUE_PRIORITY;
1736
1737typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS3
1738{
1739 BOOL CopyQueueTimestampQueriesSupported;
1740 BOOL CastingFullyTypedFormatSupported;
1741 D3D12_COMMAND_LIST_SUPPORT_FLAGS WriteBufferImmediateSupportFlags;
1742 D3D12_VIEW_INSTANCING_TIER ViewInstancingTier;
1743 BOOL BarycentricsSupported;
1744} D3D12_FEATURE_DATA_D3D12_OPTIONS3;
1745
1746typedef struct D3D12_FEATURE_DATA_EXISTING_HEAPS
1747{
1748 BOOL Supported;
1749} D3D12_FEATURE_DATA_EXISTING_HEAPS;
1750
1751typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS4
1752{
1753 BOOL MSAA64KBAlignedTextureSupported;
1754 D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER SharedResourceCompatibilityTier;
1755 BOOL Native16BitShaderOpsSupported;
1756} D3D12_FEATURE_DATA_D3D12_OPTIONS4;
1757
1758typedef struct D3D12_FEATURE_DATA_SERIALIZATION
1759{
1760 UINT NodeIndex;
1761 D3D12_HEAP_SERIALIZATION_TIER HeapSerializationTier;
1762} D3D12_FEATURE_DATA_SERIALIZATION;
1763
1764typedef struct D3D12_FEATURE_DATA_CROSS_NODE
1765{
1766 D3D12_CROSS_NODE_SHARING_TIER SharingTier;
1767 BOOL AtomicShaderInstructions;
1768} D3D12_FEATURE_DATA_CROSS_NODE;
1769
1770typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS5
1771{
1772 BOOL SRVOnlyTiledResourceTier3;
1773 D3D12_RENDER_PASS_TIER RenderPassesTier;
1774 D3D12_RAYTRACING_TIER RaytracingTier;
1775} D3D12_FEATURE_DATA_D3D12_OPTIONS5;
1776
1777typedef enum D3D12_FEATURE
1778{
1779 D3D12_FEATURE_D3D12_OPTIONS = 0,
1780 D3D12_FEATURE_ARCHITECTURE = 1,
1781 D3D12_FEATURE_FEATURE_LEVELS = 2,
1782 D3D12_FEATURE_FORMAT_SUPPORT = 3,
1783 D3D12_FEATURE_MULTISAMPLE_QUALITY_LEVELS = 4,
1784 D3D12_FEATURE_FORMAT_INFO = 5,
1785 D3D12_FEATURE_GPU_VIRTUAL_ADDRESS_SUPPORT = 6,
1786 D3D12_FEATURE_SHADER_MODEL = 7,
1787 D3D12_FEATURE_D3D12_OPTIONS1 = 8,
1788 D3D12_FEATURE_PROTECTED_RESOURCE_SESSION_SUPPORT = 10,
1789 D3D12_FEATURE_ROOT_SIGNATURE = 12,
1790 D3D12_FEATURE_ARCHITECTURE1 = 16,
1791 D3D12_FEATURE_D3D12_OPTIONS2 = 18,
1792 D3D12_FEATURE_SHADER_CACHE = 19,
1793 D3D12_FEATURE_COMMAND_QUEUE_PRIORITY = 20,
1794 D3D12_FEATURE_D3D12_OPTIONS3 = 21,
1795 D3D12_FEATURE_EXISTING_HEAPS = 22,
1796 D3D12_FEATURE_D3D12_OPTIONS4 = 23,
1797 D3D12_FEATURE_SERIALIZATION = 24,
1798 D3D12_FEATURE_CROSS_NODE = 25,
1799 D3D12_FEATURE_D3D12_OPTIONS5 = 27,
1800 D3D12_FEATURE_D3D12_OPTIONS6 = 30,
1801 D3D12_FEATURE_QUERY_META_COMMAND = 31,
1802 D3D12_FEATURE_D3D12_OPTIONS7 = 32,
1803 D3D12_FEATURE_PROTECTED_RESOURCE_SESSION_TYPE_COUNT = 33,
1804 D3D12_FEATURE_PROTECTED_RESOURCE_SESSION_TYPES = 34,
1805} D3D12_FEATURE;
1806
1807typedef struct D3D12_MEMCPY_DEST
1808{
1809 void *pData;
1810 SIZE_T RowPitch;
1811 SIZE_T SlicePitch;
1812} D3D12_MEMCPY_DEST;
1813
1814typedef struct D3D12_SUBRESOURCE_DATA
1815{
1816 const void *pData;
1817 LONG_PTR RowPitch;
1818 LONG_PTR SlicePitch;
1819} D3D12_SUBRESOURCE_DATA;
1820
1821typedef enum D3D12_MULTIPLE_FENCE_WAIT_FLAGS
1822{
1823 D3D12_MULTIPLE_FENCE_WAIT_FLAG_NONE = 0x0,
1824 D3D12_MULTIPLE_FENCE_WAIT_FLAG_ANY = 0x1,
1825 D3D12_MULTIPLE_FENCE_WAIT_FLAG_ALL = 0x0,
1826} D3D12_MULTIPLE_FENCE_WAIT_FLAGS;
1827cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_MULTIPLE_FENCE_WAIT_FLAGS);")
1828
1829typedef enum D3D12_RESIDENCY_PRIORITY
1830{
1831 D3D12_RESIDENCY_PRIORITY_MINIMUM = 0x28000000,
1832 D3D12_RESIDENCY_PRIORITY_LOW = 0x50000000,
1833 D3D12_RESIDENCY_PRIORITY_NORMAL = 0x78000000,
1834 D3D12_RESIDENCY_PRIORITY_HIGH = 0xa0010000,
1835 D3D12_RESIDENCY_PRIORITY_MAXIMUM = 0xc8000000,
1836} D3D12_RESIDENCY_PRIORITY;
1837
1838typedef struct D3D12_WRITEBUFFERIMMEDIATE_PARAMETER
1839{
1840 D3D12_GPU_VIRTUAL_ADDRESS Dest;
1841 UINT32 Value;
1842} D3D12_WRITEBUFFERIMMEDIATE_PARAMETER;
1843
1844[
1845 uuid(c4fec28f-7966-4e95-9f94-f431cb56c3b8),
1846 object,
1847 local,
1848 pointer_default(unique)
1849]
1850interface ID3D12Object : IUnknown
1851{
1852 HRESULT GetPrivateData(REFGUID guid, UINT *data_size, void *data);
1853 HRESULT SetPrivateData(REFGUID guid, UINT data_size, const void *data);
1854 HRESULT SetPrivateDataInterface(REFGUID guid, const IUnknown *data);
1855 HRESULT SetName(const WCHAR *name);
1856}
1857
1858[
1859 uuid(905db94b-a00c-4140-9df5-2b64ca9ea357),
1860 object,
1861 local,
1862 pointer_default(unique)
1863]
1864interface ID3D12DeviceChild : ID3D12Object
1865{
1866 HRESULT GetDevice(REFIID riid, void **device);
1867}
1868
1869[
1870 uuid(63ee58fb-1268-4835-86da-f008ce62f0d6),
1871 object,
1872 local,
1873 pointer_default(unique)
1874]
1875interface ID3D12Pageable : ID3D12DeviceChild
1876{
1877}
1878
1879[
1880 uuid(6b3b2502-6e51-45b3-90ee-9884265e8df3),
1881 object,
1882 local,
1883 pointer_default(unique)
1884]
1885interface ID3D12Heap : ID3D12Pageable
1886{
1887 D3D12_HEAP_DESC GetDesc();
1888}
1889
1890[
1891 uuid(696442be-a72e-4059-bc79-5b5c98040fad),
1892 object,
1893 local,
1894 pointer_default(unique)
1895]
1896interface ID3D12Resource : ID3D12Pageable
1897{
1898 HRESULT Map(UINT sub_resource, const D3D12_RANGE *read_range, void **data);
1899 void Unmap(UINT sub_resource, const D3D12_RANGE *written_range);
1900
1901 D3D12_RESOURCE_DESC GetDesc();
1902
1903 D3D12_GPU_VIRTUAL_ADDRESS GetGPUVirtualAddress();
1904
1905 HRESULT WriteToSubresource(UINT dst_sub_resource, const D3D12_BOX *dst_box,
1906 const void *src_data, UINT src_row_pitch, UINT src_slice_pitch);
1907 HRESULT ReadFromSubresource(void *dst_data, UINT dst_row_pitch, UINT dst_slice_pitch,
1908 UINT src_sub_resource, const D3D12_BOX *src_box);
1909
1910 HRESULT GetHeapProperties(D3D12_HEAP_PROPERTIES *heap_properties, D3D12_HEAP_FLAGS *flags);
1911}
1912
1913[
1914 uuid(7116d91c-e7e4-47ce-b8c6-ec8168f437e5),
1915 object,
1916 local,
1917 pointer_default(unique)
1918]
1919interface ID3D12CommandList : ID3D12DeviceChild
1920{
1921 D3D12_COMMAND_LIST_TYPE GetType();
1922}
1923
1924typedef enum D3D12_TILE_COPY_FLAGS
1925{
1926 D3D12_TILE_COPY_FLAG_NONE = 0x0,
1927 D3D12_TILE_COPY_FLAG_NO_HAZARD = 0x1,
1928 D3D12_TILE_COPY_FLAG_LINEAR_BUFFER_TO_SWIZZLED_TILED_RESOURCE = 0x2,
1929 D3D12_TILE_COPY_FLAG_SWIZZLED_TILED_RESOURCE_TO_LINEAR_BUFFER = 0x4,
1930} D3D12_TILE_COPY_FLAGS;
1931cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_TILE_COPY_FLAGS);")
1932
1933typedef struct D3D12_INDEX_BUFFER_VIEW
1934{
1935 D3D12_GPU_VIRTUAL_ADDRESS BufferLocation;
1936 UINT SizeInBytes;
1937 DXGI_FORMAT Format;
1938} D3D12_INDEX_BUFFER_VIEW;
1939
1940typedef struct D3D12_VERTEX_BUFFER_VIEW
1941{
1942 D3D12_GPU_VIRTUAL_ADDRESS BufferLocation;
1943 UINT SizeInBytes;
1944 UINT StrideInBytes;
1945} D3D12_VERTEX_BUFFER_VIEW;
1946
1947typedef struct D3D12_STREAM_OUTPUT_BUFFER_VIEW
1948{
1949 D3D12_GPU_VIRTUAL_ADDRESS BufferLocation;
1950 UINT64 SizeInBytes;
1951 D3D12_GPU_VIRTUAL_ADDRESS BufferFilledSizeLocation;
1952} D3D12_STREAM_OUTPUT_BUFFER_VIEW;
1953
1954typedef enum D3D12_CLEAR_FLAGS
1955{
1956 D3D12_CLEAR_FLAG_DEPTH = 0x1,
1957 D3D12_CLEAR_FLAG_STENCIL = 0x2,
1958} D3D12_CLEAR_FLAGS;
1959cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_CLEAR_FLAGS);")
1960
1961typedef struct D3D12_DISCARD_REGION
1962{
1963 UINT NumRects;
1964 const D3D12_RECT *pRects;
1965 UINT FirstSubresource;
1966 UINT NumSubresources;
1967} D3D12_DISCARD_REGION;
1968
1969typedef enum D3D12_QUERY_TYPE
1970{
1971 D3D12_QUERY_TYPE_OCCLUSION = 0,
1972 D3D12_QUERY_TYPE_BINARY_OCCLUSION = 1,
1973 D3D12_QUERY_TYPE_TIMESTAMP = 2,
1974 D3D12_QUERY_TYPE_PIPELINE_STATISTICS = 3,
1975 D3D12_QUERY_TYPE_SO_STATISTICS_STREAM0 = 4,
1976 D3D12_QUERY_TYPE_SO_STATISTICS_STREAM1 = 5,
1977 D3D12_QUERY_TYPE_SO_STATISTICS_STREAM2 = 6,
1978 D3D12_QUERY_TYPE_SO_STATISTICS_STREAM3 = 7,
1979} D3D12_QUERY_TYPE;
1980
1981typedef struct D3D12_QUERY_DATA_PIPELINE_STATISTICS
1982{
1983 UINT64 IAVertices;
1984 UINT64 IAPrimitives;
1985 UINT64 VSInvocations;
1986 UINT64 GSInvocations;
1987 UINT64 GSPrimitives;
1988 UINT64 CInvocations;
1989 UINT64 CPrimitives;
1990 UINT64 PSInvocations;
1991 UINT64 HSInvocations;
1992 UINT64 DSInvocations;
1993 UINT64 CSInvocations;
1994} D3D12_QUERY_DATA_PIPELINE_STATISTICS;
1995
1996typedef struct D3D12_QUERY_DATA_SO_STATISTICS
1997{
1998 UINT64 NumPrimitivesWritten;
1999 UINT64 PrimitivesStorageNeeded;
2000} D3D12_QUERY_DATA_SO_STATISTICS;
2001
2002typedef enum D3D12_PREDICATION_OP
2003{
2004 D3D12_PREDICATION_OP_EQUAL_ZERO = 0,
2005 D3D12_PREDICATION_OP_NOT_EQUAL_ZERO = 1,
2006} D3D12_PREDICATION_OP;
2007
2008[
2009 uuid(8efb471d-616c-4f49-90f7-127bb763fa51),
2010 object,
2011 local,
2012 pointer_default(unique)
2013]
2014interface ID3D12DescriptorHeap : ID3D12Pageable
2015{
2016 D3D12_DESCRIPTOR_HEAP_DESC GetDesc();
2017
2018 D3D12_CPU_DESCRIPTOR_HANDLE GetCPUDescriptorHandleForHeapStart();
2019 D3D12_GPU_DESCRIPTOR_HANDLE GetGPUDescriptorHandleForHeapStart();
2020}
2021
2022[
2023 uuid(0d9658ae-ed45-469e-a61d-970ec583cab4),
2024 object,
2025 local,
2026 pointer_default(unique)
2027]
2028interface ID3D12QueryHeap : ID3D12Pageable
2029{
2030}
2031
2032[
2033 uuid(c36a797c-ec80-4f0a-8985-a7b2475082d1),
2034 object,
2035 local,
2036 pointer_default(unique)
2037]
2038interface ID3D12CommandSignature : ID3D12Pageable
2039{
2040}
2041
2042[
2043 uuid(5b160d0f-ac1b-4185-8ba8-b3ae42a5a455),
2044 object,
2045 local,
2046 pointer_default(unique)
2047]
2048interface ID3D12GraphicsCommandList : ID3D12CommandList
2049{
2050 HRESULT Close();
2051
2052 HRESULT Reset(ID3D12CommandAllocator *allocator, ID3D12PipelineState *initial_state);
2053
2054 HRESULT ClearState(ID3D12PipelineState *pipeline_state);
2055
2056 void DrawInstanced(UINT vertex_count_per_instance, UINT instance_count,
2057 UINT start_vertex_location, UINT start_instance_location);
2058 void DrawIndexedInstanced(UINT index_count_per_instance, UINT instance_count,
2059 UINT start_vertex_location, INT base_vertex_location, UINT start_instance_location);
2060
2061 void Dispatch(UINT x, UINT u, UINT z);
2062
2063 void CopyBufferRegion(ID3D12Resource *dst_buffer, UINT64 dst_offset,
2064 ID3D12Resource *src_buffer, UINT64 src_offset, UINT64 byte_count);
2065 void CopyTextureRegion(const D3D12_TEXTURE_COPY_LOCATION *dst,
2066 UINT dst_x, UINT dst_y, UINT dst_z,
2067 const D3D12_TEXTURE_COPY_LOCATION *src, const D3D12_BOX *src_box);
2068 void CopyResource(ID3D12Resource *dst_resource, ID3D12Resource *src_resource);
2069
2070 void CopyTiles(ID3D12Resource *tiled_resource,
2071 const D3D12_TILED_RESOURCE_COORDINATE *tile_region_start_coordinate,
2072 const D3D12_TILE_REGION_SIZE *tile_region_size,
2073 ID3D12Resource *buffer,
2074 UINT64 buffer_offset,
2075 D3D12_TILE_COPY_FLAGS flags);
2076
2077 void ResolveSubresource(ID3D12Resource *dst_resource, UINT dst_sub_resource,
2078 ID3D12Resource *src_resource, UINT src_sub_resource,
2079 DXGI_FORMAT format);
2080
2081 void IASetPrimitiveTopology(D3D12_PRIMITIVE_TOPOLOGY primitive_topology);
2082
2083 void RSSetViewports(UINT viewport_count, const D3D12_VIEWPORT *viewports);
2084 void RSSetScissorRects(UINT rect_count, const D3D12_RECT *rects);
2085
2086 void OMSetBlendFactor(const FLOAT blend_factor[4]);
2087 void OMSetStencilRef(UINT stencil_ref);
2088
2089 void SetPipelineState(ID3D12PipelineState *pipeline_state);
2090
2091 void ResourceBarrier(UINT barrier_count, const D3D12_RESOURCE_BARRIER *barriers);
2092
2093 void ExecuteBundle(ID3D12GraphicsCommandList *command_list);
2094
2095 void SetDescriptorHeaps(UINT heap_count, ID3D12DescriptorHeap * const *heaps);
2096
2097 void SetComputeRootSignature(ID3D12RootSignature *root_signature);
2098 void SetGraphicsRootSignature(ID3D12RootSignature *root_signature);
2099
2100 void SetComputeRootDescriptorTable(UINT root_parameter_index, D3D12_GPU_DESCRIPTOR_HANDLE base_descriptor);
2101 void SetGraphicsRootDescriptorTable(UINT root_parameter_index, D3D12_GPU_DESCRIPTOR_HANDLE base_descriptor);
2102
2103 void SetComputeRoot32BitConstant(UINT root_parameter_index, UINT data, UINT dst_offset);
2104 void SetGraphicsRoot32BitConstant(UINT root_parameter_index, UINT data, UINT dst_offset);
2105
2106 void SetComputeRoot32BitConstants(UINT root_parameter_index, UINT constant_count, const void *data,
2107 UINT dst_offset);
2108 void SetGraphicsRoot32BitConstants(UINT root_parameter_index, UINT constant_count, const void *data,
2109 UINT dst_offset);
2110
2111 void SetComputeRootConstantBufferView(UINT root_parameter_index, D3D12_GPU_VIRTUAL_ADDRESS address);
2112 void SetGraphicsRootConstantBufferView(UINT root_parameter_index, D3D12_GPU_VIRTUAL_ADDRESS address);
2113
2114 void SetComputeRootShaderResourceView(UINT root_parameter_index, D3D12_GPU_VIRTUAL_ADDRESS address);
2115 void SetGraphicsRootShaderResourceView(UINT root_parameter_index, D3D12_GPU_VIRTUAL_ADDRESS address);
2116
2117 void SetComputeRootUnorderedAccessView(UINT root_parameter_index, D3D12_GPU_VIRTUAL_ADDRESS address);
2118 void SetGraphicsRootUnorderedAccessView(UINT root_parameter_index, D3D12_GPU_VIRTUAL_ADDRESS address);
2119
2120 void IASetIndexBuffer(const D3D12_INDEX_BUFFER_VIEW *view);
2121 void IASetVertexBuffers(UINT start_slot, UINT view_count, const D3D12_VERTEX_BUFFER_VIEW *views);
2122
2123 void SOSetTargets(UINT start_slot, UINT view_count, const D3D12_STREAM_OUTPUT_BUFFER_VIEW *views);
2124
2125 void OMSetRenderTargets(UINT render_target_descriptor_count,
2126 const D3D12_CPU_DESCRIPTOR_HANDLE *render_target_descriptors,
2127 BOOL single_descriptor_handle,
2128 const D3D12_CPU_DESCRIPTOR_HANDLE *depth_stencil_descriptor);
2129
2130 void ClearDepthStencilView(D3D12_CPU_DESCRIPTOR_HANDLE dsv, D3D12_CLEAR_FLAGS flags,
2131 FLOAT depth, UINT8 stencil, UINT rect_count, const D3D12_RECT *rects);
2132 void ClearRenderTargetView(D3D12_CPU_DESCRIPTOR_HANDLE rtv, const FLOAT color[4],
2133 UINT rect_count, const D3D12_RECT *rects);
2134 void ClearUnorderedAccessViewUint(D3D12_GPU_DESCRIPTOR_HANDLE gpu_handle,
2135 D3D12_CPU_DESCRIPTOR_HANDLE cpu_handle, ID3D12Resource *resource, const UINT values[4],
2136 UINT rect_count, const D3D12_RECT *rects);
2137 void ClearUnorderedAccessViewFloat(D3D12_GPU_DESCRIPTOR_HANDLE gpu_handle,
2138 D3D12_CPU_DESCRIPTOR_HANDLE cpu_handle, ID3D12Resource *resource, const float values[4],
2139 UINT rect_count, const D3D12_RECT *rects);
2140
2141 void DiscardResource(ID3D12Resource *resource, const D3D12_DISCARD_REGION *region);
2142
2143 void BeginQuery(ID3D12QueryHeap *heap, D3D12_QUERY_TYPE type, UINT index);
2144 void EndQuery(ID3D12QueryHeap *heap, D3D12_QUERY_TYPE type, UINT index);
2145 void ResolveQueryData(ID3D12QueryHeap *heap, D3D12_QUERY_TYPE type,
2146 UINT start_index, UINT query_count,
2147 ID3D12Resource *dst_buffer, UINT64 aligned_dst_buffer_offset);
2148
2149 void SetPredication(ID3D12Resource *buffer, UINT64 aligned_buffer_offset,
2150 D3D12_PREDICATION_OP operation);
2151
2152 void SetMarker(UINT metadata, const void *data, UINT size);
2153 void BeginEvent(UINT metadata, const void *data, UINT size);
2154 void EndEvent();
2155
2156 void ExecuteIndirect(ID3D12CommandSignature *command_signature,
2157 UINT max_command_count, ID3D12Resource *arg_buffer, UINT64 arg_buffer_offset,
2158 ID3D12Resource *count_buffer, UINT64 count_buffer_offset);
2159}
2160
2161[
2162 uuid(553103fb-1fe7-4557-bb38-946d7d0e7ca7),
2163 object,
2164 local,
2165 pointer_default(unique)
2166]
2167interface ID3D12GraphicsCommandList1 : ID3D12GraphicsCommandList
2168{
2169 void AtomicCopyBufferUINT(ID3D12Resource *dst_buffer, UINT64 dst_offset,
2170 ID3D12Resource *src_buffer, UINT64 src_offset,
2171 UINT dependent_resource_count, ID3D12Resource * const *dependent_resources,
2172 const D3D12_SUBRESOURCE_RANGE_UINT64 *dependent_sub_resource_ranges);
2173
2174 void AtomicCopyBufferUINT64(ID3D12Resource *dst_buffer, UINT64 dst_offset,
2175 ID3D12Resource *src_buffer, UINT64 src_offset,
2176 UINT dependent_resource_count, ID3D12Resource * const *dependent_resources,
2177 const D3D12_SUBRESOURCE_RANGE_UINT64 *dependent_sub_resource_ranges);
2178
2179 void OMSetDepthBounds(FLOAT min, FLOAT max);
2180
2181 void SetSamplePositions(UINT sample_count, UINT pixel_count,
2182 D3D12_SAMPLE_POSITION *sample_positions);
2183
2184 void ResolveSubresourceRegion(ID3D12Resource *dst_resource,
2185 UINT dst_sub_resource_idx, UINT dst_x, UINT dst_y,
2186 ID3D12Resource *src_resource, UINT src_sub_resource_idx,
2187 D3D12_RECT *src_rect, DXGI_FORMAT format, D3D12_RESOLVE_MODE mode);
2188
2189 void SetViewInstanceMask(UINT mask);
2190}
2191
2192[
2193 uuid(38c3e585-ff17-412c-9150-4fc6f9d72a28),
2194 object,
2195 local,
2196 pointer_default(unique)
2197]
2198interface ID3D12GraphicsCommandList2 : ID3D12GraphicsCommandList1
2199{
2200 void WriteBufferImmediate(UINT count,
2201 const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *parameters,
2202 const D3D12_WRITEBUFFERIMMEDIATE_MODE *modes);
2203}
2204
2205typedef enum D3D12_TILE_RANGE_FLAGS
2206{
2207 D3D12_TILE_RANGE_FLAG_NONE = 0x0,
2208 D3D12_TILE_RANGE_FLAG_NULL = 0x1,
2209 D3D12_TILE_RANGE_FLAG_SKIP = 0x2,
2210 D3D12_TILE_RANGE_FLAG_REUSE_SINGLE_TILE = 0x4
2211} D3D12_TILE_RANGE_FLAGS;
2212
2213typedef enum D3D12_TILE_MAPPING_FLAGS
2214{
2215 D3D12_TILE_MAPPING_FLAG_NONE = 0x0,
2216 D3D12_TILE_MAPPING_FLAG_NO_HAZARD = 0x1,
2217} D3D12_TILE_MAPPING_FLAGS;
2218cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_TILE_MAPPING_FLAGS);")
2219
2220[
2221 uuid(0ec870a6-5d7e-4c22-8cfc-5baae07616ed),
2222 object,
2223 local,
2224 pointer_default(unique)
2225]
2226interface ID3D12CommandQueue : ID3D12Pageable
2227{
2228 void UpdateTileMappings(ID3D12Resource *resource, UINT region_count,
2229 const D3D12_TILED_RESOURCE_COORDINATE *region_start_coordinates,
2230 const D3D12_TILE_REGION_SIZE *region_sizes,
2231 UINT range_count,
2232 const D3D12_TILE_RANGE_FLAGS *range_flags,
2233 UINT *heap_range_offsets,
2234 UINT *range_tile_counts,
2235 D3D12_TILE_MAPPING_FLAGS flags);
2236
2237 void CopyTileMappings(ID3D12Resource *dst_resource,
2238 const D3D12_TILED_RESOURCE_COORDINATE *dst_region_start_coordinate,
2239 ID3D12Resource *src_resource,
2240 const D3D12_TILED_RESOURCE_COORDINATE *src_region_start_coordinate,
2241 const D3D12_TILE_REGION_SIZE *region_size,
2242 D3D12_TILE_MAPPING_FLAGS flags);
2243
2244 void ExecuteCommandLists(UINT command_list_count,
2245 ID3D12CommandList * const * command_lists);
2246
2247 void SetMarker(UINT metadata, const void *data, UINT size);
2248 void BeginEvent(UINT metadata, const void *data, UINT size);
2249 void EndEvent();
2250
2251 HRESULT Signal(ID3D12Fence *fence, UINT64 value);
2252 HRESULT Wait(ID3D12Fence *fence, UINT64 value);
2253
2254 HRESULT GetTimestampFrequency(UINT64 *frequency);
2255 HRESULT GetClockCalibration(UINT64 *gpu_timestamp, UINT64 *cpu_timestamp);
2256
2257 D3D12_COMMAND_QUEUE_DESC GetDesc();
2258}
2259
2260typedef enum D3D12_FENCE_FLAGS
2261{
2262 D3D12_FENCE_FLAG_NONE = 0x0,
2263 D3D12_FENCE_FLAG_SHARED = 0x1,
2264 D3D12_FENCE_FLAG_SHARED_CROSS_ADAPTER = 0x2,
2265} D3D12_FENCE_FLAGS;
2266cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_FENCE_FLAGS);")
2267
2268typedef enum D3D12_QUERY_HEAP_TYPE
2269{
2270 D3D12_QUERY_HEAP_TYPE_OCCLUSION = 0,
2271 D3D12_QUERY_HEAP_TYPE_TIMESTAMP = 1,
2272 D3D12_QUERY_HEAP_TYPE_PIPELINE_STATISTICS = 2,
2273 D3D12_QUERY_HEAP_TYPE_SO_STATISTICS = 3,
2274} D3D12_QUERY_HEAP_TYPE;
2275
2276typedef struct D3D12_QUERY_HEAP_DESC
2277{
2278 D3D12_QUERY_HEAP_TYPE Type;
2279 UINT Count;
2280 UINT NodeMask;
2281} D3D12_QUERY_HEAP_DESC;
2282
2283typedef enum D3D12_INDIRECT_ARGUMENT_TYPE
2284{
2285 D3D12_INDIRECT_ARGUMENT_TYPE_DRAW,
2286 D3D12_INDIRECT_ARGUMENT_TYPE_DRAW_INDEXED,
2287 D3D12_INDIRECT_ARGUMENT_TYPE_DISPATCH,
2288 D3D12_INDIRECT_ARGUMENT_TYPE_VERTEX_BUFFER_VIEW,
2289 D3D12_INDIRECT_ARGUMENT_TYPE_INDEX_BUFFER_VIEW,
2290 D3D12_INDIRECT_ARGUMENT_TYPE_CONSTANT,
2291 D3D12_INDIRECT_ARGUMENT_TYPE_CONSTANT_BUFFER_VIEW,
2292 D3D12_INDIRECT_ARGUMENT_TYPE_SHADER_RESOURCE_VIEW,
2293 D3D12_INDIRECT_ARGUMENT_TYPE_UNORDERED_ACCESS_VIEW,
2294} D3D12_INDIRECT_ARGUMENT_TYPE;
2295
2296typedef struct D3D12_INDIRECT_ARGUMENT_DESC
2297{
2298 D3D12_INDIRECT_ARGUMENT_TYPE Type;
2299 union
2300 {
2301 struct
2302 {
2303 UINT Slot;
2304 } VertexBuffer;
2305 struct
2306 {
2307 UINT RootParameterIndex;
2308 UINT DestOffsetIn32BitValues;
2309 UINT Num32BitValuesToSet;
2310 } Constant;
2311 struct
2312 {
2313 UINT RootParameterIndex;
2314 } ConstantBufferView;
2315 struct
2316 {
2317 UINT RootParameterIndex;
2318 } ShaderResourceView;
2319 struct
2320 {
2321 UINT RootParameterIndex;
2322 } UnorderedAccessView;
2323 };
2324} D3D12_INDIRECT_ARGUMENT_DESC;
2325
2326typedef struct D3D12_COMMAND_SIGNATURE_DESC
2327{
2328 UINT ByteStride;
2329 UINT NumArgumentDescs;
2330 const D3D12_INDIRECT_ARGUMENT_DESC *pArgumentDescs;
2331 UINT NodeMask;
2332} D3D12_COMMAND_SIGNATURE_DESC;
2333
2334[
2335 uuid(c54a6b66-72df-4ee8-8be5-a946a1429214),
2336 object,
2337 local,
2338 pointer_default(unique)
2339]
2340interface ID3D12RootSignature : ID3D12DeviceChild
2341{
2342}
2343
2344[
2345 uuid(765a30f3-f624-4c6f-a828-ace948622445),
2346 object,
2347 local,
2348 pointer_default(unique)
2349]
2350interface ID3D12PipelineState : ID3D12Pageable
2351{
2352 HRESULT GetCachedBlob(ID3DBlob **blob);
2353}
2354
2355[
2356 uuid(0a753dcf-c4d8-4b91-adf6-be5a60d95a76),
2357 object,
2358 local,
2359 pointer_default(unique)
2360]
2361interface ID3D12Fence : ID3D12Pageable
2362{
2363 UINT64 GetCompletedValue();
2364 HRESULT SetEventOnCompletion(UINT64 value, HANDLE event);
2365 HRESULT Signal(UINT64 value);
2366}
2367
2368[
2369 uuid(6102dee4-af59-4b09-b999-b44d73f09b24),
2370 object,
2371 local,
2372 pointer_default(unique)
2373]
2374interface ID3D12CommandAllocator : ID3D12Pageable
2375{
2376 HRESULT Reset();
2377}
2378
2379[
2380 uuid(189819f1-1db6-4b57-be54-1821339b85f7),
2381 object,
2382 local,
2383 pointer_default(unique)
2384]
2385interface ID3D12Device : ID3D12Object
2386{
2387 UINT GetNodeCount();
2388
2389 HRESULT CreateCommandQueue(const D3D12_COMMAND_QUEUE_DESC *desc,
2390 REFIID riid, void **command_queue);
2391 HRESULT CreateCommandAllocator(D3D12_COMMAND_LIST_TYPE type,
2392 REFIID riid, void **command_allocator);
2393 HRESULT CreateGraphicsPipelineState(const D3D12_GRAPHICS_PIPELINE_STATE_DESC *desc,
2394 REFIID riid, void **pipeline_state);
2395 HRESULT CreateComputePipelineState(const D3D12_COMPUTE_PIPELINE_STATE_DESC *desc,
2396 REFIID riid, void **pipeline_state);
2397 HRESULT CreateCommandList(UINT node_mask,
2398 D3D12_COMMAND_LIST_TYPE type,
2399 ID3D12CommandAllocator *command_allocator,
2400 ID3D12PipelineState *initial_pipeline_state,
2401 REFIID riid, void **command_list);
2402
2403 HRESULT CheckFeatureSupport(D3D12_FEATURE feature,
2404 void *feature_data, UINT feature_data_size);
2405
2406 HRESULT CreateDescriptorHeap(const D3D12_DESCRIPTOR_HEAP_DESC *desc,
2407 REFIID riid, void **descriptor_heap);
2408 UINT GetDescriptorHandleIncrementSize(D3D12_DESCRIPTOR_HEAP_TYPE descriptor_heap_type);
2409
2410 HRESULT CreateRootSignature(UINT node_mask,
2411 const void *bytecode, SIZE_T bytecode_length,
2412 REFIID riid, void **root_signature);
2413
2414 void CreateConstantBufferView(const D3D12_CONSTANT_BUFFER_VIEW_DESC *desc,
2415 D3D12_CPU_DESCRIPTOR_HANDLE descriptor);
2416 void CreateShaderResourceView(ID3D12Resource *resource,
2417 const D3D12_SHADER_RESOURCE_VIEW_DESC *desc,
2418 D3D12_CPU_DESCRIPTOR_HANDLE descriptor);
2419 void CreateUnorderedAccessView(ID3D12Resource *resource, ID3D12Resource *counter_resource,
2420 const D3D12_UNORDERED_ACCESS_VIEW_DESC *desc,
2421 D3D12_CPU_DESCRIPTOR_HANDLE descriptor);
2422 void CreateRenderTargetView(ID3D12Resource *resource,
2423 const D3D12_RENDER_TARGET_VIEW_DESC *desc,
2424 D3D12_CPU_DESCRIPTOR_HANDLE descriptor);
2425 void CreateDepthStencilView(ID3D12Resource *resource,
2426 const D3D12_DEPTH_STENCIL_VIEW_DESC *desc,
2427 D3D12_CPU_DESCRIPTOR_HANDLE descriptor);
2428 void CreateSampler(const D3D12_SAMPLER_DESC *desc,
2429 D3D12_CPU_DESCRIPTOR_HANDLE descriptor);
2430
2431 void CopyDescriptors(UINT dst_descriptor_range_count,
2432 const D3D12_CPU_DESCRIPTOR_HANDLE *dst_descriptor_range_offsets,
2433 const UINT *dst_descriptor_range_sizes,
2434 UINT src_descriptor_range_count,
2435 const D3D12_CPU_DESCRIPTOR_HANDLE *src_descriptor_range_offsets,
2436 const UINT *src_descriptor_range_sizes,
2437 D3D12_DESCRIPTOR_HEAP_TYPE descriptor_heap_type);
2438 void CopyDescriptorsSimple(UINT descriptor_count,
2439 const D3D12_CPU_DESCRIPTOR_HANDLE dst_descriptor_range_offset,
2440 const D3D12_CPU_DESCRIPTOR_HANDLE src_descriptor_range_offset,
2441 D3D12_DESCRIPTOR_HEAP_TYPE descriptor_heap_type);
2442
2443 D3D12_RESOURCE_ALLOCATION_INFO GetResourceAllocationInfo(UINT visible_mask,
2444 UINT reource_desc_count, const D3D12_RESOURCE_DESC *resource_descs);
2445
2446 D3D12_HEAP_PROPERTIES GetCustomHeapProperties(UINT node_mask,
2447 D3D12_HEAP_TYPE heap_type);
2448
2449 HRESULT CreateCommittedResource(const D3D12_HEAP_PROPERTIES *heap_properties, D3D12_HEAP_FLAGS heap_flags,
2450 const D3D12_RESOURCE_DESC *desc, D3D12_RESOURCE_STATES initial_state,
2451 const D3D12_CLEAR_VALUE *optimized_clear_value,
2452 REFIID riid, void **resource);
2453
2454 HRESULT CreateHeap(const D3D12_HEAP_DESC *desc, REFIID riid, void **heap);
2455
2456 HRESULT CreatePlacedResource(ID3D12Heap *heap, UINT64 heap_offset,
2457 const D3D12_RESOURCE_DESC *desc, D3D12_RESOURCE_STATES initial_state,
2458 const D3D12_CLEAR_VALUE *optimized_clear_value,
2459 REFIID riid, void **resource);
2460 HRESULT CreateReservedResource(const D3D12_RESOURCE_DESC *desc, D3D12_RESOURCE_STATES initial_state,
2461 const D3D12_CLEAR_VALUE *optimized_clear_value,
2462 REFIID riid, void **resource);
2463
2464 HRESULT CreateSharedHandle(ID3D12DeviceChild *object,
2465 const SECURITY_ATTRIBUTES *attributes, DWORD access,
2466 const WCHAR *name, HANDLE *handle);
2467 HRESULT OpenSharedHandle(HANDLE handle,
2468 REFIID riid, void **object);
2469 HRESULT OpenSharedHandleByName(const WCHAR *name, DWORD access, HANDLE *handle);
2470
2471 HRESULT MakeResident(UINT object_count, ID3D12Pageable * const *objects);
2472 HRESULT Evict(UINT object_count, ID3D12Pageable * const *objects);
2473
2474 HRESULT CreateFence(UINT64 initial_value, D3D12_FENCE_FLAGS flags, REFIID riid, void **fence);
2475
2476 HRESULT GetDeviceRemovedReason();
2477
2478 void GetCopyableFootprints(const D3D12_RESOURCE_DESC *desc,
2479 UINT first_sub_resource,
2480 UINT sub_resource_count,
2481 UINT64 base_offset,
2482 D3D12_PLACED_SUBRESOURCE_FOOTPRINT *layouts,
2483 UINT *row_count,
2484 UINT64 *row_size,
2485 UINT64 *total_bytes);
2486
2487 HRESULT CreateQueryHeap(const D3D12_QUERY_HEAP_DESC *desc,
2488 REFIID riid, void **heap);
2489
2490 HRESULT SetStablePowerState(BOOL enable);
2491
2492 HRESULT CreateCommandSignature(const D3D12_COMMAND_SIGNATURE_DESC *desc,
2493 ID3D12RootSignature *root_signature,
2494 REFIID riid, void **command_signature);
2495
2496 void GetResourceTiling(ID3D12Resource *resource,
2497 UINT *total_tile_count,
2498 D3D12_PACKED_MIP_INFO *packed_mip_info,
2499 D3D12_TILE_SHAPE *standard_tile_shape,
2500 UINT *sub_resource_tiling_count,
2501 UINT first_sub_resource_tiling,
2502 D3D12_SUBRESOURCE_TILING *sub_resource_tilings);
2503
2504 LUID GetAdapterLuid();
2505}
2506
2507[
2508 uuid(77acce80-638e-4e65-8895-c1f23386863e),
2509 object,
2510 local,
2511 pointer_default(unique)
2512]
2513interface ID3D12Device1 : ID3D12Device
2514{
2515 HRESULT CreatePipelineLibrary(const void *blob, SIZE_T blob_size, REFIID iid, void **lib);
2516
2517 HRESULT SetEventOnMultipleFenceCompletion(ID3D12Fence * const *fences,
2518 const UINT64 *values, UINT fence_count, D3D12_MULTIPLE_FENCE_WAIT_FLAGS flags, HANDLE event);
2519
2520 HRESULT SetResidencyPriority(UINT object_count, ID3D12Pageable * const *objects,
2521 const D3D12_RESIDENCY_PRIORITY *priorities);
2522}
2523
2524[
2525 uuid(34ab647b-3cc8-46ac-841b-c0965645c046),
2526 object,
2527 local,
2528 pointer_default(unique)
2529]
2530interface ID3D12RootSignatureDeserializer : IUnknown
2531{
2532 const D3D12_ROOT_SIGNATURE_DESC *GetRootSignatureDesc();
2533}
2534
2535[
2536 uuid(7f91ce67-090c-4bb7-b78e-ed8ff2e31da0),
2537 object,
2538 local,
2539 pointer_default(unique)
2540]
2541interface ID3D12VersionedRootSignatureDeserializer : IUnknown
2542{
2543 HRESULT GetRootSignatureDescAtVersion(D3D_ROOT_SIGNATURE_VERSION version,
2544 const D3D12_VERSIONED_ROOT_SIGNATURE_DESC **desc);
2545
2546 const D3D12_VERSIONED_ROOT_SIGNATURE_DESC *GetUnconvertedRootSignatureDesc();
2547};
2548
2549[local] HRESULT __stdcall D3D12CreateRootSignatureDeserializer(
2550 const void *data, SIZE_T data_size, REFIID iid, void **deserializer);
2551
2552typedef HRESULT (__stdcall *PFN_D3D12_CREATE_VERSIONED_ROOT_SIGNATURE_DESERIALIZER)(
2553 const void *data, SIZE_T data_size, REFIID iid, void **deserializer);
2554
2555[local] HRESULT __stdcall D3D12CreateVersionedRootSignatureDeserializer(
2556 const void *data, SIZE_T data_size, REFIID iid, void **deserializer);
2557
2558[local] HRESULT __stdcall D3D12SerializeRootSignature(
2559 const D3D12_ROOT_SIGNATURE_DESC *root_signature_desc,
2560 D3D_ROOT_SIGNATURE_VERSION version, ID3DBlob **blob, ID3DBlob **error_blob);
2561
2562typedef HRESULT (__stdcall *PFN_D3D12_SERIALIZE_VERSIONED_ROOT_SIGNATURE)(
2563 const D3D12_VERSIONED_ROOT_SIGNATURE_DESC *desc, ID3DBlob **blob, ID3DBlob **error_blob);
2564
2565[local] HRESULT __stdcall D3D12SerializeVersionedRootSignature(
2566 const D3D12_VERSIONED_ROOT_SIGNATURE_DESC *root_signature_desc,
2567 ID3DBlob **blob, ID3DBlob **error_blob);
2568
2569typedef HRESULT (__stdcall *PFN_D3D12_CREATE_DEVICE)(IUnknown *adapter,
2570 D3D_FEATURE_LEVEL minimum_feature_level, REFIID iid, void **device);
2571
2572[local] HRESULT __stdcall D3D12CreateDevice(IUnknown *adapter,
2573 D3D_FEATURE_LEVEL minimum_feature_level, REFIID iid, void **device);
2574
2575typedef HRESULT (__stdcall *PFN_D3D12_GET_DEBUG_INTERFACE)(REFIID iid, void **debug);
2576
2577[local] HRESULT __stdcall D3D12GetDebugInterface(REFIID iid, void **debug);
2578
2579[local] HRESULT __stdcall D3D12EnableExperimentalFeatures(UINT feature_count,
2580 const IID *iids, void *configurations, UINT *configurations_sizes);
Note: See TracBrowser for help on using the repository browser.