From 01c2ffd5f5b68042a514873de9820566f94963c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Mon, 29 Jan 2024 13:52:38 +0100 Subject: [PATCH 1/2] Add a missing thread name --- Core/Debugger/MemBlockInfo.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Core/Debugger/MemBlockInfo.cpp b/Core/Debugger/MemBlockInfo.cpp index f727d3a484..f90634dee9 100644 --- a/Core/Debugger/MemBlockInfo.cpp +++ b/Core/Debugger/MemBlockInfo.cpp @@ -25,6 +25,7 @@ #include "Common/Log.h" #include "Common/Serialize/Serializer.h" #include "Common/Serialize/SerializeFuncs.h" +#include "Common/Thread/ThreadUtil.h" #include "Core/Config.h" #include "Core/CoreTiming.h" #include "Core/Debugger/Breakpoints.h" @@ -675,6 +676,8 @@ size_t FormatMemWriteTagAtNoFlush(char *buf, size_t sz, const char *prefix, uint } static void FlushMemInfoThread() { + SetCurrentThreadName("FlushMemInfo"); + while (flushThreadRunning.load()) { flushThreadPending = false; FlushPendingMemInfo(); From c5191cad4c564632a6f5530073f97215dcf37bf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Mon, 29 Jan 2024 15:48:27 +0100 Subject: [PATCH 2/2] Disable 16-bit textures on PowerVR. Fixes #18780 --- Common/GPU/Vulkan/thin3d_vulkan.cpp | 3 +++ Common/GPU/thin3d.cpp | 1 + Common/GPU/thin3d.h | 1 + GPU/Vulkan/GPU_Vulkan.cpp | 22 ++++++++++++---------- android/build.gradle | 2 +- 5 files changed, 18 insertions(+), 11 deletions(-) diff --git a/Common/GPU/Vulkan/thin3d_vulkan.cpp b/Common/GPU/Vulkan/thin3d_vulkan.cpp index 756dc62b52..87b9aaa96a 100644 --- a/Common/GPU/Vulkan/thin3d_vulkan.cpp +++ b/Common/GPU/Vulkan/thin3d_vulkan.cpp @@ -1033,6 +1033,9 @@ VKContext::VKContext(VulkanContext *vulkan, bool useRenderThread) // Very rough heuristic. multisampleAllowed = false; } + } else if (caps_.vendor == GPUVendor::VENDOR_IMGTEC) { + // Not sure about driver versions, so let's just ban, impact is tiny. + bugs_.Infest(Bugs::PVR_BAD_16BIT_TEXFORMATS); } if (!vulkan->Extensions().KHR_depth_stencil_resolve) { diff --git a/Common/GPU/thin3d.cpp b/Common/GPU/thin3d.cpp index 85b910aeff..c5170bbe35 100644 --- a/Common/GPU/thin3d.cpp +++ b/Common/GPU/thin3d.cpp @@ -764,6 +764,7 @@ const char *Bugs::GetBugName(uint32_t bug) { case SUBPASS_FEEDBACK_BROKEN: return "SUBPASS_FEEDBACK_BROKEN"; case GEOMETRY_SHADERS_SLOW_OR_BROKEN: return "GEOMETRY_SHADERS_SLOW_OR_BROKEN"; case ADRENO_RESOURCE_DEADLOCK: return "ADRENO_RESOURCE_DEADLOCK"; + case PVR_BAD_16BIT_TEXFORMATS: return "PVR_BAD_16BIT_TEXFORMATS"; default: return "(N/A)"; } } diff --git a/Common/GPU/thin3d.h b/Common/GPU/thin3d.h index a0ab3db446..44e01fdef1 100644 --- a/Common/GPU/thin3d.h +++ b/Common/GPU/thin3d.h @@ -350,6 +350,7 @@ public: GEOMETRY_SHADERS_SLOW_OR_BROKEN = 11, ADRENO_RESOURCE_DEADLOCK = 12, UNIFORM_INDEXING_BROKEN = 13, // not a properly diagnosed issue, a workaround attempt: #17386 + PVR_BAD_16BIT_TEXFORMATS = 14, MAX_BUG, }; diff --git a/GPU/Vulkan/GPU_Vulkan.cpp b/GPU/Vulkan/GPU_Vulkan.cpp index 3442e118e6..09f914c059 100644 --- a/GPU/Vulkan/GPU_Vulkan.cpp +++ b/GPU/Vulkan/GPU_Vulkan.cpp @@ -255,16 +255,18 @@ u32 GPU_Vulkan::CheckGPUFeatures() const { } } - // These are VULKAN_4444_FORMAT and friends. - // Note that we are now using the correct set of formats - the only cases where some may be missing - // are non-conformant implementations like MoltenVK. - uint32_t fmt4444 = draw_->GetDataFormatSupport(Draw::DataFormat::B4G4R4A4_UNORM_PACK16); - uint32_t fmt1555 = draw_->GetDataFormatSupport(Draw::DataFormat::A1R5G5B5_UNORM_PACK16); - uint32_t fmt565 = draw_->GetDataFormatSupport(Draw::DataFormat::R5G6B5_UNORM_PACK16); - if ((fmt4444 & Draw::FMT_TEXTURE) && (fmt565 & Draw::FMT_TEXTURE) && (fmt1555 & Draw::FMT_TEXTURE)) { - features |= GPU_USE_16BIT_FORMATS; - } else { - INFO_LOG(G3D, "Deficient texture format support: 4444: %d 1555: %d 565: %d", fmt4444, fmt1555, fmt565); + if (!draw_->GetBugs().Has(Draw::Bugs::PVR_BAD_16BIT_TEXFORMATS)) { + // These are VULKAN_4444_FORMAT and friends. + // Note that we are now using the correct set of formats - the only cases where some may be missing + // are non-conformant implementations like MoltenVK. + uint32_t fmt4444 = draw_->GetDataFormatSupport(Draw::DataFormat::B4G4R4A4_UNORM_PACK16); + uint32_t fmt1555 = draw_->GetDataFormatSupport(Draw::DataFormat::A1R5G5B5_UNORM_PACK16); + uint32_t fmt565 = draw_->GetDataFormatSupport(Draw::DataFormat::R5G6B5_UNORM_PACK16); + if ((fmt4444 & Draw::FMT_TEXTURE) && (fmt565 & Draw::FMT_TEXTURE) && (fmt1555 & Draw::FMT_TEXTURE)) { + features |= GPU_USE_16BIT_FORMATS; + } else { + INFO_LOG(G3D, "Deficient texture format support: 4444: %d 1555: %d 565: %d", fmt4444, fmt1555, fmt565); + } } if (g_Config.bStereoRendering && draw_->GetDeviceCaps().multiViewSupported) { diff --git a/android/build.gradle b/android/build.gradle index 9f59074d40..e9f5840ff8 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -157,7 +157,7 @@ android { vr { applicationId 'org.ppsspp.ppssppvr' dimension "variant" - targetSdkVersion 29 + targetSdkVersion 29 // Do not upgrade this, we depend on not requiring scoped storage on Oculus. externalNativeBuild { cmake { // Available arguments listed at https://developer.android.com/ndk/guides/cmake.html