@@ -840,13 +840,35 @@ pub(crate) mod raw {
840840 }
841841 default_zeroed ! ( GpuStatsVtx ) ;
842842
843+ #[ versions( AGX ) ]
843844 #[ derive( Debug ) ]
844845 #[ repr( C ) ]
845846 pub ( crate ) struct GpuStatsFrag {
846847 // This changes all the time and we don't use it, let's just make it a big buffer
847- pub ( crate ) opaque : Array < 0x3000 , u8 > ,
848+ // except for these two fields which may need init.
849+ #[ ver( G >= G14X ) ]
850+ pub ( crate ) unk1_0 : Array < 0x910 , u8 > ,
851+ pub ( crate ) unk1 : Array < 0x100 , u8 > ,
852+ pub ( crate ) cur_stamp_id : i32 ,
853+ pub ( crate ) unk2 : Array < 0x14 , u8 > ,
854+ pub ( crate ) unk_id : i32 ,
855+ pub ( crate ) unk3 : Array < 0x1000 , u8 > ,
856+ }
857+
858+ #[ versions( AGX ) ]
859+ impl Default for GpuStatsFrag :: ver {
860+ fn default ( ) -> Self {
861+ Self {
862+ #[ ver( G >= G14X ) ]
863+ unk1_0 : Default :: default ( ) ,
864+ unk1 : Default :: default ( ) ,
865+ cur_stamp_id : -1 ,
866+ unk2 : Default :: default ( ) ,
867+ unk_id : -1 ,
868+ unk3 : Default :: default ( ) ,
869+ }
870+ }
848871 }
849- default_zeroed ! ( GpuStatsFrag ) ;
850872
851873 #[ derive( Debug ) ]
852874 #[ repr( C ) ]
@@ -856,14 +878,14 @@ pub(crate) mod raw {
856878 }
857879 default_zeroed ! ( GpuGlobalStatsVtx ) ;
858880
859- #[ derive( Debug ) ]
881+ #[ versions( AGX ) ]
882+ #[ derive( Debug , Default ) ]
860883 #[ repr( C ) ]
861884 pub ( crate ) struct GpuGlobalStatsFrag {
862885 pub ( crate ) total_cmds : u32 ,
863886 pub ( crate ) unk_4 : u32 ,
864- pub ( crate ) stats : GpuStatsFrag ,
887+ pub ( crate ) stats : GpuStatsFrag :: ver ,
865888 }
866- default_zeroed ! ( GpuGlobalStatsFrag ) ;
867889
868890 #[ derive( Debug ) ]
869891 #[ repr( C ) ]
@@ -933,7 +955,7 @@ pub(crate) mod raw {
933955 pub ( crate ) unk_160 : U64 ,
934956 pub ( crate ) unk_168 : U64 ,
935957 pub ( crate ) stats_vtx : GpuPointer < ' a , super :: GpuGlobalStatsVtx > ,
936- pub ( crate ) stats_frag : GpuPointer < ' a , super :: GpuGlobalStatsFrag > ,
958+ pub ( crate ) stats_frag : GpuPointer < ' a , super :: GpuGlobalStatsFrag :: ver > ,
937959 pub ( crate ) stats_comp : GpuPointer < ' a , super :: GpuStatsComp > ,
938960 pub ( crate ) hwdata_a : GpuPointer < ' a , super :: HwDataA :: ver > ,
939961 pub ( crate ) unkptr_190 : GpuPointer < ' a , & ' a [ u8 ] > ,
@@ -1271,7 +1293,8 @@ where
12711293
12721294trivial_gpustruct ! ( FwStatus ) ;
12731295trivial_gpustruct ! ( GpuGlobalStatsVtx ) ;
1274- trivial_gpustruct ! ( GpuGlobalStatsFrag ) ;
1296+ #[ versions( AGX ) ]
1297+ trivial_gpustruct ! ( GpuGlobalStatsFrag :: ver) ;
12751298trivial_gpustruct ! ( GpuStatsComp ) ;
12761299
12771300#[ versions( AGX ) ]
@@ -1284,7 +1307,7 @@ trivial_gpustruct!(HwDataB::ver);
12841307#[ derive( Debug ) ]
12851308pub ( crate ) struct Stats {
12861309 pub ( crate ) vtx : GpuObject < GpuGlobalStatsVtx > ,
1287- pub ( crate ) frag : GpuObject < GpuGlobalStatsFrag > ,
1310+ pub ( crate ) frag : GpuObject < GpuGlobalStatsFrag :: ver > ,
12881311 pub ( crate ) comp : GpuObject < GpuStatsComp > ,
12891312}
12901313
0 commit comments