mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-11-06 13:30:00 +00:00
buffer_store_format_* and tbuffer_store_format_* wrote the register bits as they were: an 8_UNORM store of 1.0f wrote 0x00 (the low byte of 0x3f800000), packed formats such as 2_10_10_10 overwrote the whole word with each component, and the components the instruction does not provide were left untouched. Each component is now encoded as the hardware does: unorm/snorm (and uscaled/sscaled, which store the same way) round x*M exactly to nearest even after clamping, with NaN as 0; uint/sint saturate; f16 and the 11/10-bit floats truncate toward zero and saturate. The whole element is written, with the missing components as 0, and packed formats are composed into one word. Co-Authored-By: Claude <[email protected]>