@@ -699,6 +699,15 @@ def populate_categories_and_models(self):
699
699
self .name_idx [i ].category = "Extended Command Information"
700
700
self .name_idx [i ].shader_stages = ("vertex" ,)
701
701
self .name_idx [i ].shader_model = 6 , 8
702
+ for i in ("HitObject_MakeMiss,HitObject_MakeNop" ).split ("," ):
703
+ self .name_idx [i ].category = "Shader Execution Reordering"
704
+ self .name_idx [i ].shader_model = 6 , 9
705
+ self .name_idx [i ].shader_stages = (
706
+ "library" ,
707
+ "raygeneration" ,
708
+ "closesthit" ,
709
+ "miss" ,
710
+ )
702
711
703
712
def populate_llvm_instructions (self ):
704
713
# Add instructions that map to LLVM instructions.
@@ -5550,7 +5559,43 @@ def UFI(name, **mappings):
5550
5559
next_op_idx = self .reserve_dxil_op_range ("ReservedA" , next_op_idx , 3 )
5551
5560
5552
5561
# Shader Execution Reordering
5553
- next_op_idx = self .reserve_dxil_op_range ("ReservedB" , next_op_idx , 31 )
5562
+ next_op_idx = self .reserve_dxil_op_range ("ReservedB" , next_op_idx , 3 )
5563
+
5564
+ self .add_dxil_op (
5565
+ "HitObject_MakeMiss" ,
5566
+ next_op_idx ,
5567
+ "HitObject_MakeMiss" ,
5568
+ "Creates a new HitObject representing a miss" ,
5569
+ "v" ,
5570
+ "rn" ,
5571
+ [
5572
+ db_dxil_param (0 , "hit_object" , "" , "HitObject with a committed miss" ),
5573
+ db_dxil_param (2 , "i32" , "RayFlags" , "ray flags" ),
5574
+ db_dxil_param (3 , "i32" , "MissShaderIndex" , "Miss shader index" ),
5575
+ db_dxil_param (4 , "f" , "Origin_X" , "Origin x of the ray" ),
5576
+ db_dxil_param (5 , "f" , "Origin_Y" , "Origin y of the ray" ),
5577
+ db_dxil_param (6 , "f" , "Origin_Z" , "Origin z of the ray" ),
5578
+ db_dxil_param (7 , "f" , "TMin" , "Tmin of the ray" ),
5579
+ db_dxil_param (8 , "f" , "Direction_X" , "Direction x of the ray" ),
5580
+ db_dxil_param (9 , "f" , "Direction_Y" , "Direction y of the ray" ),
5581
+ db_dxil_param (10 , "f" , "Direction_Z" , "Direction z of the ray" ),
5582
+ db_dxil_param (11 , "f" , "TMax" , "Tmax of the ray" ),
5583
+ ],
5584
+ )
5585
+ next_op_idx += 1
5586
+
5587
+ self .add_dxil_op (
5588
+ "HitObject_MakeNop" ,
5589
+ next_op_idx ,
5590
+ "HitObject_MakeNop" ,
5591
+ "Creates an empty nop HitObject" ,
5592
+ "v" ,
5593
+ "rn" ,
5594
+ [db_dxil_param (0 , "hit_object" , "" , "Empty nop HitObject" )],
5595
+ )
5596
+ next_op_idx += 1
5597
+
5598
+ next_op_idx = self .reserve_dxil_op_range ("ReservedB" , next_op_idx , 26 , 5 )
5554
5599
5555
5600
# Reserved block C
5556
5601
next_op_idx = self .reserve_dxil_op_range ("ReservedC" , next_op_idx , 10 )
@@ -8145,10 +8190,12 @@ def add_dxil_op_reserved(self, name, code_id):
8145
8190
)
8146
8191
self .instr .append (i )
8147
8192
8148
- def reserve_dxil_op_range (self , group_name , start_id , count ):
8193
+ def reserve_dxil_op_range (self , group_name , start_id , count , start_reserved_id = 0 ):
8149
8194
"Reserve a range of dxil opcodes for future use; returns next id"
8150
8195
for i in range (0 , count ):
8151
- self .add_dxil_op_reserved ("{0}{1}" .format (group_name , i ), start_id + i )
8196
+ self .add_dxil_op_reserved (
8197
+ "{0}{1}" .format (group_name , start_reserved_id + i ), start_id + i
8198
+ )
8152
8199
return start_id + count
8153
8200
8154
8201
def get_instr_by_llvm_name (self , llvm_name ):
0 commit comments