feat(shader): implement the D16 format buffer stores #331
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/331"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-02T06:35:42Z.
What
This adds the store half of the D16 formats. The loads were #329.
buffer_store_format_d16_{x,xy,xyz,xyzw}(0x84-0x87) andbuffer_store_format_d16_hi_x(0x27).tbuffer_store_format_d16_{x,xy,xyz,xyzw}(0x0c-0x0f).Each component is a 16-bit half: two per VGPR, low half first, and
_hi_xtakes the high half.Semantics measured on an RDNA2 GPU (2048 vectors × 15 stores, all matched by a Python model):
0x3c00→0xffin8_UINT,0x00003c00in32_UINT)0xbc00→0x80in8_SINT,0xffffbc00in32_SINT)The whole element is written with missing components as 0, as in #330.
The f16 → f32 widening is done with integer ops: subnormals are normalized with
FindUMsband NaN payloads are kept.unpackHalf2x16may flush f16 denormals or quiet NaNs, depending on the driver, and both are visible in the 11/10-bit float formats.Test
agc_driver_format_d16_store: 16 results × 32 lanes captured on the RDNA2 GPU. It covers every component type above, f16 specials (±inf, NaN0x7e00/0x7c01, subnormals0x0001/0x8001, 65504) in both halves, thexy/xyz/xyzwpacking with zero fill, and_hi_xthrough the descriptor's format.Tested
Linux, full ctest (102) passes.
8unorm is 0xaaaaaa00, expected 0xaaaaaaff.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-02T06:36:03Z.
Progress report (
d3ec1f1→b29fe00)📈 GPU shader instructions: 75.73% (+4.72%, +55 implemented instructions)
✅ 55 implemented
DS_READ_I8_D16DS_READ_I8_D16_HIDS_READ_U8_D16DS_READ_U8_D16_HIDS_WRITE_B8_D16_HIFLAT_LOAD_SBYTE_D16FLAT_LOAD_SBYTE_D16_HIFLAT_LOAD_SHORT_D16FLAT_LOAD_SHORT_D16_HIFLAT_LOAD_UBYTE_D16FLAT_LOAD_UBYTE_D16_HIFLAT_STORE_BYTE_D16_HIFLAT_STORE_SHORT_D16_HIGLOBAL_LOAD_SBYTE_D16GLOBAL_LOAD_SBYTE_D16_HIGLOBAL_LOAD_SHORT_D16GLOBAL_LOAD_SHORT_D16_HIGLOBAL_LOAD_UBYTE_D16GLOBAL_LOAD_UBYTE_D16_HIGLOBAL_STORE_BYTE_D16_HIGLOBAL_STORE_SHORT_D16_HITBUFFER_LOAD_FORMAT_D16_XTBUFFER_LOAD_FORMAT_D16_XYTBUFFER_LOAD_FORMAT_D16_XYZTBUFFER_LOAD_FORMAT_D16_XYZWTBUFFER_STORE_FORMAT_D16_XTBUFFER_STORE_FORMAT_D16_XYTBUFFER_STORE_FORMAT_D16_XYZTBUFFER_STORE_FORMAT_D16_XYZWBUFFER_LOAD_FORMAT_D16_HI_XBUFFER_LOAD_FORMAT_D16_XBUFFER_LOAD_FORMAT_D16_XYBUFFER_LOAD_FORMAT_D16_XYZBUFFER_LOAD_FORMAT_D16_XYZWBUFFER_LOAD_SBYTE_D16BUFFER_LOAD_SBYTE_D16_HIBUFFER_LOAD_SHORT_D16BUFFER_LOAD_SHORT_D16_HIBUFFER_LOAD_UBYTE_D16BUFFER_LOAD_UBYTE_D16_HIBUFFER_STORE_BYTE_D16_HIBUFFER_STORE_FORMAT_D16_HI_XBUFFER_STORE_FORMAT_D16_XBUFFER_STORE_FORMAT_D16_XYBUFFER_STORE_FORMAT_D16_XYZBUFFER_STORE_FORMAT_D16_XYZWBUFFER_STORE_SHORT_D16_HISCRATCH_LOAD_SBYTE_D16SCRATCH_LOAD_SBYTE_D16_HISCRATCH_LOAD_SHORT_D16SCRATCH_LOAD_SHORT_D16_HISCRATCH_LOAD_UBYTE_D16SCRATCH_LOAD_UBYTE_D16_HISCRATCH_STORE_BYTE_D16_HISCRATCH_STORE_SHORT_D16_HI