graphics: decode register clears of RGBA16 UNORM, UINT and SINT and RG32 UINT and SINT targets

Co-authored-by: Senaxx <michelbeld@gmail.com>
Co-authored-by: Jetsku <59046009+Jetsku@users.noreply.github.com>
This commit is contained in:
nmzik
2026-10-26 07:40:55 +01:00
parent 17a0f53d39
commit f90a8b1589
2 changed files with 43 additions and 10 deletions
+17 -3
View File
@@ -12506,6 +12506,8 @@ public:
PackedCase{vk::Format::eR16G16Unorm, 0x0000ffffu, {1.0f, 0.0f}},
PackedCase{vk::Format::eR16G16Unorm, 0x80000001u,
{1.0f / 65535.0f, 32768.0f / 65535.0f}},
PackedCase{vk::Format::eR16G16B16A16Unorm, 0x000180000000ffffull,
{1.0f, 0.0f, 32768.0f / 65535.0f, 1.0f / 65535.0f}},
PackedCase{vk::Format::eR8Unorm, 0xffffff80u, {128.0f / 255.0f}},
PackedCase{vk::Format::eR8G8Unorm, 0xffff40ffu, {1.0f, 64.0f / 255.0f}},
};
@@ -12541,11 +12543,19 @@ public:
};
for (const auto &test : {UintCase{vk::Format::eR8Uint, 0xffffff05u, {5u}},
UintCase{vk::Format::eR8G8Uint, 0xffff0a05u, {5u, 10u}},
UintCase{vk::Format::eR16Uint, 0xffff1234u, {0x1234u}}}) {
Require(name, "packed unsigned color clear",
UintCase{vk::Format::eR16Uint, 0xffff1234u, {0x1234u}},
UintCase{vk::Format::eR16G16B16A16Uint, 0x4444333322221111ull,
{0x1111u, 0x2222u, 0x3333u, 0x4444u}},
UintCase{vk::Format::eR16G16B16A16Sint, 0x7fff0001ffff8000ull,
{0xffff8000u, 0xffffffffu, 1u, 0x7fffu}},
UintCase{vk::Format::eR32G32Uint, 0x89abcdef01234567ull,
{0x01234567u, 0x89abcdefu}},
UintCase{vk::Format::eR32G32Sint, 0x80000000ffffffffull,
{0xffffffffu, 0x80000000u}}}) {
Require(name, "packed integer color clear",
DecodePackedColorClear(test.format, test.word, clear) &&
std::bit_cast<std::array<uint32_t, 4>>(clear.uint32) == test.channels,
"narrow unsigned clear lost a channel or kept bits of the next one");
"integer clear lost a channel, its sign or bits of the next one");
}
Require(name, "R8 DWORD fill",
!DecodeColorDwordFill(vk::Format::eR8Uint, 0x01020304u, clear) &&
@@ -12561,6 +12571,10 @@ public:
DecodeColorDwordFill(vk::Format::eR32G32Sfloat, 0x3f800000u, clear) &&
clear.float32[0] == 1.0f && clear.float32[1] == 1.0f,
"a repeated DWORD fill was decoded as a two-register clear");
Require(name, "RGBA16 DWORD fill",
DecodeColorDwordFill(vk::Format::eR16G16B16A16Uint, 0x22221111u, clear) &&
clear.uint32[2] == 0x1111u && clear.uint32[3] == 0x2222u,
"a DWORD fill did not repeat across the 64-bit pixel");
constexpr uintptr_t base = 0x0000000204100000ull;
constexpr uint64_t allocation_size = 0x1000000;
constexpr uint64_t allocation_alignment = 0x10000;