mirror of
https://github.com/KytyPS5/KytyPS5.git
synced 2026-10-30 01:01:21 +00:00
tests: cover low-alpha packed tiler conversion in both directions
This commit is contained in:
1 parent
4592e4c178
commit
25f3ba4eae
1 file changed
+10
@@ -20889,6 +20889,14 @@ public:
|
|||||||
std::swap(channels[0], channels[2]);
|
std::swap(channels[0], channels[2]);
|
||||||
std::memcpy(dst->data() + dst_offset, channels.data(),
|
std::memcpy(dst->data() + dst_offset, channels.data(),
|
||||||
sizeof(channels));
|
sizeof(channels));
|
||||||
|
} else if (info.GetColorTransform() == ColorTransform::Rotate2_10_10_10) {
|
||||||
|
uint32_t packed = 0;
|
||||||
|
std::memcpy(&packed, src.data() + src_offset, sizeof(packed));
|
||||||
|
// The guest format stores the two-bit channel low; the host format stores it high.
|
||||||
|
const uint32_t alpha = to_tiled ? packed >> 30u : packed & 3u;
|
||||||
|
const uint32_t color = to_tiled ? packed & 0x3fffffffu : packed >> 2u;
|
||||||
|
packed = to_tiled ? (color << 2u) | alpha : color | (alpha << 30u);
|
||||||
|
std::memcpy(dst->data() + dst_offset, &packed, sizeof(packed));
|
||||||
} else {
|
} else {
|
||||||
std::memcpy(dst->data() + dst_offset, src.data() + src_offset,
|
std::memcpy(dst->data() + dst_offset, src.data() + src_offset,
|
||||||
block.bytes_per_element);
|
block.bytes_per_element);
|
||||||
@@ -21282,6 +21290,8 @@ public:
|
|||||||
convert_reference(false, &cpu, tiled, layout);
|
convert_reference(false, &cpu, tiled, layout);
|
||||||
gpu_detile(tiled, &gpu, total.size, total.size, layout);
|
gpu_detile(tiled, &gpu, total.size, total.size, layout);
|
||||||
compare("format bytes", cpu, gpu);
|
compare("format bytes", cpu, gpu);
|
||||||
|
if (layout.GetColorTransform() == ColorTransform::Rotate2_10_10_10)
|
||||||
|
check_round_trip("low-alpha packed format", total.size, layout);
|
||||||
++format_cases;
|
++format_cases;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user