mirror of
https://github.com/KytyPS5/KytyPS5.git
synced 2026-10-21 03:16:54 +02:00
shader: decode PS5 image_gather4_c_a and image_gather4_c_o_a
This commit is contained in:
@@ -195,6 +195,9 @@ constexpr MimgGatherInfo MIMG_GATHER_OPCODE_LIST[] = {
|
||||
{0x5fu, Opcode::IMAGE_GATHER4_C_LZ_O,
|
||||
ImageSampleFlagCompare | ImageSampleFlagLevelZero | ImageSampleFlagOffset},
|
||||
{0x61u, Opcode::IMAGE_GATHER4H, ImageSampleFlagGatherHorizontal},
|
||||
{0xc8u, Opcode::IMAGE_GATHER4_C, ImageSampleFlagCompare | ImageSampleFlagAdjust},
|
||||
{0xd8u, Opcode::IMAGE_GATHER4_C_O,
|
||||
ImageSampleFlagCompare | ImageSampleFlagOffset | ImageSampleFlagAdjust},
|
||||
};
|
||||
|
||||
constexpr MimgAtomicInfo MIMG_ATOMIC_OPCODE_LIST[] = {
|
||||
|
||||
@@ -6214,6 +6214,10 @@ void TestNewShaderRecompilerImageGatherVariants() {
|
||||
EncodeMimg1(76, 0, 1, 20), // image_gather4_c_o
|
||||
EncodeMimg0(0x5f, 0x1),
|
||||
EncodeMimg1(80, 0, 1, 24), // image_gather4_c_lz_o
|
||||
EncodeMimg0(0xc8, 0x1),
|
||||
EncodeMimg1(84, 0, 1, 28), // image_gather4_c_a
|
||||
EncodeMimg0(0xd8, 0x1),
|
||||
EncodeMimg1(88, 0, 1, 32), // image_gather4_c_o_a
|
||||
0xbf810000u,
|
||||
};
|
||||
|
||||
@@ -6249,6 +6253,10 @@ void TestNewShaderRecompilerImageGatherVariants() {
|
||||
Check((result.decoded_dump.find("sample_flags=compare|offset|level_zero addr_components=4") != std::string::npos),
|
||||
"IMAGE_GATHER4_C_LZ_O did not expose compare+offset+level-zero sample "
|
||||
"metadata");
|
||||
Check((result.decoded_dump.find("sample_flags=compare|adjust addr_components=3") != std::string::npos),
|
||||
"PS5 IMAGE_GATHER4_C_A did not expose compare+adjust sample metadata");
|
||||
Check((result.decoded_dump.find("sample_flags=compare|offset|adjust addr_components=4") != std::string::npos),
|
||||
"PS5 IMAGE_GATHER4_C_O_A did not expose compare+offset+adjust sample metadata");
|
||||
Check((result.ir_dump.find("ImageGather4 v60") != std::string::npos),
|
||||
"IMAGE_GATHER4_LZ did not lower to shared IR ImageGather4");
|
||||
Check((result.ir_dump.find("ImageGather4 v64") != std::string::npos),
|
||||
@@ -6261,6 +6269,10 @@ void TestNewShaderRecompilerImageGatherVariants() {
|
||||
"IMAGE_GATHER4_C_O did not lower to shared IR ImageGather4");
|
||||
Check((result.ir_dump.find("ImageGather4 v80") != std::string::npos),
|
||||
"IMAGE_GATHER4_C_LZ_O did not lower to shared IR ImageGather4");
|
||||
Check((result.ir_dump.find("ImageGather4 v84") != std::string::npos),
|
||||
"IMAGE_GATHER4_C_A did not lower to shared IR ImageGather4");
|
||||
Check((result.ir_dump.find("ImageGather4 v88") != std::string::npos),
|
||||
"IMAGE_GATHER4_C_O_A did not lower to shared IR ImageGather4");
|
||||
Check((result.ir_dump.find("data_dwords=4") != std::string::npos),
|
||||
"IMAGE_GATHER4 did not preserve four-component result metadata");
|
||||
Check((result.ir_dump.find("image_flags=0x30") != std::string::npos),
|
||||
@@ -6273,6 +6285,10 @@ void TestNewShaderRecompilerImageGatherVariants() {
|
||||
"IMAGE_GATHER4_C_O flags did not survive into IR memory metadata");
|
||||
Check((result.ir_dump.find("image_flags=0x38") != std::string::npos),
|
||||
"IMAGE_GATHER4_C_LZ_O flags did not survive into IR memory metadata");
|
||||
Check((result.ir_dump.find("image_flags=0x408") != std::string::npos),
|
||||
"IMAGE_GATHER4_C_A flags did not survive into IR memory metadata");
|
||||
Check((result.ir_dump.find("image_flags=0x418") != std::string::npos),
|
||||
"IMAGE_GATHER4_C_O_A flags did not survive into IR memory metadata");
|
||||
Check(SpirvContainsCapability(result.spirv, 25),
|
||||
"SPIR-V binary does not request ImageGatherExtended");
|
||||
Check(SpirvContainsOpcode(result.spirv, 96),
|
||||
|
||||
Reference in New Issue
Block a user