mirror of
https://github.com/ProjectLeonida/mandy.git
synced 2026-12-06 22:28:38 +00:00
GFX10 format names list the channel widths from the top bit, so 2_10_10_10 (50) is R10G10B10A2 and 10_10_10_2 (44) has a 2-bit x. FORMATS read them from bit 0, which swapped the two for typed buffer loads and stores. cs_store now writes its R10G10B10A2 word through 50. cs_fmt_1010102 covers both formats; to run it, buffer_load_format masks a shift that was 32 for aligned elements, and the test interpreter gains the conversions it needs.
32 lines
1.0 KiB
NASM
32 lines
1.0 KiB
NASM
; buffer_store_format encoder: rgba8 unorm (56), 2_10_10_10 unorm (50), two r16f (13) halves of one dword (atomic merge),
|
|
; d16 rgba16f (71). Run: vk_compute_test cs_store.spv 1 dump -> out[0..5] = 0x400080ff 0xe00003ff 0x3c004000
|
|
; 0xeeeeeeee (untouched) 0x40003c00 0xbc003800. Same FSSM header as cs_lds.
|
|
v_cmpx_eq_u32_e32 0, v0
|
|
v_mov_b32_e32 v1, 1.0
|
|
v_mov_b32_e32 v2, 0.5
|
|
v_mov_b32_e32 v3, 0
|
|
v_mov_b32_e32 v4, 0x3e800000
|
|
v_mov_b32_e32 v5, 0
|
|
s_mov_b32 s3, 0x38000
|
|
buffer_store_format_xyzw v[1:4], v5, s[0:3], 0 offen
|
|
v_mov_b32_e32 v6, 1.0
|
|
v_mov_b32_e32 v7, 0
|
|
v_mov_b32_e32 v8, 0.5
|
|
v_mov_b32_e32 v9, 1.0
|
|
v_mov_b32_e32 v5, 4
|
|
s_mov_b32 s3, 0x32000
|
|
buffer_store_format_xyzw v[6:9], v5, s[0:3], 0 offen
|
|
s_mov_b32 s3, 0xd000
|
|
v_mov_b32_e32 v10, 2.0
|
|
v_mov_b32_e32 v5, 8
|
|
buffer_store_format_x v10, v5, s[0:3], 0 offen
|
|
v_mov_b32_e32 v10, 1.0
|
|
v_mov_b32_e32 v5, 10
|
|
buffer_store_format_x v10, v5, s[0:3], 0 offen
|
|
s_mov_b32 s3, 0x47000
|
|
v_mov_b32_e32 v11, 0x40003c00
|
|
v_mov_b32_e32 v12, 0xbc003800
|
|
v_mov_b32_e32 v5, 16
|
|
buffer_store_format_d16_xyzw v[11:12], v5, s[0:3], 0 offen
|
|
s_endpgm
|