-
Notifications
You must be signed in to change notification settings - Fork 90
/
Copy pathg_palPipelineAbiMetadata.h
2535 lines (2374 loc) · 101 KB
/
g_palPipelineAbiMetadata.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
/*
***********************************************************************************************************************
*
* Copyright (c) 2024 Advanced Micro Devices, Inc. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
**********************************************************************************************************************/
#pragma once
#include "palPipelineAbi.h"
#include "palInlineFuncs.h"
#include "palMsgPack.h"
namespace Util
{
namespace PalAbi
{
using MsgPackOffset = uint32;
using StringViewType = StringView<char>;
struct BinaryData
{
const void* pBuffer;
uint32 sizeInBytes;
};
/// Per-API shader metadata.
struct ShaderMetadata
{
/// Input shader hash, typically passed in from the client.
uint64 apiShaderHash[2];
/// Flags indicating the HW stages this API shader maps to.
uint32 hardwareMapping;
/// Shader subtype
Abi::ApiShaderSubType shaderSubtype;
union
{
struct
{
uint8 apiShaderHash : 1;
uint8 hardwareMapping : 1;
uint8 shaderSubtype : 1;
uint8 reserved : 5;
};
uint8 uAll;
} hasEntry;
};
/// Instance of a constant buffer read from an instruction.
struct CbConstUsageMetadata
{
/// constant buffer id
uint32 bufferId;
/// constant buffer index in the range
uint32 bufferIndex;
/// slot
uint32 elem;
/// channel select
uint8 chan;
/// constant usage
Abi::CbConstUsageType usage;
union
{
struct
{
uint8 bufferId : 1;
uint8 bufferIndex : 1;
uint8 elem : 1;
uint8 chan : 1;
uint8 usage : 1;
uint8 reserved : 3;
};
uint8 uAll;
} hasEntry;
};
/// Per-hardware stage metadata.
struct HardwareStageMetadata
{
/// The symbol name pointing to this pipeline's stage entrypoint.
StringViewType entryPointSymbol;
#if PAL_CLIENT_INTERFACE_MAJOR_VERSION < 911
/// Deprecated. The symbol pointing to this pipeline's stage entrypoint.
Abi::PipelineSymbolType entryPoint;
#endif
/// Scratch memory size in bytes.
uint32 scratchMemorySize;
/// size in bytes (per lane/thread) of the stack managed by the compiler backend.
uint32 backendStackSize;
/// size in bytes (per lane/thread) of the stack managed by the frontend.
uint32 frontendStackSize;
/// Local Data Share size in bytes.
uint32 ldsSize;
/// Performance data buffer size in bytes.
uint32 perfDataBufferSize;
/// Number of VGPRs used.
uint32 vgprCount;
/// Number of SGPRs used.
uint32 sgprCount;
/// If non-zero, indicates the shader was compiled with a directive to instruct the compiler to limit the VGPR usage
/// to be less than or equal to the specified value (only set if different from HW default).
uint32 vgprLimit;
/// SGPR count upper limit (only set if different from HW default).
uint32 sgprLimit;
/// Thread-group X/Y/Z dimensions (Compute only).
uint32 threadgroupDimensions[3];
/// Original thread-group X/Y/Z dimensions (Compute only).
uint32 origThreadgroupDimensions[3];
/// Instance of a constant buffer read from an instruction.
CbConstUsageMetadata cbConstUsage[16];
/// Size of cbConstUsage array (max 16 entries)
uint8 numCbConstUsages;
/// Bitmask of unused immediate constants in shader
uint32 unusedImmConst[4];
/// Wavefront size (only set if different from HW default).
uint32 wavefrontSize;
/// User data register mapping to user data entries. See :ref:`amdgpu-amdpal-code-object-user-data-section` for more
/// details.
uint32 userDataRegMap[32];
/// Value used for shader profiling for power feature.
uint32 checksumValue;
/// Float mode for waves of this shader.
uint8 floatMode;
/// Number of USER_DATA SGPRs.
uint8 userSgprs;
/// Which exceptions to trap on.
uint16 excpEn;
/// Number of shared VGPRs for Wave64. Must be 0 for Wave32.
uint8 sharedVgprCnt;
/// Wave limit per shader engine.
uint32 wavesPerSe;
union
{
struct
{
/// FP16 overflow mode.
uint16 fp16Overflow : 1;
/// IEEE mode.
uint16 ieeeMode : 1;
/// Whether waves of this shader will be launched in CU-centric or WGP-centric mode.
uint16 wgpMode : 1;
/// Indiciates if using mem ordred mode. If false, indiciates that all loads, stores, and samples are
/// unordered with respect to each other. If true, indicates that loads and samples are kept in order with
/// each other, but stores are not ordered with loads.
uint16 memOrdered : 1;
/// Indicates if using forward progress.
uint16 forwardProgress : 1;
/// Indicates the debug mode.
uint16 debugMode : 1;
/// Whether this wave uses scratch space for register spilling.
uint16 scratchEn : 1;
/// Whether a trap handler has been enabled for this wave.
uint16 trapPresent : 1;
/// Whether offchip LDS information needs to be loaded.
uint16 offchipLdsEn : 1;
/// The shader reads or writes UAVs.
uint16 usesUavs : 1;
/// The shader reads or writes ROVs.
uint16 usesRovs : 1;
/// The shader writes to one or more UAVs.
uint16 writesUavs : 1;
/// The shader writes out a depth value.
uint16 writesDepth : 1;
/// The shader uses append and/or consume operations, either memory or GDS.
uint16 usesAppendConsume : 1;
/// The shader uses PrimID.
uint16 usesPrimId : 1;
uint16 placeholder0 : 1;
};
uint16 uAll;
} flags;
union
{
struct
{
uint64 entryPointSymbol : 1;
#if PAL_CLIENT_INTERFACE_MAJOR_VERSION < 911
uint64 entryPoint : 1;
#else
uint64 placeholder0 : 1;
#endif
uint64 scratchMemorySize : 1;
uint64 backendStackSize : 1;
uint64 frontendStackSize : 1;
uint64 ldsSize : 1;
uint64 perfDataBufferSize : 1;
uint64 vgprCount : 1;
uint64 placeholder1 : 1;
uint64 sgprCount : 1;
uint64 vgprLimit : 1;
uint64 sgprLimit : 1;
uint64 placeholder2 : 1;
uint64 threadgroupDimensions : 1;
uint64 origThreadgroupDimensions : 1;
uint64 cbConstUsage : 1;
uint64 numCbConstUsages : 1;
uint64 unusedImmConst : 1;
uint64 wavefrontSize : 1;
uint64 userDataRegMap : 1;
uint64 checksumValue : 1;
uint64 floatMode : 1;
uint64 fp16Overflow : 1;
uint64 ieeeMode : 1;
uint64 wgpMode : 1;
uint64 memOrdered : 1;
uint64 forwardProgress : 1;
uint64 debugMode : 1;
uint64 scratchEn : 1;
uint64 trapPresent : 1;
uint64 userSgprs : 1;
uint64 excpEn : 1;
uint64 offchipLdsEn : 1;
uint64 sharedVgprCnt : 1;
uint64 wavesPerSe : 1;
uint64 usesUavs : 1;
uint64 usesRovs : 1;
uint64 writesUavs : 1;
uint64 writesDepth : 1;
uint64 usesAppendConsume : 1;
uint64 usesPrimId : 1;
uint64 placeholder3 : 1;
uint64 reserved : 22;
};
uint64 uAll;
} hasEntry;
};
/// Pixel shader input semantic info.
struct PsInputSemanticMetadata
{
/// Key for input and output interface match between Ps and pre-raster stage.
uint16 semantic;
union
{
struct
{
uint8 semantic : 1;
uint8 reserved : 7;
};
uint8 uAll;
} hasEntry;
};
/// Output semantic info in pre-raster stage which is before pixel shader.
struct PrerasterOutputSemanticMetadata
{
/// Key for input and output interface match between Ps and pre-raster stage.
uint16 semantic;
/// Parameter index in pre-raster stage export.
uint8 index;
union
{
struct
{
uint8 semantic : 1;
uint8 index : 1;
uint8 reserved : 6;
};
uint8 uAll;
} hasEntry;
};
struct PaClClipCntlMetadata
{
union
{
struct
{
/// Whether User Clip Plane 0 is enabled.
uint16 userClipPlane0Ena : 1;
/// Whether User Clip Plane 1 is enabled.
uint16 userClipPlane1Ena : 1;
/// Whether User Clip Plane 2 is enabled.
uint16 userClipPlane2Ena : 1;
/// Whether User Clip Plane 3 is enabled.
uint16 userClipPlane3Ena : 1;
/// Whether User Clip Plane 4 is enabled.
uint16 userClipPlane4Ena : 1;
/// Whether User Clip Plane 5 is enabled.
uint16 userClipPlane5Ena : 1;
/// Whether the clipper performs special t_factor adjustment from DX10 to calculate the attribute
/// barycentric coordinates to allow for linear gradient appearance across clipped triangle fan. If reset,
/// vertices will use perspective correct barycentric coordinates.
uint16 dxLinearAttrClipEna : 1;
/// Whether depth near clipping is disabled.
uint16 zclipNearDisable : 1;
/// Whether depth far clipping is disabled.
uint16 zclipFarDisable : 1;
/// Whether rasterization kill is enabled.
uint16 rasterizationKill : 1;
/// Whether clipping is disabled. Must be set if the VS ouputs window coordinates.
uint16 clipDisable : 1;
uint16 reserved : 5;
};
uint16 uAll;
} flags;
union
{
struct
{
uint16 userClipPlane0Ena : 1;
uint16 userClipPlane1Ena : 1;
uint16 userClipPlane2Ena : 1;
uint16 userClipPlane3Ena : 1;
uint16 userClipPlane4Ena : 1;
uint16 userClipPlane5Ena : 1;
uint16 dxLinearAttrClipEna : 1;
uint16 zclipNearDisable : 1;
uint16 zclipFarDisable : 1;
uint16 rasterizationKill : 1;
uint16 clipDisable : 1;
uint16 reserved : 5;
};
uint16 uAll;
} hasEntry;
};
struct PaClVteCntlMetadata
{
union
{
struct
{
/// Indicates that the incoming X, Y have already been multiplied by 1/W0. Must be set if the vertex shader
/// outputs window coordinates.
uint16 vtxXyFmt : 1;
/// Indicates that the incoming Z has already been multiplied by 1/W0. Must be set if the vertex shader
/// outputs window coordinates.
uint16 vtxZFmt : 1;
/// Whether the Viewport Transform performs scaling on the X component. Must be false if the vertex shader
/// outputs window coordinates.
uint16 xScaleEna : 1;
/// Whether the Viewport Transform adds the offset on the X component. Must be false if the vertex shader
/// outputs window coordinates.
uint16 xOffsetEna : 1;
/// Whether the Viewport Transform performs scaling on the Y component. Must be false if the vertex shader
/// outputs window coordinates.
uint16 yScaleEna : 1;
/// Whether the Viewport Transform adds the offset on the Y component. Must be false if the vertex shader
/// outputs window coordinates.
uint16 yOffsetEna : 1;
/// Whether the Viewport Transform performs scaling on the Z component. Must be false if the vertex shader
/// outputs window coordinates.
uint16 zScaleEna : 1;
/// Whether the Viewport Transform adds the offset on the Z component. Must be false if the vertex shader
/// outputs window coordinates.
uint16 zOffsetEna : 1;
/// Indicates that the incoming W0 is not 1/W0. Must be false if the vertex shader outputs window
/// coordinates.
uint16 vtxW0Fmt : 1;
uint16 reserved : 7;
};
uint16 uAll;
} flags;
union
{
struct
{
uint16 vtxXyFmt : 1;
uint16 vtxZFmt : 1;
uint16 xScaleEna : 1;
uint16 xOffsetEna : 1;
uint16 yScaleEna : 1;
uint16 yOffsetEna : 1;
uint16 zScaleEna : 1;
uint16 zOffsetEna : 1;
uint16 vtxW0Fmt : 1;
uint16 reserved : 7;
};
uint16 uAll;
} hasEntry;
};
struct PaSuVtxCntlMetadata
{
/// Controls conversion of X,Y coordinates from IEEE to fixed-point - 0 = Truncate - 1 = Round - 2 = Round to Even -
/// 3 = Round to Odd
uint8 roundMode;
/// Controls conversion of X,Y coordinates from IEEE to fixed-point.
/// Determines fixed point format and how many fractional bits are actually utilized.
/// Modes 0-4 are not supported when conservative rasterization is enabled.
/// - 0 = 16.8 fixed point. 1/16th ( 4 fractional bits used)
/// - 1 = 16.8 fixed point. 1/8th ( 3 fractional bits used)
/// - 2 = 16.8 fixed point. 1/4th ( 2 fractional bits used)
/// - 3 = 16.8 fixed point. 1/2 ( 1 fractional bit used)
/// - 4 = 16.8 fixed point. 1 ( 0 fractional bits used)
/// - 5 = 16.8 fixed point. 1/256th ( 8 fractional bits)
/// - 6 = 14.10 fixed point. 1/1024th (10 fractional bits)
/// - 7 = 12.12 fixed point. 1/4096th (12 fractional bits)
uint8 quantMode;
union
{
struct
{
/// Specifies where the pixel center of the incoming vertex is. The drawing engine itself has pixel centers
/// @ 0.5, so if this bit is `0`, 0.5 will be added to the X,Y coordinates to move the incoming vertex onto
/// our internal grid.
uint8 pixCenter : 1;
uint8 reserved : 7;
};
uint8 uAll;
} flags;
union
{
struct
{
uint8 pixCenter : 1;
uint8 roundMode : 1;
uint8 quantMode : 1;
uint8 reserved : 5;
};
uint8 uAll;
} hasEntry;
};
struct VgtShaderStagesEnMetadata
{
/// Whether the ES stage is enabled.
/// - 0 - ES stage off.
/// - 1 - ES stage on, and the ES is a Domain shader.
/// - 2 - ES stage on, and the ES is a Vertex shader.
uint8 esStageEn;
/// Whether the VS stage is enabled.
/// - 0 - VS stage is on, and is an API Vertex Shader.
/// - 1 - VS stage is on, and is an API Domain Shader.
/// - 2 - VS stage is on, and is a copy shader.
uint8 vsStageEn;
/// Maximum number of primgroups that can be combined into a single ES or VS wave.
uint8 maxPrimgroupInWave;
/// Whether NGG subgroups should be launched in a different mode, possibly at a faster rate.
uint8 gsFastLaunch;
union
{
struct
{
/// Whether the LS stage is enabled.
uint16 lsStageEn : 1;
/// Whether the HS stage is enabled.
uint16 hsStageEn : 1;
/// Whether the GS stage is enabled.
uint16 gsStageEn : 1;
/// Whether the output of the HS stage stays on chip or whether it is dynamically decided to use offchip.
uint16 dynamicHs : 1;
/// Whether or not Next Generation Geometry (Prim Shader) is enabled.
uint16 primgenEn : 1;
/// Whether the ordered wave id for the primitive shader is created per sub-group or per wave.
/// - false - WaveId per sub-group
/// - true - WaveId per wave
uint16 orderedIdMode : 1;
/// Whether the NGG wave ID will be incremented.
uint16 nggWaveIdEn : 1;
/// Whether the NGG pipeline is run in passthrough mode.
uint16 primgenPassthruEn : 1;
/// When the NGG pipeline is in passthrough mode, whether or not the shader must send the allocation
/// message.
uint16 primgenPassthruNoMsg : 1;
uint16 reserved : 7;
};
uint16 uAll;
} flags;
union
{
struct
{
uint16 lsStageEn : 1;
uint16 hsStageEn : 1;
uint16 esStageEn : 1;
uint16 gsStageEn : 1;
uint16 vsStageEn : 1;
uint16 dynamicHs : 1;
uint16 maxPrimgroupInWave : 1;
uint16 primgenEn : 1;
uint16 orderedIdMode : 1;
uint16 nggWaveIdEn : 1;
uint16 gsFastLaunch : 1;
uint16 primgenPassthruEn : 1;
uint16 primgenPassthruNoMsg : 1;
uint16 reserved : 3;
};
uint16 uAll;
} hasEntry;
};
struct VgtGsModeMetadata
{
/// Which GS scenario to enable.
uint8 mode;
/// On-chip mode for ESGS and GSVS communication.
/// - 0 - EsGs and GsVs data is offchip.
/// - 1 - GsVs data is offchip.
/// - 3 - EsGs and GsVs data in onchip.
uint8 onchip;
/// Cut length, dependent on how many vertices the GS emits.
/// - 0 - More than 512 GS emit vertices.
/// - 1 - More than 256 GS emit vertices and less than equal to 512.
/// - 2 - More than 128 GS emit vertices and less than equal to 256.
/// - 3 - Less than equal to 128 GS emit vertices.
uint8 cutMode;
union
{
struct
{
/// Whether the ESGS ring is optimized for write combining.
uint8 esWriteOptimize : 1;
/// Whether the GSVS ring is optimized for write combining.
uint8 gsWriteOptimize : 1;
uint8 reserved : 6;
};
uint8 uAll;
} flags;
union
{
struct
{
uint8 mode : 1;
uint8 onchip : 1;
uint8 esWriteOptimize : 1;
uint8 gsWriteOptimize : 1;
uint8 cutMode : 1;
uint8 reserved : 3;
};
uint8 uAll;
} hasEntry;
};
struct VgtTfParamMetadata
{
/// Tessellation type.
/// - 0 - Isoline
/// - 1 - Triangle
/// - 2 - Quad
uint8 type;
/// Partition type.
/// - 0 - Integer
/// - 1 - Pow2
/// - 2 - Fractional Odd
/// - 3 - Fractional Even
uint8 partitioning;
/// Output primitive topology.
/// - 0 - Point
/// - 1 - Line
/// - 2 - Triangle Clockwise
/// - 3 - Triangle Counter-clockwise
uint8 topology;
/// How many DS waves (ES/VS) are sent to the same SIMD before spilling to other SIMDs to use the offchip LDS data
uint8 numDsWavesPerSimd;
/// Mode used for distributed tessellation.
/// Requires offchip tessellation to be enabled for PATCHES and DONUT modes of distribution.
/// - 0 - No distribution.
/// - 1 - Patches
/// - 2 - Donuts
/// - 3 - Trapezoids
uint8 distributionMode;
union
{
struct
{
/// Whether to disable donut walking pattern is used by the tessellator.
uint8 disableDonuts : 1;
uint8 reserved : 7;
};
uint8 uAll;
} flags;
union
{
struct
{
uint8 type : 1;
uint8 partitioning : 1;
uint8 topology : 1;
uint8 disableDonuts : 1;
uint8 numDsWavesPerSimd : 1;
uint8 distributionMode : 1;
uint8 reserved : 2;
};
uint8 uAll;
} hasEntry;
};
struct VgtLsHsConfigMetadata
{
/// Number of patches in a threadgroup. Max verts/threadgroup is 256.
uint8 numPatches;
/// Number of control points in HS input patch. Valid range is 1-32.
uint8 hsNumInputCp;
/// Number of control points in HS output patch. Valid range is 1-32.
uint8 hsNumOutputCp;
union
{
struct
{
uint8 numPatches : 1;
uint8 hsNumInputCp : 1;
uint8 hsNumOutputCp : 1;
uint8 reserved : 5;
};
uint8 uAll;
} hasEntry;
};
struct IaMultiVgtParamMetadata
{
/// Number of primitives sent to one of the frontends before switching to the next frontend. Implied +1.
uint16 primgroupSize;
union
{
struct
{
/// Whether the frontend will issue a VS wave as soon as a primgroup is finished, or if it will continue a
/// VS wave from one primgroup into the next within a draw call.
uint8 partialVsWaveOn : 1;
/// Whether the frontend will issue an ES wave as soon as a primgroup is finished, or if it will continue a
/// ES wave from one primgroup into the next within a draw call.
uint8 partialEsWaveOn : 1;
/// Whether the overall frontend will switch between frontends at packet boundaries, otherwise will switch
/// based on size of primgroups.
uint8 switchOnEop : 1;
/// Whether the overall frontend will switch between frontends at instance boundaries, otherwise will switch
/// based on size of primgroups.
uint8 switchOnEoi : 1;
uint8 reserved : 4;
};
uint8 uAll;
} flags;
union
{
struct
{
uint8 primgroupSize : 1;
uint8 partialVsWaveOn : 1;
uint8 partialEsWaveOn : 1;
uint8 switchOnEop : 1;
uint8 switchOnEoi : 1;
uint8 reserved : 3;
};
uint8 uAll;
} hasEntry;
};
struct SpiInterpControlMetadata
{
Abi::PointSpriteSelect pointSpriteOverrideX;
Abi::PointSpriteSelect pointSpriteOverrideY;
Abi::PointSpriteSelect pointSpriteOverrideZ;
Abi::PointSpriteSelect pointSpriteOverrideW;
union
{
struct
{
/// Enable point sprite override for point primitives.
uint8 pointSpriteEna : 1;
uint8 reserved : 7;
};
uint8 uAll;
} flags;
union
{
struct
{
uint8 pointSpriteEna : 1;
uint8 pointSpriteOverrideX : 1;
uint8 pointSpriteOverrideY : 1;
uint8 pointSpriteOverrideZ : 1;
uint8 pointSpriteOverrideW : 1;
uint8 reserved : 3;
};
uint8 uAll;
} hasEntry;
};
struct SpiPsInputCntlMetadata
{
/// PS input offset - specifies which parameter cache outputs are for this input.
uint8 offset;
/// Selects default value if no semantic match is found.
uint8 defaultVal;
/// Cylindrical wrap control.
uint8 cylWrap;
union
{
struct
{
/// Flat shade select. Set if interpolation mode is constant.
uint8 flatShade : 1;
/// Whether this parameter should be overridden with texture coordinates if global point sprite enable is
/// set.
uint8 ptSpriteTex : 1;
/// Specifies that up to two parameters are interpolated in FP16 mode and loaded as an FP16 pair in the PS
/// input GPR.
uint8 fp16InterpMode : 1;
/// Whether the first FP16 parameter is valid. Only valid if fp16_interp_mode is set.
uint8 attr0Valid : 1;
/// Whether the second FP16 parameter is valid. Only valid if fp16_interp_mode is set.
uint8 attr1Valid : 1;
/// Whether the hardware will provide provoking vertex ID and rotate the raw attribute parameter cache
/// pointers accordingly.
uint8 rotatePcPtr : 1;
/// Whether this parameter is a primitive attribute.
uint8 primAttr : 1;
uint8 reserved : 1;
};
uint8 uAll;
} flags;
union
{
struct
{
uint16 offset : 1;
uint16 defaultVal : 1;
uint16 flatShade : 1;
uint16 cylWrap : 1;
uint16 ptSpriteTex : 1;
uint16 fp16InterpMode : 1;
uint16 attr0Valid : 1;
uint16 attr1Valid : 1;
uint16 rotatePcPtr : 1;
uint16 primAttr : 1;
uint16 reserved : 6;
};
uint16 uAll;
} hasEntry;
};
struct SpiShaderGsMeshletDimMetadata
{
/// Threadgroup size in the X dimension.
uint16 numThreadX;
/// Threadgroup size in the Y dimension.
uint16 numThreadY;
/// Threadgroup size in the Z dimension.
uint16 numThreadZ;
/// Threadgroup size (X * Y * Z).
uint32 threadgroupSize;
union
{
struct
{
uint8 numThreadX : 1;
uint8 numThreadY : 1;
uint8 numThreadZ : 1;
uint8 threadgroupSize : 1;
uint8 reserved : 4;
};
uint8 uAll;
} hasEntry;
};
struct SpiShaderGsMeshletExpAllocMetadata
{
/// Maximum position export space per meshlet subgroup.
uint16 maxExpVerts;
/// Maximum primitive export space per meshlet subgroup.
uint16 maxExpPrims;
union
{
struct
{
uint8 maxExpVerts : 1;
uint8 maxExpPrims : 1;
uint8 reserved : 6;
};
uint8 uAll;
} hasEntry;
};
struct VgtGsInstanceCntMetadata
{
/// Number of GS primitive instances. If set to 0, GS instancing is treated as disabled.
uint8 count;
union
{
struct
{
/// Whether or not GS instancing is enabled.
uint8 enable : 1;
/// Allows each GS instance to emit max_vert_out.
uint8 enMaxVertOutPerGsInstance : 1;
uint8 reserved : 6;
};
uint8 uAll;
} flags;
union
{
struct
{
uint8 enable : 1;
uint8 count : 1;
uint8 enMaxVertOutPerGsInstance : 1;
uint8 reserved : 5;
};
uint8 uAll;
} hasEntry;
};
struct VgtGsOutPrimTypeMetadata
{
/// Output primitive type from the geometry shader for stream 0.
Abi::GsOutPrimType outprimType;
/// Output primitive type from the geometry shader for stream 1.
Abi::GsOutPrimType outprimType_1;
/// Output primitive type from the geometry shader for stream 2.
Abi::GsOutPrimType outprimType_2;
/// Output primitive type from the geometry shader for stream 3.
Abi::GsOutPrimType outprimType_3;
union
{
struct
{
/// If set, outprim_type[0] field only represents stream 0. Otherwise, outprim_type[0] field represents all
/// streams.
uint8 uniqueTypePerStream : 1;
uint8 reserved : 7;
};
uint8 uAll;
} flags;
union
{
struct
{
uint8 outprimType : 1;
uint8 outprimType_1 : 1;
uint8 outprimType_2 : 1;
uint8 outprimType_3 : 1;
uint8 uniqueTypePerStream : 1;
uint8 reserved : 3;
};
uint8 uAll;
} hasEntry;
};
struct GeNggSubgrpCntlMetadata
{
/// Controls the maximum amplification factor applied to each primitive in a subgroup.
uint16 primAmpFactor;
/// Controls the number of threads launched per subgroup in NGG fast launch mode.
uint16 threadsPerSubgroup;
union
{
struct
{
uint8 primAmpFactor : 1;
uint8 threadsPerSubgroup : 1;
uint8 reserved : 6;
};
uint8 uAll;
} hasEntry;
};
struct VgtGsOnchipCntlMetadata
{
/// Worst case number of ES vertices needed to create the GS prims specified in gs_prims_per_subgroup.
uint16 esVertsPerSubgroup;
/// Number of GS primitives that can fit into LDS.
uint16 gsPrimsPerSubgroup;
/// Total number of GS primitives taking into account GS instancing.
uint16 gsInstPrimsPerSubgrp;
union
{
struct
{
uint8 esVertsPerSubgroup : 1;
uint8 gsPrimsPerSubgroup : 1;
uint8 gsInstPrimsPerSubgrp : 1;
uint8 reserved : 5;
};
uint8 uAll;
} hasEntry;
};
struct PaClVsOutCntlMetadata
{
union
{
struct
{
/// Enable ClipDistance 0 to be used for user-defined clipping.
uint32 clipDistEna_0 : 1;
/// Enable ClipDistance 1 to be used for user-defined clipping.
uint32 clipDistEna_1 : 1;
/// Enable ClipDistance 2 to be used for user-defined clipping.
uint32 clipDistEna_2 : 1;
/// Enable ClipDistance 3 to be used for user-defined clipping.
uint32 clipDistEna_3 : 1;
/// Enable ClipDistance 4 to be used for user-defined clipping.
uint32 clipDistEna_4 : 1;
/// Enable ClipDistance 5 to be used for user-defined clipping.
uint32 clipDistEna_5 : 1;
/// Enable ClipDistance 6 to be used for user-defined clipping.
uint32 clipDistEna_6 : 1;
/// Enable ClipDistance 7 to be used for user-defined clipping.
uint32 clipDistEna_7 : 1;
/// Enable CullDistance 0 to be used for user-defined clip discard.
uint32 cullDistEna_0 : 1;
/// Enable CullDistance 1 to be used for user-defined clip discard.
uint32 cullDistEna_1 : 1;
/// Enable CullDistance 2 to be used for user-defined clip discard.
uint32 cullDistEna_2 : 1;
/// Enable CullDistance 3 to be used for user-defined clip discard.
uint32 cullDistEna_3 : 1;
/// Enable CullDistance 4 to be used for user-defined clip discard.
uint32 cullDistEna_4 : 1;
/// Enable CullDistance 5 to be used for user-defined clip discard.
uint32 cullDistEna_5 : 1;
/// Enable CullDistance 6 to be used for user-defined clip discard.
uint32 cullDistEna_6 : 1;
/// Enable CullDistance 7 to be used for user-defined clip discard.
uint32 cullDistEna_7 : 1;
/// Use the PointSize output from the VS.
uint32 useVtxPointSize : 1;
/// Use the EdgeFlag output from the VS.
uint32 useVtxEdgeFlag : 1;
/// Use the RenderTargetArrayIndex output from the VS.
uint32 useVtxRenderTargetIndx : 1;
/// Use the ViewportArrayIndex output from the VS.
uint32 useVtxViewportIndx : 1;
/// Use the KillFlag output from the VS.
uint32 useVtxKillFlag : 1;
/// Output the VS output misc vector from the VS.
uint32 vsOutMiscVecEna : 1;
/// Output the VS output ccdist0 vector from the VS.
uint32 vsOutCcDist0VecEna : 1;
/// Output the VS output ccdist1 vector from the VS.
uint32 vsOutCcDist1VecEna : 1;
/// Enable performance optimization where SX outputs vs_out_misc_vec data on extra side bus.
uint32 vsOutMiscSideBusEna : 1;
/// Use the LineWidth output from the VS.
uint32 useVtxLineWidth : 1;
/// Use the VRS rates output from the VS.
uint32 useVtxVrsRate : 1;
/// Force the vertex rate combiner into bypass mode.
uint32 bypassVtxRateCombiner : 1;
/// Force the primitive rate combiner into bypass mode.
uint32 bypassPrimRateCombiner : 1;
/// Use the GsCutFlag output from the VS.
uint32 useVtxGsCutFlag : 1;
/// Use the FSR select output from the VS.
uint32 useVtxFsrSelect : 1;
uint32 reserved : 1;
};
uint32 uAll;
} flags;
union
{