m1n1.fw.agx: Helper and sampler stuff

Signed-off-by: Asahi Lina <lina@asahilina.net>
This commit is contained in:
Asahi Lina 2024-01-17 17:29:47 +09:00
parent 421dfa4252
commit b50e29bcf6
3 changed files with 33 additions and 21 deletions

View file

@ -584,8 +584,9 @@ class GPURenderer:
wc_3d.struct_2.unk_108 = [0x0, 0x0, 0x0, 0x0, 0x0, 0x0]
wc_3d.struct_2.pipeline_base = self.ctx.pipeline_base
wc_3d.struct_2.unk_140 = 0x8c60
wc_3d.struct_2.unk_148 = 0x0
wc_3d.struct_2.unk_150 = 0x0
wc_3d.struct_2.helper_program = 0
wc_3d.struct_2.unk_14c = 0
wc_3d.struct_2.helper_arg = 0
wc_3d.struct_2.unk_158 = 0x1c
wc_3d.struct_2.unk_160 = 0
wc_3d.struct_2.unk_168_padding = bytes(0x1d8)
@ -754,8 +755,9 @@ class GPURenderer:
wc_3d.struct_6.unk_10 = 0x0
wc_3d.struct_6.encoder_id = cmdbuf.encoder_id
wc_3d.struct_6.unk_1c = 0xffffffff
wc_3d.struct_6.unknown_buffer = unk_buf._addr
wc_3d.struct_6.unk_28 = 0x0
wc_3d.struct_6.sampler_array = unk_buf._addr
wc_3d.struct_6.sampler_count = 0x0
wc_3d.struct_6.sampler_max = 0x0
wc_3d.struct_6.unk_30 = int(process_empty_tiles)
wc_3d.struct_6.unk_34 = int(no_clear_pipeline_textures)
wc_3d.struct_6.unk_38 = int(msaa_zs)
@ -1010,7 +1012,10 @@ class GPURenderer:
wc_ta.struct_2.tvb_cluster_meta4 = unk_tile_buf5._addr | 0x3000_0000_0000_0000
wc_ta.struct_2.unk_f0 = 0x20 # fixed
wc_ta.struct_2.unk_f8 = 0x8c60 # fixed
wc_ta.struct_2.unk_100 = [0x0, 0x0, 0x0] # fixed
wc_ta.struct_2.helper_program = 0
wc_ta.struct_2.unk_104 = 0
wc_ta.struct_2.helper_arg = 0
wc_ta.struct_2.unk_110 = 0
wc_ta.struct_2.unk_118 = 0x1c # fixed
wc_ta.registers_addr = 0
@ -1120,8 +1125,9 @@ class GPURenderer:
wc_ta.struct_3.encoder_id = cmdbuf.encoder_id
wc_ta.struct_3.unk_538 = 0x0 # fixed
wc_ta.struct_3.unk_53c = 0xffffffff
wc_ta.struct_3.unknown_buffer = wc_3d.struct_6.unknown_buffer
wc_ta.struct_3.unk_548 = 0x0 # fixed
wc_ta.struct_3.sampler_array = wc_3d.struct_6.sampler_array
wc_ta.struct_3.sampler_count = 0x0
wc_ta.struct_3.sampler_max = 0x0
wc_ta.struct_3.unk_550 = [
0x0, 0x0, # fixed
0x0, # memoryless_rts_used

View file

@ -329,7 +329,7 @@ class WorkCommandTA(ConstructClass):
Ver("G < G14X", "struct_2" / StartTACmdStruct2), # 0x11c bytes
Ver("G < G14X", "unk_154" / Default(HexDump(Bytes(0x268)), bytes(0x268))), # unknown
Ver("G < G14X", "tiling_params" / TilingParameters), # unknown
Ver("G < G14X", "unk_3e8" / HexDump(Bytes(0x64))), # unknown
Ver("G < G14X", "unk_3e8" / HexDump(Bytes(0x60))), # unknown
"registers_addr" / Int64ul,
"register_count" / Int16ul,
"registers_length" / Int16ul,

View file

@ -227,7 +227,7 @@ class Start3DStruct1(ConstructClass):
"unk_36" / Int16ul,
"unk_38" / Int32ul,
"unk_3c" / Int32ul,
"unk_40" / Int32ul,
"helper_cfg" / Int32ul,
"unk_44_padding" / HexDump(Bytes(0x9c)),
)
@ -354,8 +354,9 @@ class Start3DStruct6(ConstructClass):
"unk_10" / Int32ul,
"encoder_id" / Int64ul,
"unk_1c" / Int32ul,
"unknown_buffer" / Int64ul,
"unk_28" / Int64ul,
"sampler_array" / Int64ul,
"sampler_count" / Int32ul,
"sampler_max" / Int32ul,
"unk_30" / Int32ul,
"unk_34" / Int32ul,
"unk_38" / Int32ul,
@ -483,6 +484,7 @@ class TilingParameters(ConstructClass):
"size3" / Int32ul,
"unk_24" / Int32ul,
"unk_28" / Int32ul,
"helper_cfg" / Int32ul,
)
class StartTACmdStruct2(ConstructClass):
@ -545,8 +547,9 @@ class StartTACmdStruct3(ConstructClass):
"encoder_id" / Int32ul,
"unk_538" / Int32ul,
"unk_53c" / Int32ul,
"unknown_buffer" / Int64ul,
"unk_548" / Int64ul,
"sampler_array" / Int64ul,
"sampler_count" / Int32ul,
"sampler_max" / Int32ul,
"unk_550" / Array(6, Int32ul),
"stamp1_addr" / WrappedPointer, # same contents as below
"stamp1" / ROPointer(this.stamp1_addr.value, StampCounter),
@ -667,14 +670,8 @@ class EncoderParams(ConstructClass):
"unk_1c" / Int64ul,
)
class ComputeLayout(ConstructClass):
class SubBufferList(ConstructClass):
subcon = Struct(
"unk_0" / Int32ul,
"unk_4" / HexDump(Bytes(0x20)),
"blocks_per_core" / Int32ul,
"unk_28" / HexDump(Bytes(0x1c)),
"core_list" / Array(160, Int16ul),
"work_lists" / Array(8, Array(272, Array(4, Int32ul))),
# Least significant byte encoding
# 7654 3210
# ==== ====
@ -686,6 +683,15 @@ class ComputeLayout(ConstructClass):
# 0001 1111 - Block size 0x40000
# 0011 1111 - Block size 0x100000? (not seen)
# 0111 1111 - Block size 0x400000
"buffers" / Array(256 + 12, Array(4, Int32ul))
)
class HelperArg(ConstructClass):
subcon = Struct(
"core_stride" / Int32ul,
"alloc_size_map" / Array(16, Int16ul),
"max_subgroups" / Array(16, Int16ul),
"core_list" / Array(128, Int16ul),
)
class ComputeInfo(ConstructClass):
@ -703,7 +709,7 @@ class ComputeInfo(ConstructClass):
"helper_program" / Int32ul, # 0x98000; bit 0: enable
"unk_44" / Int32ul, # 0
"helper_arg" / Int64ul, # work layout
"unk_50" / Int32ul, # 0x40 - Size? only if work layout is provided
"helper_cfg" / Int32ul, # 0x40 - Size? only if work layout is provided
"unk_54" / Int32ul, # 0
"unk_58" / Int32ul, # 1
"unk_5c" / Int32ul, # 0