Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ VkFormat DisplayTexelFormat(std::uint64_t pixelFormat) {
ResidentPresent ResidentPresentPath(VkFormat storage, std::uint64_t pixelFormat, bool blitSource) {
if (DisplayHalfFloat(pixelFormat)) return storage == VK_FORMAT_R16G16B16A16_SFLOAT ? ResidentPresent::Convert : ResidentPresent::None;
const bool tenBit = DisplayTenBit(pixelFormat);
const bool pq = DisplayPq(pixelFormat);
if (!tenBit && blitSource && storage == DisplayTexelFormat(pixelFormat)) return ResidentPresent::Blit;
switch (storage) {
case VK_FORMAT_A2B10G10R10_UNORM_PACK32:
Expand All @@ -56,7 +57,7 @@ ResidentPresent ResidentPresentPath(VkFormat storage, std::uint64_t pixelFormat,
case VK_FORMAT_B8G8R8A8_UNORM:
case VK_FORMAT_B8G8R8A8_SRGB:
case VK_FORMAT_B8G8R8A8_UINT:
return tenBit ? ResidentPresent::None : ResidentPresent::Convert;
return (tenBit && pq) ? ResidentPresent::None : ResidentPresent::Convert;
default:
return ResidentPresent::None;
}
Expand Down
5 changes: 3 additions & 2 deletions core/libs/prx/libSceAgcDriver/tests/ResidentPresent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,13 @@ void decisionTests() {
Require(ResidentPresentPath(VK_FORMAT_R8G8B8A8_UNORM, Bgra8, true) == ResidentPresent::Convert && ResidentPresentPath(VK_FORMAT_B8G8R8A8_UNORM, Rgba8, true) == ResidentPresent::Convert, "an 8-bit image in the other order is not converted");
Require(ResidentPresentPath(VK_FORMAT_R8G8B8A8_SRGB, Rgba8, true) == ResidentPresent::Convert, "an sRGB image is blitted (the blit would decode it)");
Require(ResidentPresentPath(VK_FORMAT_R8G8B8A8_UINT, Rgba8, true) == ResidentPresent::Convert && ResidentPresentPath(VK_FORMAT_B8G8R8A8_UINT, Bgra8, true) == ResidentPresent::Convert, "an 8-bit integer image is not converted");
Require(ResidentPresentPath(VK_FORMAT_R8G8B8A8_UINT, Rgba8 | TenBit, true) == ResidentPresent::None, "an 8-bit integer image presents a 10-bit display");
Require(ResidentPresentPath(VK_FORMAT_R8G8B8A8_UINT, Rgba8 | TenBit, true) == ResidentPresent::Convert, "an 8-bit integer image is converted for a 10-bit display");
Require(ResidentPresentPath(VK_FORMAT_R8G8B8A8_SRGB, Rgba8 | TenBit, true) == ResidentPresent::Convert && ResidentPresentPath(VK_FORMAT_B8G8R8A8_SRGB, Bgra8 | TenBit, true) == ResidentPresent::Convert, "an sRGB image is converted for a 10-bit display");
for (const auto display : {Bgra8 | TenBit, Rgba8 | TenBit}) {
for (const auto storage : {VK_FORMAT_A2B10G10R10_UNORM_PACK32, VK_FORMAT_A2R10G10B10_UNORM_PACK32}) {
Require(ResidentPresentPath(storage, display, true) == ResidentPresent::Convert, "a 10-bit image is blitted (the blit rounds where the guest path truncates)");
}
Require(ResidentPresentPath(VK_FORMAT_B8G8R8A8_UNORM, display, true) == ResidentPresent::None, "an 8-bit image presents a 10-bit display");
Require(ResidentPresentPath(VK_FORMAT_B8G8R8A8_UNORM, display, true) == ResidentPresent::Convert, "an 8-bit image presents a 10-bit display");
}
Require(DisplayTexelFormat(Bgr10Pq) == VK_FORMAT_A2R10G10B10_UNORM_PACK32 && DisplayTexelFormat(Rgb10Pq) == VK_FORMAT_A2B10G10R10_UNORM_PACK32, "PQ display texel formats are wrong");
for (const auto display : {Bgr10Pq, Rgb10Pq}) {
Expand Down