-
Notifications
You must be signed in to change notification settings - Fork 2
/
mz_d3d12.h
3349 lines (3064 loc) · 154 KB
/
mz_d3d12.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#ifndef MZ_D3D12_INCLUDED_
#define MZ_D3D12_INCLUDED_
#include "mz_tinywin.h"
typedef struct IUnknown IUnknown;
typedef struct ID3DBlob ID3DBlob;
typedef struct ID3D12Object ID3D12Object;
typedef struct ID3D12DeviceChild ID3D12DeviceChild;
typedef struct ID3D12RootSignature ID3D12RootSignature;
typedef struct ID3D12Pageable ID3D12Pageable;
typedef struct ID3D12Heap ID3D12Heap;
typedef struct ID3D12Resource ID3D12Resource;
typedef struct ID3D12CommandAllocator ID3D12CommandAllocator;
typedef struct ID3D12Fence ID3D12Fence;
typedef struct ID3D12PipelineState ID3D12PipelineState;
typedef struct ID3D12DescriptorHeap ID3D12DescriptorHeap;
typedef struct ID3D12QueryHeap ID3D12QueryHeap;
typedef struct ID3D12CommandSignature ID3D12CommandSignature;
typedef struct ID3D12CommandList ID3D12CommandList;
typedef struct ID3D12GraphicsCommandList ID3D12GraphicsCommandList;
typedef struct ID3D12CommandQueue ID3D12CommandQueue;
typedef struct ID3D12Device ID3D12Device;
typedef struct ID3D12Debug ID3D12Debug;
typedef struct ID3D12Debug1 ID3D12Debug1;
typedef struct IDXGIOutput IDXGIOutput;
typedef struct IDXGIAdapter IDXGIAdapter;
typedef struct IDXGIAdapter1 IDXGIAdapter1;
typedef struct IDXGISwapChain IDXGISwapChain;
typedef struct IDXGISwapChain1 IDXGISwapChain1;
typedef struct IDXGISwapChain3 IDXGISwapChain3;
typedef struct IDXGIFactory4 IDXGIFactory4;
#define DXGI_CREATE_FACTORY_DEBUG 0x01
#define D3D12_RESOURCE_BARRIER_ALL_SUBRESOURCES 0xffffffff
#define D3D12_DEFAULT_DEPTH_BIAS 0
#define D3D12_DEFAULT_DEPTH_BIAS_CLAMP 0.0f
#define D3D12_DEFAULT_SLOPE_SCALED_DEPTH_BIAS 0.0f
#define D3D12_DEFAULT_STENCIL_READ_MASK 0xff
#define D3D12_DEFAULT_STENCIL_WRITE_MASK 0xff
typedef enum DXGI_FORMAT {
DXGI_FORMAT_UNKNOWN = 0,
DXGI_FORMAT_R32G32B32A32_TYPELESS = 1,
DXGI_FORMAT_R32G32B32A32_FLOAT = 2,
DXGI_FORMAT_R32G32B32A32_UINT = 3,
DXGI_FORMAT_R32G32B32A32_SINT = 4,
DXGI_FORMAT_R32G32B32_TYPELESS = 5,
DXGI_FORMAT_R32G32B32_FLOAT = 6,
DXGI_FORMAT_R32G32B32_UINT = 7,
DXGI_FORMAT_R32G32B32_SINT = 8,
DXGI_FORMAT_R16G16B16A16_TYPELESS = 9,
DXGI_FORMAT_R16G16B16A16_FLOAT = 10,
DXGI_FORMAT_R16G16B16A16_UNORM = 11,
DXGI_FORMAT_R16G16B16A16_UINT = 12,
DXGI_FORMAT_R16G16B16A16_SNORM = 13,
DXGI_FORMAT_R16G16B16A16_SINT = 14,
DXGI_FORMAT_R32G32_TYPELESS = 15,
DXGI_FORMAT_R32G32_FLOAT = 16,
DXGI_FORMAT_R32G32_UINT = 17,
DXGI_FORMAT_R32G32_SINT = 18,
DXGI_FORMAT_R32G8X24_TYPELESS = 19,
DXGI_FORMAT_D32_FLOAT_S8X24_UINT = 20,
DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS = 21,
DXGI_FORMAT_X32_TYPELESS_G8X24_UINT = 22,
DXGI_FORMAT_R10G10B10A2_TYPELESS = 23,
DXGI_FORMAT_R10G10B10A2_UNORM = 24,
DXGI_FORMAT_R10G10B10A2_UINT = 25,
DXGI_FORMAT_R11G11B10_FLOAT = 26,
DXGI_FORMAT_R8G8B8A8_TYPELESS = 27,
DXGI_FORMAT_R8G8B8A8_UNORM = 28,
DXGI_FORMAT_R8G8B8A8_UNORM_SRGB = 29,
DXGI_FORMAT_R8G8B8A8_UINT = 30,
DXGI_FORMAT_R8G8B8A8_SNORM = 31,
DXGI_FORMAT_R8G8B8A8_SINT = 32,
DXGI_FORMAT_R16G16_TYPELESS = 33,
DXGI_FORMAT_R16G16_FLOAT = 34,
DXGI_FORMAT_R16G16_UNORM = 35,
DXGI_FORMAT_R16G16_UINT = 36,
DXGI_FORMAT_R16G16_SNORM = 37,
DXGI_FORMAT_R16G16_SINT = 38,
DXGI_FORMAT_R32_TYPELESS = 39,
DXGI_FORMAT_D32_FLOAT = 40,
DXGI_FORMAT_R32_FLOAT = 41,
DXGI_FORMAT_R32_UINT = 42,
DXGI_FORMAT_R32_SINT = 43,
DXGI_FORMAT_R24G8_TYPELESS = 44,
DXGI_FORMAT_D24_UNORM_S8_UINT = 45,
DXGI_FORMAT_R24_UNORM_X8_TYPELESS = 46,
DXGI_FORMAT_X24_TYPELESS_G8_UINT = 47,
DXGI_FORMAT_R8G8_TYPELESS = 48,
DXGI_FORMAT_R8G8_UNORM = 49,
DXGI_FORMAT_R8G8_UINT = 50,
DXGI_FORMAT_R8G8_SNORM = 51,
DXGI_FORMAT_R8G8_SINT = 52,
DXGI_FORMAT_R16_TYPELESS = 53,
DXGI_FORMAT_R16_FLOAT = 54,
DXGI_FORMAT_D16_UNORM = 55,
DXGI_FORMAT_R16_UNORM = 56,
DXGI_FORMAT_R16_UINT = 57,
DXGI_FORMAT_R16_SNORM = 58,
DXGI_FORMAT_R16_SINT = 59,
DXGI_FORMAT_R8_TYPELESS = 60,
DXGI_FORMAT_R8_UNORM = 61,
DXGI_FORMAT_R8_UINT = 62,
DXGI_FORMAT_R8_SNORM = 63,
DXGI_FORMAT_R8_SINT = 64,
DXGI_FORMAT_A8_UNORM = 65,
DXGI_FORMAT_R1_UNORM = 66,
DXGI_FORMAT_R9G9B9E5_SHAREDEXP = 67,
DXGI_FORMAT_R8G8_B8G8_UNORM = 68,
DXGI_FORMAT_G8R8_G8B8_UNORM = 69,
DXGI_FORMAT_BC1_TYPELESS = 70,
DXGI_FORMAT_BC1_UNORM = 71,
DXGI_FORMAT_BC1_UNORM_SRGB = 72,
DXGI_FORMAT_BC2_TYPELESS = 73,
DXGI_FORMAT_BC2_UNORM = 74,
DXGI_FORMAT_BC2_UNORM_SRGB = 75,
DXGI_FORMAT_BC3_TYPELESS = 76,
DXGI_FORMAT_BC3_UNORM = 77,
DXGI_FORMAT_BC3_UNORM_SRGB = 78,
DXGI_FORMAT_BC4_TYPELESS = 79,
DXGI_FORMAT_BC4_UNORM = 80,
DXGI_FORMAT_BC4_SNORM = 81,
DXGI_FORMAT_BC5_TYPELESS = 82,
DXGI_FORMAT_BC5_UNORM = 83,
DXGI_FORMAT_BC5_SNORM = 84,
DXGI_FORMAT_B5G6R5_UNORM = 85,
DXGI_FORMAT_B5G5R5A1_UNORM = 86,
DXGI_FORMAT_B8G8R8A8_UNORM = 87,
DXGI_FORMAT_B8G8R8X8_UNORM = 88,
DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM = 89,
DXGI_FORMAT_B8G8R8A8_TYPELESS = 90,
DXGI_FORMAT_B8G8R8A8_UNORM_SRGB = 91,
DXGI_FORMAT_B8G8R8X8_TYPELESS = 92,
DXGI_FORMAT_B8G8R8X8_UNORM_SRGB = 93,
DXGI_FORMAT_BC6H_TYPELESS = 94,
DXGI_FORMAT_BC6H_UF16 = 95,
DXGI_FORMAT_BC6H_SF16 = 96,
DXGI_FORMAT_BC7_TYPELESS = 97,
DXGI_FORMAT_BC7_UNORM = 98,
DXGI_FORMAT_BC7_UNORM_SRGB = 99,
DXGI_FORMAT_AYUV = 100,
DXGI_FORMAT_Y410 = 101,
DXGI_FORMAT_Y416 = 102,
DXGI_FORMAT_NV12 = 103,
DXGI_FORMAT_P010 = 104,
DXGI_FORMAT_P016 = 105,
DXGI_FORMAT_420_OPAQUE = 106,
DXGI_FORMAT_YUY2 = 107,
DXGI_FORMAT_Y210 = 108,
DXGI_FORMAT_Y216 = 109,
DXGI_FORMAT_NV11 = 110,
DXGI_FORMAT_AI44 = 111,
DXGI_FORMAT_IA44 = 112,
DXGI_FORMAT_P8 = 113,
DXGI_FORMAT_A8P8 = 114,
DXGI_FORMAT_B4G4R4A4_UNORM = 115,
DXGI_FORMAT_P208 = 130,
DXGI_FORMAT_V208 = 131,
DXGI_FORMAT_V408 = 132,
DXGI_FORMAT_FORCE_UINT = 0xffffffff
} DXGI_FORMAT;
typedef struct DXGI_SAMPLE_DESC {
u32 Count;
u32 Quality;
} DXGI_SAMPLE_DESC;
typedef u64 D3D12_GPU_VIRTUAL_ADDRESS;
typedef enum D3D_FEATURE_LEVEL {
D3D_FEATURE_LEVEL_9_1 = 0x9100,
D3D_FEATURE_LEVEL_9_2 = 0x9200,
D3D_FEATURE_LEVEL_9_3 = 0x9300,
D3D_FEATURE_LEVEL_10_0 = 0xa000,
D3D_FEATURE_LEVEL_10_1 = 0xa100,
D3D_FEATURE_LEVEL_11_0 = 0xb000,
D3D_FEATURE_LEVEL_11_1 = 0xb100,
D3D_FEATURE_LEVEL_12_0 = 0xc000,
D3D_FEATURE_LEVEL_12_1 = 0xc100
} D3D_FEATURE_LEVEL;
typedef enum D3D12_HEAP_TYPE {
D3D12_HEAP_TYPE_DEFAULT = 1,
D3D12_HEAP_TYPE_UPLOAD = 2,
D3D12_HEAP_TYPE_READBACK = 3,
D3D12_HEAP_TYPE_CUSTOM = 4
} D3D12_HEAP_TYPE;
typedef enum D3D12_CPU_PAGE_PROPERTY {
D3D12_CPU_PAGE_PROPERTY_UNKNOWN = 0,
D3D12_CPU_PAGE_PROPERTY_NOT_AVAILABLE = 1,
D3D12_CPU_PAGE_PROPERTY_WRITE_COMBINE = 2,
D3D12_CPU_PAGE_PROPERTY_WRITE_BACK = 3
} D3D12_CPU_PAGE_PROPERTY;
typedef enum D3D12_MEMORY_POOL {
D3D12_MEMORY_POOL_UNKNOWN = 0,
D3D12_MEMORY_POOL_L0 = 1,
D3D12_MEMORY_POOL_L1 = 2
} D3D12_MEMORY_POOL;
typedef struct D3D12_HEAP_PROPERTIES {
D3D12_HEAP_TYPE Type;
D3D12_CPU_PAGE_PROPERTY CPUPageProperty;
D3D12_MEMORY_POOL MemoryPoolPreference;
u32 CreationNodeMask;
u32 VisibleNodeMask;
} D3D12_HEAP_PROPERTIES;
typedef enum D3D12_HEAP_FLAGS {
D3D12_HEAP_FLAG_NONE = 0,
D3D12_HEAP_FLAG_SHARED = 0x1,
D3D12_HEAP_FLAG_DENY_BUFFERS = 0x4,
D3D12_HEAP_FLAG_ALLOW_DISPLAY = 0x8,
D3D12_HEAP_FLAG_SHARED_CROSS_ADAPTER = 0x20,
D3D12_HEAP_FLAG_DENY_RT_DS_TEXTURES = 0x40,
D3D12_HEAP_FLAG_DENY_NON_RT_DS_TEXTURES = 0x80,
D3D12_HEAP_FLAG_HARDWARE_PROTECTED = 0x100,
D3D12_HEAP_FLAG_ALLOW_ALL_BUFFERS_AND_TEXTURES = 0,
D3D12_HEAP_FLAG_ALLOW_ONLY_BUFFERS = 0xc0,
D3D12_HEAP_FLAG_ALLOW_ONLY_NON_RT_DS_TEXTURES = 0x44,
D3D12_HEAP_FLAG_ALLOW_ONLY_RT_DS_TEXTURES = 0x84
} D3D12_HEAP_FLAGS;
typedef struct D3D12_HEAP_DESC {
u64 SizeInBytes;
D3D12_HEAP_PROPERTIES Properties;
u64 Alignment;
D3D12_HEAP_FLAGS Flags;
} D3D12_HEAP_DESC;
typedef struct D3D12_RANGE {
u64 Begin;
u64 End;
} D3D12_RANGE;
typedef enum D3D12_RESOURCE_DIMENSION {
D3D12_RESOURCE_DIMENSION_UNKNOWN = 0,
D3D12_RESOURCE_DIMENSION_BUFFER = 1,
D3D12_RESOURCE_DIMENSION_TEXTURE1D = 2,
D3D12_RESOURCE_DIMENSION_TEXTURE2D = 3,
D3D12_RESOURCE_DIMENSION_TEXTURE3D = 4
} D3D12_RESOURCE_DIMENSION;
typedef enum D3D12_TEXTURE_LAYOUT {
D3D12_TEXTURE_LAYOUT_UNKNOWN = 0,
D3D12_TEXTURE_LAYOUT_ROW_MAJOR = 1,
D3D12_TEXTURE_LAYOUT_64KB_UNDEFINED_SWIZZLE = 2,
D3D12_TEXTURE_LAYOUT_64KB_STANDARD_SWIZZLE = 3
} D3D12_TEXTURE_LAYOUT;
typedef enum D3D12_RESOURCE_FLAGS {
D3D12_RESOURCE_FLAG_NONE = 0,
D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET = 0x1,
D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL = 0x2,
D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS = 0x4,
D3D12_RESOURCE_FLAG_DENY_SHADER_RESOURCE = 0x8,
D3D12_RESOURCE_FLAG_ALLOW_CROSS_ADAPTER = 0x10,
D3D12_RESOURCE_FLAG_ALLOW_SIMULTANEOUS_ACCESS = 0x20
} D3D12_RESOURCE_FLAGS;
typedef struct D3D12_RESOURCE_DESC {
D3D12_RESOURCE_DIMENSION Dimension;
u64 Alignment;
u64 Width;
u32 Height;
u16 DepthOrArraySize;
u16 MipLevels;
DXGI_FORMAT Format;
DXGI_SAMPLE_DESC SampleDesc;
D3D12_TEXTURE_LAYOUT Layout;
D3D12_RESOURCE_FLAGS Flags;
} D3D12_RESOURCE_DESC;
typedef struct D3D12_BOX {
u32 left;
u32 top;
u32 front;
u32 right;
u32 bottom;
u32 back;
} D3D12_BOX;
typedef enum D3D12_DESCRIPTOR_HEAP_TYPE {
D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV = 0,
D3D12_DESCRIPTOR_HEAP_TYPE_SAMPLER = (D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV + 1),
D3D12_DESCRIPTOR_HEAP_TYPE_RTV = (D3D12_DESCRIPTOR_HEAP_TYPE_SAMPLER + 1),
D3D12_DESCRIPTOR_HEAP_TYPE_DSV = (D3D12_DESCRIPTOR_HEAP_TYPE_RTV + 1),
D3D12_DESCRIPTOR_HEAP_TYPE_NUM_TYPES = (D3D12_DESCRIPTOR_HEAP_TYPE_DSV + 1)
} D3D12_DESCRIPTOR_HEAP_TYPE;
typedef enum D3D12_DESCRIPTOR_HEAP_FLAGS {
D3D12_DESCRIPTOR_HEAP_FLAG_NONE = 0,
D3D12_DESCRIPTOR_HEAP_FLAG_SHADER_VISIBLE = 0x1
} D3D12_DESCRIPTOR_HEAP_FLAGS;
typedef struct D3D12_DESCRIPTOR_HEAP_DESC {
D3D12_DESCRIPTOR_HEAP_TYPE Type;
u32 NumDescriptors;
D3D12_DESCRIPTOR_HEAP_FLAGS Flags;
u32 NodeMask;
} D3D12_DESCRIPTOR_HEAP_DESC;
typedef struct D3D12_CPU_DESCRIPTOR_HANDLE {
u64 ptr;
} D3D12_CPU_DESCRIPTOR_HANDLE;
typedef struct D3D12_GPU_DESCRIPTOR_HANDLE {
u64 ptr;
} D3D12_GPU_DESCRIPTOR_HANDLE;
typedef RECT D3D12_RECT;
typedef struct D3D12_DISCARD_REGION {
u32 NumRects;
const D3D12_RECT *pRects;
u32 FirstSubresource;
u32 NumSubresources;
} D3D12_DISCARD_REGION;
typedef enum D3D12_COMMAND_LIST_TYPE {
D3D12_COMMAND_LIST_TYPE_DIRECT = 0,
D3D12_COMMAND_LIST_TYPE_BUNDLE = 1,
D3D12_COMMAND_LIST_TYPE_COMPUTE = 2,
D3D12_COMMAND_LIST_TYPE_COPY = 3
} D3D12_COMMAND_LIST_TYPE;
typedef struct D3D12_SUBRESOURCE_FOOTPRINT {
DXGI_FORMAT Format;
u32 Width;
u32 Height;
u32 Depth;
u32 RowPitch;
} D3D12_SUBRESOURCE_FOOTPRINT;
typedef struct D3D12_PLACED_SUBRESOURCE_FOOTPRINT {
u64 Offset;
D3D12_SUBRESOURCE_FOOTPRINT Footprint;
} D3D12_PLACED_SUBRESOURCE_FOOTPRINT;
typedef enum D3D12_TEXTURE_COPY_TYPE {
D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX = 0,
D3D12_TEXTURE_COPY_TYPE_PLACED_FOOTPRINT = 1
} D3D12_TEXTURE_COPY_TYPE;
typedef struct D3D12_TEXTURE_COPY_LOCATION {
ID3D12Resource *pResource;
D3D12_TEXTURE_COPY_TYPE Type;
union {
D3D12_PLACED_SUBRESOURCE_FOOTPRINT PlacedFootprint;
u32 SubresourceIndex;
};
} D3D12_TEXTURE_COPY_LOCATION;
typedef struct D3D12_TILED_RESOURCE_COORDINATE {
u32 X;
u32 Y;
u32 Z;
u32 Subresource;
} D3D12_TILED_RESOURCE_COORDINATE;
typedef struct D3D12_TILE_REGION_SIZE {
u32 NumTiles;
i32 UseBox;
u32 Width;
u16 Height;
u16 Depth;
} D3D12_TILE_REGION_SIZE;
typedef enum D3D12_TILE_RANGE_FLAGS {
D3D12_TILE_RANGE_FLAG_NONE = 0,
D3D12_TILE_RANGE_FLAG_NULL = 1,
D3D12_TILE_RANGE_FLAG_SKIP = 2,
D3D12_TILE_RANGE_FLAG_REUSE_SINGLE_TILE = 4
} D3D12_TILE_RANGE_FLAGS;
typedef struct D3D12_SUBRESOURCE_TILING {
u32 WidthInTiles;
u16 HeightInTiles;
u16 DepthInTiles;
u32 StartTileIndexInOverallResource;
} D3D12_SUBRESOURCE_TILING;
typedef struct D3D12_TILE_SHAPE {
u32 WidthInTexels;
u32 HeightInTexels;
u32 DepthInTexels;
} D3D12_TILE_SHAPE;
typedef enum D3D12_TILE_MAPPING_FLAGS {
D3D12_TILE_MAPPING_FLAG_NONE = 0,
D3D12_TILE_MAPPING_FLAG_NO_HAZARD = 0x1
} D3D12_TILE_MAPPING_FLAGS;
typedef enum D3D12_TILE_COPY_FLAGS {
D3D12_TILE_COPY_FLAG_NONE = 0,
D3D12_TILE_COPY_FLAG_NO_HAZARD = 0x1,
D3D12_TILE_COPY_FLAG_LINEAR_BUFFER_TO_SWIZZLED_TILED_RESOURCE = 0x2,
D3D12_TILE_COPY_FLAG_SWIZZLED_TILED_RESOURCE_TO_LINEAR_BUFFER = 0x4
} D3D12_TILE_COPY_FLAGS;
typedef enum D3D12_RESOURCE_STATES {
D3D12_RESOURCE_STATE_COMMON = 0,
D3D12_RESOURCE_STATE_VERTEX_AND_CONSTANT_BUFFER = 0x1,
D3D12_RESOURCE_STATE_INDEX_BUFFER = 0x2,
D3D12_RESOURCE_STATE_RENDER_TARGET = 0x4,
D3D12_RESOURCE_STATE_UNORDERED_ACCESS = 0x8,
D3D12_RESOURCE_STATE_DEPTH_WRITE = 0x10,
D3D12_RESOURCE_STATE_DEPTH_READ = 0x20,
D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE = 0x40,
D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE = 0x80,
D3D12_RESOURCE_STATE_STREAM_OUT = 0x100,
D3D12_RESOURCE_STATE_INDIRECT_ARGUMENT = 0x200,
D3D12_RESOURCE_STATE_COPY_DEST = 0x400,
D3D12_RESOURCE_STATE_COPY_SOURCE = 0x800,
D3D12_RESOURCE_STATE_RESOLVE_DEST = 0x1000,
D3D12_RESOURCE_STATE_RESOLVE_SOURCE = 0x2000,
D3D12_RESOURCE_STATE_GENERIC_READ = (((((0x1 | 0x2) | 0x40) | 0x80) | 0x200) | 0x800),
D3D12_RESOURCE_STATE_PRESENT = 0,
D3D12_RESOURCE_STATE_PREDICATION = 0x200
} D3D12_RESOURCE_STATES;
typedef enum D3D12_RESOURCE_BARRIER_TYPE {
D3D12_RESOURCE_BARRIER_TYPE_TRANSITION = 0,
D3D12_RESOURCE_BARRIER_TYPE_ALIASING = (D3D12_RESOURCE_BARRIER_TYPE_TRANSITION + 1),
D3D12_RESOURCE_BARRIER_TYPE_UAV = (D3D12_RESOURCE_BARRIER_TYPE_ALIASING + 1)
} D3D12_RESOURCE_BARRIER_TYPE;
typedef struct D3D12_RESOURCE_TRANSITION_BARRIER {
ID3D12Resource *pResource;
u32 Subresource;
D3D12_RESOURCE_STATES StateBefore;
D3D12_RESOURCE_STATES StateAfter;
} D3D12_RESOURCE_TRANSITION_BARRIER;
typedef struct D3D12_RESOURCE_ALIASING_BARRIER {
ID3D12Resource *pResourceBefore;
ID3D12Resource *pResourceAfter;
} D3D12_RESOURCE_ALIASING_BARRIER;
typedef struct D3D12_RESOURCE_UAV_BARRIER {
ID3D12Resource *pResource;
} D3D12_RESOURCE_UAV_BARRIER;
typedef enum D3D12_RESOURCE_BARRIER_FLAGS {
D3D12_RESOURCE_BARRIER_FLAG_NONE = 0,
D3D12_RESOURCE_BARRIER_FLAG_BEGIN_ONLY = 0x1,
D3D12_RESOURCE_BARRIER_FLAG_END_ONLY = 0x2
} D3D12_RESOURCE_BARRIER_FLAGS;
typedef struct D3D12_RESOURCE_BARRIER {
D3D12_RESOURCE_BARRIER_TYPE Type;
D3D12_RESOURCE_BARRIER_FLAGS Flags;
union {
D3D12_RESOURCE_TRANSITION_BARRIER Transition;
D3D12_RESOURCE_ALIASING_BARRIER Aliasing;
D3D12_RESOURCE_UAV_BARRIER UAV;
};
} D3D12_RESOURCE_BARRIER;
typedef enum D3D12_INPUT_CLASSIFICATION {
D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA = 0,
D3D12_INPUT_CLASSIFICATION_PER_INSTANCE_DATA = 1
} D3D12_INPUT_CLASSIFICATION;
typedef struct D3D12_INPUT_ELEMENT_DESC {
const char *SemanticName;
u32 SemanticIndex;
DXGI_FORMAT Format;
u32 InputSlot;
u32 AlignedByteOffset;
D3D12_INPUT_CLASSIFICATION InputSlotClass;
u32 InstanceDataStepRate;
} D3D12_INPUT_ELEMENT_DESC;
typedef enum D3D12_FILL_MODE {
D3D12_FILL_MODE_WIREFRAME = 2,
D3D12_FILL_MODE_SOLID = 3
} D3D12_FILL_MODE;
typedef enum D3D12_PRIMITIVE_TOPOLOGY {
D3D_PRIMITIVE_TOPOLOGY_UNDEFINED = 0,
D3D_PRIMITIVE_TOPOLOGY_POINTLIST = 1,
D3D_PRIMITIVE_TOPOLOGY_LINELIST = 2,
D3D_PRIMITIVE_TOPOLOGY_LINESTRIP = 3,
D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST = 4,
D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP = 5,
D3D_PRIMITIVE_TOPOLOGY_LINELIST_ADJ = 10,
D3D_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ = 11,
D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ = 12,
D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ = 13,
D3D_PRIMITIVE_TOPOLOGY_1_CONTROL_POINT_PATCHLIST = 33,
D3D_PRIMITIVE_TOPOLOGY_2_CONTROL_POINT_PATCHLIST = 34,
D3D_PRIMITIVE_TOPOLOGY_3_CONTROL_POINT_PATCHLIST = 35,
D3D_PRIMITIVE_TOPOLOGY_4_CONTROL_POINT_PATCHLIST = 36,
D3D_PRIMITIVE_TOPOLOGY_5_CONTROL_POINT_PATCHLIST = 37,
D3D_PRIMITIVE_TOPOLOGY_6_CONTROL_POINT_PATCHLIST = 38,
D3D_PRIMITIVE_TOPOLOGY_7_CONTROL_POINT_PATCHLIST = 39,
D3D_PRIMITIVE_TOPOLOGY_8_CONTROL_POINT_PATCHLIST = 40,
D3D_PRIMITIVE_TOPOLOGY_9_CONTROL_POINT_PATCHLIST = 41,
D3D_PRIMITIVE_TOPOLOGY_10_CONTROL_POINT_PATCHLIST = 42,
D3D_PRIMITIVE_TOPOLOGY_11_CONTROL_POINT_PATCHLIST = 43,
D3D_PRIMITIVE_TOPOLOGY_12_CONTROL_POINT_PATCHLIST = 44,
D3D_PRIMITIVE_TOPOLOGY_13_CONTROL_POINT_PATCHLIST = 45,
D3D_PRIMITIVE_TOPOLOGY_14_CONTROL_POINT_PATCHLIST = 46,
D3D_PRIMITIVE_TOPOLOGY_15_CONTROL_POINT_PATCHLIST = 47,
D3D_PRIMITIVE_TOPOLOGY_16_CONTROL_POINT_PATCHLIST = 48,
D3D_PRIMITIVE_TOPOLOGY_17_CONTROL_POINT_PATCHLIST = 49,
D3D_PRIMITIVE_TOPOLOGY_18_CONTROL_POINT_PATCHLIST = 50,
D3D_PRIMITIVE_TOPOLOGY_19_CONTROL_POINT_PATCHLIST = 51,
D3D_PRIMITIVE_TOPOLOGY_20_CONTROL_POINT_PATCHLIST = 52,
D3D_PRIMITIVE_TOPOLOGY_21_CONTROL_POINT_PATCHLIST = 53,
D3D_PRIMITIVE_TOPOLOGY_22_CONTROL_POINT_PATCHLIST = 54,
D3D_PRIMITIVE_TOPOLOGY_23_CONTROL_POINT_PATCHLIST = 55,
D3D_PRIMITIVE_TOPOLOGY_24_CONTROL_POINT_PATCHLIST = 56,
D3D_PRIMITIVE_TOPOLOGY_25_CONTROL_POINT_PATCHLIST = 57,
D3D_PRIMITIVE_TOPOLOGY_26_CONTROL_POINT_PATCHLIST = 58,
D3D_PRIMITIVE_TOPOLOGY_27_CONTROL_POINT_PATCHLIST = 59,
D3D_PRIMITIVE_TOPOLOGY_28_CONTROL_POINT_PATCHLIST = 60,
D3D_PRIMITIVE_TOPOLOGY_29_CONTROL_POINT_PATCHLIST = 61,
D3D_PRIMITIVE_TOPOLOGY_30_CONTROL_POINT_PATCHLIST = 62,
D3D_PRIMITIVE_TOPOLOGY_31_CONTROL_POINT_PATCHLIST = 63,
D3D_PRIMITIVE_TOPOLOGY_32_CONTROL_POINT_PATCHLIST = 64
} D3D12_PRIMITIVE_TOPOLOGY;
typedef enum D3D12_PRIMITIVE_TOPOLOGY_TYPE {
D3D12_PRIMITIVE_TOPOLOGY_TYPE_UNDEFINED = 0,
D3D12_PRIMITIVE_TOPOLOGY_TYPE_POINT = 1,
D3D12_PRIMITIVE_TOPOLOGY_TYPE_LINE = 2,
D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE = 3,
D3D12_PRIMITIVE_TOPOLOGY_TYPE_PATCH = 4
} D3D12_PRIMITIVE_TOPOLOGY_TYPE;
typedef struct D3D12_SO_DECLARATION_ENTRY {
u32 Stream;
const char *SemanticName;
u32 SemanticIndex;
u8 StartComponent;
u8 ComponentCount;
u8 OutputSlot;
} D3D12_SO_DECLARATION_ENTRY;
typedef enum D3D12_CULL_MODE {
D3D12_CULL_MODE_NONE = 1,
D3D12_CULL_MODE_FRONT = 2,
D3D12_CULL_MODE_BACK = 3
} D3D12_CULL_MODE;
typedef struct D3D12_VIEWPORT {
f32 TopLeftX;
f32 TopLeftY;
f32 Width;
f32 Height;
f32 MinDepth;
f32 MaxDepth;
} D3D12_VIEWPORT;
typedef enum D3D12_COMPARISON_FUNC {
D3D12_COMPARISON_FUNC_NEVER = 1,
D3D12_COMPARISON_FUNC_LESS = 2,
D3D12_COMPARISON_FUNC_EQUAL = 3,
D3D12_COMPARISON_FUNC_LESS_EQUAL = 4,
D3D12_COMPARISON_FUNC_GREATER = 5,
D3D12_COMPARISON_FUNC_NOT_EQUAL = 6,
D3D12_COMPARISON_FUNC_GREATER_EQUAL = 7,
D3D12_COMPARISON_FUNC_ALWAYS = 8
} D3D12_COMPARISON_FUNC;
typedef enum D3D12_DEPTH_WRITE_MASK {
D3D12_DEPTH_WRITE_MASK_ZERO = 0,
D3D12_DEPTH_WRITE_MASK_ALL = 1
} D3D12_DEPTH_WRITE_MASK;
typedef enum D3D12_STENCIL_OP {
D3D12_STENCIL_OP_KEEP = 1,
D3D12_STENCIL_OP_ZERO = 2,
D3D12_STENCIL_OP_REPLACE = 3,
D3D12_STENCIL_OP_INCR_SAT = 4,
D3D12_STENCIL_OP_DECR_SAT = 5,
D3D12_STENCIL_OP_INVERT = 6,
D3D12_STENCIL_OP_INCR = 7,
D3D12_STENCIL_OP_DECR = 8
} D3D12_STENCIL_OP;
typedef struct D3D12_DEPTH_STENCILOP_DESC {
D3D12_STENCIL_OP StencilFailOp;
D3D12_STENCIL_OP StencilDepthFailOp;
D3D12_STENCIL_OP StencilPassOp;
D3D12_COMPARISON_FUNC StencilFunc;
} D3D12_DEPTH_STENCILOP_DESC;
typedef struct D3D12_DEPTH_STENCIL_DESC {
i32 DepthEnable;
D3D12_DEPTH_WRITE_MASK DepthWriteMask;
D3D12_COMPARISON_FUNC DepthFunc;
i32 StencilEnable;
u8 StencilReadMask;
u8 StencilWriteMask;
D3D12_DEPTH_STENCILOP_DESC FrontFace;
D3D12_DEPTH_STENCILOP_DESC BackFace;
} D3D12_DEPTH_STENCIL_DESC;
typedef enum D3D12_BLEND {
D3D12_BLEND_ZERO = 1,
D3D12_BLEND_ONE = 2,
D3D12_BLEND_SRC_COLOR = 3,
D3D12_BLEND_INV_SRC_COLOR = 4,
D3D12_BLEND_SRC_ALPHA = 5,
D3D12_BLEND_INV_SRC_ALPHA = 6,
D3D12_BLEND_DEST_ALPHA = 7,
D3D12_BLEND_INV_DEST_ALPHA = 8,
D3D12_BLEND_DEST_COLOR = 9,
D3D12_BLEND_INV_DEST_COLOR = 10,
D3D12_BLEND_SRC_ALPHA_SAT = 11,
D3D12_BLEND_BLEND_FACTOR = 14,
D3D12_BLEND_INV_BLEND_FACTOR = 15,
D3D12_BLEND_SRC1_COLOR = 16,
D3D12_BLEND_INV_SRC1_COLOR = 17,
D3D12_BLEND_SRC1_ALPHA = 18,
D3D12_BLEND_INV_SRC1_ALPHA = 19
} D3D12_BLEND;
typedef enum D3D12_BLEND_OP {
D3D12_BLEND_OP_ADD = 1,
D3D12_BLEND_OP_SUBTRACT = 2,
D3D12_BLEND_OP_REV_SUBTRACT = 3,
D3D12_BLEND_OP_MIN = 4,
D3D12_BLEND_OP_MAX = 5
} D3D12_BLEND_OP;
typedef enum D3D12_COLOR_WRITE_ENABLE {
D3D12_COLOR_WRITE_ENABLE_RED = 1,
D3D12_COLOR_WRITE_ENABLE_GREEN = 2,
D3D12_COLOR_WRITE_ENABLE_BLUE = 4,
D3D12_COLOR_WRITE_ENABLE_ALPHA = 8,
D3D12_COLOR_WRITE_ENABLE_ALL = D3D12_COLOR_WRITE_ENABLE_RED | D3D12_COLOR_WRITE_ENABLE_GREEN |
D3D12_COLOR_WRITE_ENABLE_BLUE | D3D12_COLOR_WRITE_ENABLE_ALPHA
} D3D12_COLOR_WRITE_ENABLE;
typedef enum D3D12_LOGIC_OP {
D3D12_LOGIC_OP_CLEAR = 0,
D3D12_LOGIC_OP_SET = (D3D12_LOGIC_OP_CLEAR + 1),
D3D12_LOGIC_OP_COPY = (D3D12_LOGIC_OP_SET + 1),
D3D12_LOGIC_OP_COPY_INVERTED = (D3D12_LOGIC_OP_COPY + 1),
D3D12_LOGIC_OP_NOOP = (D3D12_LOGIC_OP_COPY_INVERTED + 1),
D3D12_LOGIC_OP_INVERT = (D3D12_LOGIC_OP_NOOP + 1),
D3D12_LOGIC_OP_AND = (D3D12_LOGIC_OP_INVERT + 1),
D3D12_LOGIC_OP_NAND = (D3D12_LOGIC_OP_AND + 1),
D3D12_LOGIC_OP_OR = (D3D12_LOGIC_OP_NAND + 1),
D3D12_LOGIC_OP_NOR = (D3D12_LOGIC_OP_OR + 1),
D3D12_LOGIC_OP_XOR = (D3D12_LOGIC_OP_NOR + 1),
D3D12_LOGIC_OP_EQUIV = (D3D12_LOGIC_OP_XOR + 1),
D3D12_LOGIC_OP_AND_REVERSE = (D3D12_LOGIC_OP_EQUIV + 1),
D3D12_LOGIC_OP_AND_INVERTED = (D3D12_LOGIC_OP_AND_REVERSE + 1),
D3D12_LOGIC_OP_OR_REVERSE = (D3D12_LOGIC_OP_AND_INVERTED + 1),
D3D12_LOGIC_OP_OR_INVERTED = (D3D12_LOGIC_OP_OR_REVERSE + 1)
} D3D12_LOGIC_OP;
typedef struct D3D12_RENDER_TARGET_BLEND_DESC {
i32 BlendEnable;
i32 LogicOpEnable;
D3D12_BLEND SrcBlend;
D3D12_BLEND DestBlend;
D3D12_BLEND_OP BlendOp;
D3D12_BLEND SrcBlendAlpha;
D3D12_BLEND DestBlendAlpha;
D3D12_BLEND_OP BlendOpAlpha;
D3D12_LOGIC_OP LogicOp;
u8 RenderTargetWriteMask;
} D3D12_RENDER_TARGET_BLEND_DESC;
typedef struct D3D12_BLEND_DESC {
i32 AlphaToCoverageEnable;
i32 IndependentBlendEnable;
D3D12_RENDER_TARGET_BLEND_DESC RenderTarget[8];
} D3D12_BLEND_DESC;
typedef enum D3D12_CONSERVATIVE_RASTERIZATION_MODE {
D3D12_CONSERVATIVE_RASTERIZATION_MODE_OFF = 0,
D3D12_CONSERVATIVE_RASTERIZATION_MODE_ON = 1
} D3D12_CONSERVATIVE_RASTERIZATION_MODE;
typedef struct D3D12_RASTERIZER_DESC {
D3D12_FILL_MODE FillMode;
D3D12_CULL_MODE CullMode;
i32 FrontCounterClockwise;
i32 DepthBias;
f32 DepthBiasClamp;
f32 SlopeScaledDepthBias;
i32 DepthClipEnable;
i32 MultisampleEnable;
i32 AntialiasedLineEnable;
u32 ForcedSampleCount;
D3D12_CONSERVATIVE_RASTERIZATION_MODE ConservativeRaster;
} D3D12_RASTERIZER_DESC;
typedef enum D3D12_QUERY_HEAP_TYPE {
D3D12_QUERY_HEAP_TYPE_OCCLUSION = 0,
D3D12_QUERY_HEAP_TYPE_TIMESTAMP = 1,
D3D12_QUERY_HEAP_TYPE_PIPELINE_STATISTICS = 2,
D3D12_QUERY_HEAP_TYPE_SO_STATISTICS = 3
} D3D12_QUERY_HEAP_TYPE;
typedef struct D3D12_QUERY_HEAP_DESC {
D3D12_QUERY_HEAP_TYPE Type;
u32 Count;
u32 NodeMask;
} D3D12_QUERY_HEAP_DESC;
typedef enum D3D12_QUERY_TYPE {
D3D12_QUERY_TYPE_OCCLUSION = 0,
D3D12_QUERY_TYPE_BINARY_OCCLUSION = 1,
D3D12_QUERY_TYPE_TIMESTAMP = 2,
D3D12_QUERY_TYPE_PIPELINE_STATISTICS = 3,
D3D12_QUERY_TYPE_SO_STATISTICS_STREAM0 = 4,
D3D12_QUERY_TYPE_SO_STATISTICS_STREAM1 = 5,
D3D12_QUERY_TYPE_SO_STATISTICS_STREAM2 = 6,
D3D12_QUERY_TYPE_SO_STATISTICS_STREAM3 = 7
} D3D12_QUERY_TYPE;
typedef enum D3D12_PREDICATION_OP {
D3D12_PREDICATION_OP_EQUAL_ZERO = 0,
D3D12_PREDICATION_OP_NOT_EQUAL_ZERO = 1
} D3D12_PREDICATION_OP;
typedef struct D3D12_QUERY_DATA_PIPELINE_STATISTICS {
u64 IAVertices;
u64 IAPrimitives;
u64 VSInvocations;
u64 GSInvocations;
u64 GSPrimitives;
u64 CInvocations;
u64 CPrimitives;
u64 PSInvocations;
u64 HSInvocations;
u64 DSInvocations;
u64 CSInvocations;
} D3D12_QUERY_DATA_PIPELINE_STATISTICS;
typedef struct D3D12_QUERY_DATA_SO_STATISTICS {
u64 NumPrimitivesWritten;
u64 PrimitivesStorageNeeded;
} D3D12_QUERY_DATA_SO_STATISTICS;
typedef struct D3D12_STREAM_OUTPUT_BUFFER_VIEW {
D3D12_GPU_VIRTUAL_ADDRESS BufferLocation;
u64 SizeInBytes;
D3D12_GPU_VIRTUAL_ADDRESS BufferFilledSizeLocation;
} D3D12_STREAM_OUTPUT_BUFFER_VIEW;
typedef struct D3D12_DRAW_ARGUMENTS {
u32 VertexCountPerInstance;
u32 InstanceCount;
u32 StartVertexLocation;
u32 StartInstanceLocation;
} D3D12_DRAW_ARGUMENTS;
typedef struct D3D12_DRAW_INDEXED_ARGUMENTS {
u32 IndexCountPerInstance;
u32 InstanceCount;
u32 StartIndexLocation;
i32 BaseVertexLocation;
u32 StartInstanceLocation;
} D3D12_DRAW_INDEXED_ARGUMENTS;
typedef struct D3D12_DISPATCH_ARGUMENTS {
u32 ThreadGroupCountX;
u32 ThreadGroupCountY;
u32 ThreadGroupCountZ;
} D3D12_DISPATCH_ARGUMENTS;
typedef struct D3D12_VERTEX_BUFFER_VIEW {
D3D12_GPU_VIRTUAL_ADDRESS BufferLocation;
u32 SizeInBytes;
u32 StrideInBytes;
} D3D12_VERTEX_BUFFER_VIEW;
typedef struct D3D12_INDEX_BUFFER_VIEW {
D3D12_GPU_VIRTUAL_ADDRESS BufferLocation;
u32 SizeInBytes;
DXGI_FORMAT Format;
} D3D12_INDEX_BUFFER_VIEW;
typedef enum D3D12_INDIRECT_ARGUMENT_TYPE {
D3D12_INDIRECT_ARGUMENT_TYPE_DRAW = 0,
D3D12_INDIRECT_ARGUMENT_TYPE_DRAW_INDEXED = (D3D12_INDIRECT_ARGUMENT_TYPE_DRAW + 1),
D3D12_INDIRECT_ARGUMENT_TYPE_DISPATCH = (D3D12_INDIRECT_ARGUMENT_TYPE_DRAW_INDEXED + 1),
D3D12_INDIRECT_ARGUMENT_TYPE_VERTEX_BUFFER_VIEW = (D3D12_INDIRECT_ARGUMENT_TYPE_DISPATCH + 1),
D3D12_INDIRECT_ARGUMENT_TYPE_INDEX_BUFFER_VIEW =
(D3D12_INDIRECT_ARGUMENT_TYPE_VERTEX_BUFFER_VIEW + 1),
D3D12_INDIRECT_ARGUMENT_TYPE_CONSTANT = (D3D12_INDIRECT_ARGUMENT_TYPE_INDEX_BUFFER_VIEW + 1),
D3D12_INDIRECT_ARGUMENT_TYPE_CONSTANT_BUFFER_VIEW = (D3D12_INDIRECT_ARGUMENT_TYPE_CONSTANT + 1),
D3D12_INDIRECT_ARGUMENT_TYPE_SHADER_RESOURCE_VIEW =
(D3D12_INDIRECT_ARGUMENT_TYPE_CONSTANT_BUFFER_VIEW + 1),
D3D12_INDIRECT_ARGUMENT_TYPE_UNORDERED_ACCESS_VIEW =
(D3D12_INDIRECT_ARGUMENT_TYPE_SHADER_RESOURCE_VIEW + 1)
} D3D12_INDIRECT_ARGUMENT_TYPE;
typedef struct D3D12_INDIRECT_ARGUMENT_DESC {
D3D12_INDIRECT_ARGUMENT_TYPE Type;
union {
struct {
u32 Slot;
} VertexBuffer;
struct {
u32 RootParameterIndex;
u32 DestOffsetIn32BitValues;
u32 Num32BitValuesToSet;
} Constant;
struct {
u32 RootParameterIndex;
} ConstantBufferView;
struct {
u32 RootParameterIndex;
} ShaderResourceView;
struct {
u32 RootParameterIndex;
} UnorderedAccessView;
};
} D3D12_INDIRECT_ARGUMENT_DESC;
typedef struct D3D12_COMMAND_SIGNATURE_DESC {
u32 ByteStride;
u32 NumArgumentDescs;
const D3D12_INDIRECT_ARGUMENT_DESC *pArgumentDescs;
u32 NodeMask;
} D3D12_COMMAND_SIGNATURE_DESC;
typedef enum D3D12_CLEAR_FLAGS {
D3D12_CLEAR_FLAG_DEPTH = 0x1,
D3D12_CLEAR_FLAG_STENCIL = 0x2
} D3D12_CLEAR_FLAGS;
typedef enum D3D12_COMMAND_QUEUE_FLAGS {
D3D12_COMMAND_QUEUE_FLAG_NONE = 0,
D3D12_COMMAND_QUEUE_FLAG_DISABLE_GPU_TIMEOUT = 0x1
} D3D12_COMMAND_QUEUE_FLAGS;
typedef enum D3D12_COMMAND_QUEUE_PRIORITY {
D3D12_COMMAND_QUEUE_PRIORITY_NORMAL = 0,
D3D12_COMMAND_QUEUE_PRIORITY_HIGH = 100
} D3D12_COMMAND_QUEUE_PRIORITY;
typedef struct D3D12_COMMAND_QUEUE_DESC {
D3D12_COMMAND_LIST_TYPE Type;
i32 Priority;
D3D12_COMMAND_QUEUE_FLAGS Flags;
u32 NodeMask;
} D3D12_COMMAND_QUEUE_DESC;
typedef struct D3D12_SHADER_BYTECODE {
const void *pShaderBytecode;
u64 BytecodeLength;
} D3D12_SHADER_BYTECODE;
typedef struct D3D12_STREAM_OUTPUT_DESC {
const D3D12_SO_DECLARATION_ENTRY *pSODeclaration;
u32 NumEntries;
const u32 *pBufferStrides;
u32 NumStrides;
u32 RasterizedStream;
} D3D12_STREAM_OUTPUT_DESC;
typedef struct D3D12_INPUT_LAYOUT_DESC {
const D3D12_INPUT_ELEMENT_DESC *pInputElementDescs;
u32 NumElements;
} D3D12_INPUT_LAYOUT_DESC;
typedef enum D3D12_INDEX_BUFFER_STRIP_CUT_VALUE {
D3D12_INDEX_BUFFER_STRIP_CUT_VALUE_DISABLED = 0,
D3D12_INDEX_BUFFER_STRIP_CUT_VALUE_0xFFFF = 1,
D3D12_INDEX_BUFFER_STRIP_CUT_VALUE_0xFFFFFFFF = 2
} D3D12_INDEX_BUFFER_STRIP_CUT_VALUE;
typedef struct D3D12_CACHED_PIPELINE_STATE {
const void *pCachedBlob;
u64 CachedBlobSizeInBytes;
} D3D12_CACHED_PIPELINE_STATE;
typedef enum D3D12_PIPELINE_STATE_FLAGS {
D3D12_PIPELINE_STATE_FLAG_NONE = 0,
D3D12_PIPELINE_STATE_FLAG_TOOL_DEBUG = 0x1
} D3D12_PIPELINE_STATE_FLAGS;
typedef struct D3D12_GRAPHICS_PIPELINE_STATE_DESC {
ID3D12RootSignature *pRootSignature;
D3D12_SHADER_BYTECODE VS;
D3D12_SHADER_BYTECODE PS;
D3D12_SHADER_BYTECODE DS;
D3D12_SHADER_BYTECODE HS;
D3D12_SHADER_BYTECODE GS;
D3D12_STREAM_OUTPUT_DESC StreamOutput;
D3D12_BLEND_DESC BlendState;
u32 SampleMask;
D3D12_RASTERIZER_DESC RasterizerState;
D3D12_DEPTH_STENCIL_DESC DepthStencilState;
D3D12_INPUT_LAYOUT_DESC InputLayout;
D3D12_INDEX_BUFFER_STRIP_CUT_VALUE IBStripCutValue;
D3D12_PRIMITIVE_TOPOLOGY_TYPE PrimitiveTopologyType;
u32 NumRenderTargets;
DXGI_FORMAT RTVFormats[8];
DXGI_FORMAT DSVFormat;
DXGI_SAMPLE_DESC SampleDesc;
u32 NodeMask;
D3D12_CACHED_PIPELINE_STATE CachedPSO;
D3D12_PIPELINE_STATE_FLAGS Flags;
} D3D12_GRAPHICS_PIPELINE_STATE_DESC;
typedef struct D3D12_COMPUTE_PIPELINE_STATE_DESC {
ID3D12RootSignature *pRootSignature;
D3D12_SHADER_BYTECODE CS;
u32 NodeMask;
D3D12_CACHED_PIPELINE_STATE CachedPSO;
D3D12_PIPELINE_STATE_FLAGS Flags;
} D3D12_COMPUTE_PIPELINE_STATE_DESC;
typedef enum D3D12_FEATURE {
D3D12_FEATURE_D3D12_OPTIONS = 0,
D3D12_FEATURE_ARCHITECTURE = 1,
D3D12_FEATURE_FEATURE_LEVELS = 2,
D3D12_FEATURE_FORMAT_SUPPORT = 3,
D3D12_FEATURE_MULTISAMPLE_QUALITY_LEVELS = 4,
D3D12_FEATURE_FORMAT_INFO = 5,
D3D12_FEATURE_GPU_VIRTUAL_ADDRESS_SUPPORT = 6,
D3D12_FEATURE_SHADER_MODEL = 7,
D3D12_FEATURE_D3D12_OPTIONS1 = 8,
D3D12_FEATURE_ROOT_SIGNATURE = 12
} D3D12_FEATURE;
typedef enum D3D12_SHADER_MIN_PRECISION_SUPPORT {
D3D12_SHADER_MIN_PRECISION_SUPPORT_NONE = 0,
D3D12_SHADER_MIN_PRECISION_SUPPORT_10_BIT = 0x1,
D3D12_SHADER_MIN_PRECISION_SUPPORT_16_BIT = 0x2
} D3D12_SHADER_MIN_PRECISION_SUPPORT;
typedef enum D3D12_TILED_RESOURCES_TIER {
D3D12_TILED_RESOURCES_TIER_NOT_SUPPORTED = 0,
D3D12_TILED_RESOURCES_TIER_1 = 1,
D3D12_TILED_RESOURCES_TIER_2 = 2,
D3D12_TILED_RESOURCES_TIER_3 = 3
} D3D12_TILED_RESOURCES_TIER;
typedef enum D3D12_RESOURCE_BINDING_TIER {
D3D12_RESOURCE_BINDING_TIER_1 = 1,
D3D12_RESOURCE_BINDING_TIER_2 = 2,
D3D12_RESOURCE_BINDING_TIER_3 = 3
} D3D12_RESOURCE_BINDING_TIER;
typedef enum D3D12_CONSERVATIVE_RASTERIZATION_TIER {
D3D12_CONSERVATIVE_RASTERIZATION_TIER_NOT_SUPPORTED = 0,
D3D12_CONSERVATIVE_RASTERIZATION_TIER_1 = 1,
D3D12_CONSERVATIVE_RASTERIZATION_TIER_2 = 2,
D3D12_CONSERVATIVE_RASTERIZATION_TIER_3 = 3
} D3D12_CONSERVATIVE_RASTERIZATION_TIER;
typedef enum D3D12_FORMAT_SUPPORT1 {
D3D12_FORMAT_SUPPORT1_NONE = 0,
D3D12_FORMAT_SUPPORT1_BUFFER = 0x1,
D3D12_FORMAT_SUPPORT1_IA_VERTEX_BUFFER = 0x2,
D3D12_FORMAT_SUPPORT1_IA_INDEX_BUFFER = 0x4,
D3D12_FORMAT_SUPPORT1_SO_BUFFER = 0x8,
D3D12_FORMAT_SUPPORT1_TEXTURE1D = 0x10,
D3D12_FORMAT_SUPPORT1_TEXTURE2D = 0x20,
D3D12_FORMAT_SUPPORT1_TEXTURE3D = 0x40,
D3D12_FORMAT_SUPPORT1_TEXTURECUBE = 0x80,
D3D12_FORMAT_SUPPORT1_SHADER_LOAD = 0x100,
D3D12_FORMAT_SUPPORT1_SHADER_SAMPLE = 0x200,
D3D12_FORMAT_SUPPORT1_SHADER_SAMPLE_COMPARISON = 0x400,
D3D12_FORMAT_SUPPORT1_SHADER_SAMPLE_MONO_TEXT = 0x800,
D3D12_FORMAT_SUPPORT1_MIP = 0x1000,
D3D12_FORMAT_SUPPORT1_RENDER_TARGET = 0x4000,
D3D12_FORMAT_SUPPORT1_BLENDABLE = 0x8000,
D3D12_FORMAT_SUPPORT1_DEPTH_STENCIL = 0x10000,
D3D12_FORMAT_SUPPORT1_MULTISAMPLE_RESOLVE = 0x40000,
D3D12_FORMAT_SUPPORT1_DISPLAY = 0x80000,
D3D12_FORMAT_SUPPORT1_CAST_WITHIN_BIT_LAYOUT = 0x100000,
D3D12_FORMAT_SUPPORT1_MULTISAMPLE_RENDERTARGET = 0x200000,
D3D12_FORMAT_SUPPORT1_MULTISAMPLE_LOAD = 0x400000,
D3D12_FORMAT_SUPPORT1_SHADER_GATHER = 0x800000,
D3D12_FORMAT_SUPPORT1_BACK_BUFFER_CAST = 0x1000000,
D3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW = 0x2000000,
D3D12_FORMAT_SUPPORT1_SHADER_GATHER_COMPARISON = 0x4000000,
D3D12_FORMAT_SUPPORT1_DECODER_OUTPUT = 0x8000000,
D3D12_FORMAT_SUPPORT1_VIDEO_PROCESSOR_OUTPUT = 0x10000000,
D3D12_FORMAT_SUPPORT1_VIDEO_PROCESSOR_INPUT = 0x20000000,
D3D12_FORMAT_SUPPORT1_VIDEO_ENCODER = 0x40000000
} D3D12_FORMAT_SUPPORT1;
typedef enum D3D12_FORMAT_SUPPORT2 {
D3D12_FORMAT_SUPPORT2_NONE = 0,
D3D12_FORMAT_SUPPORT2_UAV_ATOMIC_ADD = 0x1,
D3D12_FORMAT_SUPPORT2_UAV_ATOMIC_BITWISE_OPS = 0x2,
D3D12_FORMAT_SUPPORT2_UAV_ATOMIC_COMPARE_STORE_OR_COMPARE_EXCHANGE = 0x4,
D3D12_FORMAT_SUPPORT2_UAV_ATOMIC_EXCHANGE = 0x8,
D3D12_FORMAT_SUPPORT2_UAV_ATOMIC_SIGNED_MIN_OR_MAX = 0x10,
D3D12_FORMAT_SUPPORT2_UAV_ATOMIC_UNSIGNED_MIN_OR_MAX = 0x20,
D3D12_FORMAT_SUPPORT2_UAV_TYPED_LOAD = 0x40,