shader: support RDNA2 high-half short buffer stores

Co-authored-by: fxpw <fxpw@outlook.com>
This commit is contained in:
nmzikandfxpw committed 2026-10-14 20:55:50 +02:00
1 parent 6b1c4a7a71
commit 2f6ee0e91d
6 files changed
+59 -17

No files matched your search

+19
View File
@@ -15387,6 +15387,24 @@ void TestCapturedBufferLoadUbyteD16Decode() {
"captured BUFFER_LOAD_UBYTE_D16 lost its preserved half, address, or coherence flags");
}
void TestCapturedBufferStoreShortD16HiDecode() {
namespace Decoder = ShaderRecompiler::Decoder;
const uint32_t code[] = {0xe06c6000u, 0x80010326u};
Decoder::Instruction inst;
Decoder::DecodeInstruction(code, 0, inst);
Check(inst.opcode == Decoder::Opcode::BUFFER_STORE_SHORT_D16_HI &&
inst.word_count == 2 && inst.data_dwords == 1 && inst.data_bits == 16 &&
!inst.data_signed && !inst.formatted && !inst.typed,
"captured BUFFER_STORE_SHORT_D16_HI lost its raw halfword payload");
Check(inst.dst.kind == Decoder::OperandKind::Vgpr && inst.dst.reg == 3 &&
inst.dst.sdwa_sel == 5 && !inst.dst.sdwa_sext &&
inst.src0.kind == Decoder::OperandKind::Vgpr && inst.src0.reg == 38 &&
inst.src1.kind == Decoder::OperandKind::Sgpr && inst.src1.reg == 4 &&
inst.src2.kind == Decoder::OperandKind::IntegerInlineConstant && inst.src2.value == 0 &&
inst.idxen && !inst.offen && inst.offset == 0 && inst.glc && !inst.dlc && !inst.slc,
"captured BUFFER_STORE_SHORT_D16_HI lost its high half, address, or coherence flags");
}
void TestCapturedBufferStoreD16XyzwDecode() {
namespace Decoder = ShaderRecompiler::Decoder;
const uint32_t code[] = {0xe21c6000u, 0x8002000eu};
@@ -16089,6 +16107,7 @@ int main() {
TestPixelProgramCacheBindingIdentity();
TestGraphicsPushConstantPlacement();
TestCapturedBufferLoadUbyteD16Decode();
TestCapturedBufferStoreShortD16HiDecode();
TestCapturedBufferStoreD16XyzwDecode();
TestNewShaderRecompilerUnsupportedMemoryDecode();