diff --git a/Common/GPU/Vulkan/VulkanContext.cpp b/Common/GPU/Vulkan/VulkanContext.cpp index b100e83a96..05607469c8 100644 --- a/Common/GPU/Vulkan/VulkanContext.cpp +++ b/Common/GPU/Vulkan/VulkanContext.cpp @@ -1666,80 +1666,101 @@ void VulkanDeleteList::Take(VulkanDeleteList &del) { } void VulkanDeleteList::PerformDeletes(VulkanContext *vulkan, VmaAllocator allocator) { + int deleteCount = 0; + for (auto &callback : callbacks_) { callback.func(vulkan, callback.userdata); + deleteCount++; } callbacks_.clear(); VkDevice device = vulkan->GetDevice(); for (auto &cmdPool : cmdPools_) { vkDestroyCommandPool(device, cmdPool, nullptr); + deleteCount++; } cmdPools_.clear(); for (auto &descPool : descPools_) { vkDestroyDescriptorPool(device, descPool, nullptr); + deleteCount++; } descPools_.clear(); for (auto &module : modules_) { vkDestroyShaderModule(device, module, nullptr); + deleteCount++; } modules_.clear(); for (auto &buf : buffers_) { vkDestroyBuffer(device, buf, nullptr); + deleteCount++; } buffers_.clear(); for (auto &buf : buffersWithAllocs_) { vmaDestroyBuffer(allocator, buf.buffer, buf.alloc); + deleteCount++; } buffersWithAllocs_.clear(); for (auto &bufView : bufferViews_) { vkDestroyBufferView(device, bufView, nullptr); + deleteCount++; } bufferViews_.clear(); for (auto &imageWithAlloc : imagesWithAllocs_) { vmaDestroyImage(allocator, imageWithAlloc.image, imageWithAlloc.alloc); + deleteCount++; } imagesWithAllocs_.clear(); for (auto &imageView : imageViews_) { vkDestroyImageView(device, imageView, nullptr); + deleteCount++; } imageViews_.clear(); for (auto &mem : deviceMemory_) { vkFreeMemory(device, mem, nullptr); + deleteCount++; } deviceMemory_.clear(); for (auto &sampler : samplers_) { vkDestroySampler(device, sampler, nullptr); + deleteCount++; } samplers_.clear(); for (auto &pipeline : pipelines_) { vkDestroyPipeline(device, pipeline, nullptr); + deleteCount++; } pipelines_.clear(); for (auto &pcache : pipelineCaches_) { vkDestroyPipelineCache(device, pcache, nullptr); + deleteCount++; } pipelineCaches_.clear(); for (auto &renderPass : renderPasses_) { vkDestroyRenderPass(device, renderPass, nullptr); + deleteCount++; } renderPasses_.clear(); for (auto &framebuffer : framebuffers_) { vkDestroyFramebuffer(device, framebuffer, nullptr); + deleteCount++; } framebuffers_.clear(); for (auto &pipeLayout : pipelineLayouts_) { vkDestroyPipelineLayout(device, pipeLayout, nullptr); + deleteCount++; } pipelineLayouts_.clear(); for (auto &descSetLayout : descSetLayouts_) { vkDestroyDescriptorSetLayout(device, descSetLayout, nullptr); + deleteCount++; } descSetLayouts_.clear(); for (auto &queryPool : queryPools_) { vkDestroyQueryPool(device, queryPool, nullptr); + deleteCount++; } queryPools_.clear(); + deleteCount_ = deleteCount; } void VulkanContext::GetImageMemoryRequirements(VkImage image, VkMemoryRequirements *mem_reqs, bool *dedicatedAllocation) { diff --git a/Common/GPU/Vulkan/VulkanContext.h b/Common/GPU/Vulkan/VulkanContext.h index 4dea4ed380..0d0e93417f 100644 --- a/Common/GPU/Vulkan/VulkanContext.h +++ b/Common/GPU/Vulkan/VulkanContext.h @@ -138,6 +138,10 @@ public: void Take(VulkanDeleteList &del); void PerformDeletes(VulkanContext *vulkan, VmaAllocator allocator); + int GetLastDeleteCount() const { + return deleteCount_; + } + private: std::vector cmdPools_; std::vector descPools_; @@ -157,6 +161,7 @@ private: std::vector descSetLayouts_; std::vector queryPools_; std::vector callbacks_; + int deleteCount_ = 0; }; // VulkanContext manages the device and swapchain, and deferred deletion of objects. @@ -392,6 +397,10 @@ public: return availablePresentModes_; } + int GetLastDeleteCount() const { + return frame_[curFrame_].deleteList.GetLastDeleteCount(); + } + private: bool ChooseQueue(); diff --git a/Common/GPU/Vulkan/VulkanFrameData.cpp b/Common/GPU/Vulkan/VulkanFrameData.cpp index 4725bc0ed4..3f1ee51133 100644 --- a/Common/GPU/Vulkan/VulkanFrameData.cpp +++ b/Common/GPU/Vulkan/VulkanFrameData.cpp @@ -84,13 +84,16 @@ void FrameData::AcquireNextImage(VulkanContext *vulkan, FrameDataShared &shared) WARN_LOG(G3D, "VK_SUBOPTIMAL_KHR returned - ignoring"); break; case VK_ERROR_OUT_OF_DATE_KHR: - case VK_ERROR_SURFACE_LOST_KHR: case VK_TIMEOUT: case VK_NOT_READY: // We do not set hasAcquired here! WARN_LOG(G3D, "%s returned from AcquireNextImage - processing the frame, but not presenting", VulkanResultToString(res)); skipSwap = true; break; + case VK_ERROR_SURFACE_LOST_KHR: + ERROR_LOG(G3D, "%s returned from AcquireNextImage - ignoring, but this better be during shutdown", VulkanResultToString(res)); + skipSwap = true; + break; default: // Weird, shouldn't get any other values. Maybe lost device? _assert_msg_(false, "vkAcquireNextImageKHR failed! result=%s", VulkanResultToString(res)); diff --git a/Common/GPU/Vulkan/VulkanQueueRunner.cpp b/Common/GPU/Vulkan/VulkanQueueRunner.cpp index 023a588936..58dbe4ad5a 100644 --- a/Common/GPU/Vulkan/VulkanQueueRunner.cpp +++ b/Common/GPU/Vulkan/VulkanQueueRunner.cpp @@ -876,9 +876,6 @@ void VulkanQueueRunner::LogRenderPass(const VKRStep &pass, bool verbose) { case VKRRenderCommand::BIND_GRAPHICS_PIPELINE: INFO_LOG(G3D, " BindGraphicsPipeline(%x)", (int)(intptr_t)cmd.graphics_pipeline.pipeline); break; - case VKRRenderCommand::BIND_COMPUTE_PIPELINE: - INFO_LOG(G3D, " BindComputePipeline(%x)", (int)(intptr_t)cmd.compute_pipeline.pipeline); - break; case VKRRenderCommand::BLEND: INFO_LOG(G3D, " BlendColor(%08x)", cmd.blendColor.color); break; @@ -1259,20 +1256,6 @@ void VulkanQueueRunner::PerformRenderPass(const VKRStep &step, VkCommandBuffer c break; } - case VKRRenderCommand::BIND_COMPUTE_PIPELINE: - { - VKRComputePipeline *computePipeline = c.compute_pipeline.pipeline; - if (computePipeline != lastComputePipeline) { - VkPipeline pipeline = computePipeline->pipeline->BlockUntilReady(); - if (pipeline != VK_NULL_HANDLE) { - vkCmdBindPipeline(cmd, VK_PIPELINE_BIND_POINT_COMPUTE, pipeline); - pipelineLayout = c.pipeline.pipelineLayout->pipelineLayout; - lastComputePipeline = computePipeline; - } - } - break; - } - case VKRRenderCommand::VIEWPORT: if (fb != nullptr) { vkCmdSetViewport(cmd, 0, 1, &c.viewport.vp); diff --git a/Common/GPU/Vulkan/VulkanQueueRunner.h b/Common/GPU/Vulkan/VulkanQueueRunner.h index 2cbdd3277a..216cfd7d7f 100644 --- a/Common/GPU/Vulkan/VulkanQueueRunner.h +++ b/Common/GPU/Vulkan/VulkanQueueRunner.h @@ -31,7 +31,6 @@ enum { enum class VKRRenderCommand : uint8_t { REMOVED, BIND_GRAPHICS_PIPELINE, // async - BIND_COMPUTE_PIPELINE, // async STENCIL, BLEND, VIEWPORT, diff --git a/Common/GPU/Vulkan/VulkanRenderManager.cpp b/Common/GPU/Vulkan/VulkanRenderManager.cpp index e39b3d1bb5..9a4f4e1aa6 100644 --- a/Common/GPU/Vulkan/VulkanRenderManager.cpp +++ b/Common/GPU/Vulkan/VulkanRenderManager.cpp @@ -689,6 +689,8 @@ void VulkanRenderManager::BeginFrame(bool enableProfiling, bool enableLogProfile str << line; snprintf(line, sizeof(line), "Descriptors written: %d\n", frameData.profile.descriptorsWritten); str << line; + snprintf(line, sizeof(line), "Resource deletions: %d\n", vulkan_->GetLastDeleteCount()); + str << line; for (int i = 0; i < numQueries - 1; i++) { uint64_t diff = (queryResults[i + 1] - queryResults[i]) & timestampDiffMask; double milliseconds = (double)diff * timestampConversionFactor; diff --git a/Common/GPU/Vulkan/VulkanRenderManager.h b/Common/GPU/Vulkan/VulkanRenderManager.h index 9a3372d3e2..8f9c7120d9 100644 --- a/Common/GPU/Vulkan/VulkanRenderManager.h +++ b/Common/GPU/Vulkan/VulkanRenderManager.h @@ -322,16 +322,6 @@ public: return true; } - void BindPipeline(VKRComputePipeline *pipeline, PipelineFlags flags, VKRPipelineLayout *pipelineLayout) { - _dbg_assert_(curRenderStep_ && curRenderStep_->stepType == VKRStepType::RENDER); - _dbg_assert_(pipeline != nullptr); - VkRenderData &data = curRenderStep_->commands.push_uninitialized(); - data.cmd = VKRRenderCommand::BIND_COMPUTE_PIPELINE; - data.compute_pipeline.pipeline = pipeline; - data.compute_pipeline.pipelineLayout = pipelineLayout; - curPipelineFlags_ |= flags; - } - void SetViewport(const VkViewport &vp) { _dbg_assert_(curRenderStep_ && curRenderStep_->stepType == VKRStepType::RENDER); _dbg_assert_((int)vp.width >= 0); diff --git a/README.md b/README.md index 92a73befab..270c0970dc 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,15 @@ If you want to download regularly updated builds for Android, Windows x86 and x6 For game compatibility, see [community compatibility feedback](https://report.ppsspp.org/games). +What's new in 1.16.6 +==================== +- Fix performance issue with Vulkan descriptor set allocation ([#18332]) +- Smoother loading of replacement textures +- Fix the store on iOS ([#18323]) +- Fix problem with waves background ([#18310]) +- Some translation updates +- Other minor fixes + What's new in 1.16.5 ==================== - Additional crash and memory-leak fixes ([#18243], [#18244], [#18247]) @@ -449,4 +458,7 @@ Credit goes to: [#18261]: https://github.com/hrydgard/ppsspp/issues/18261 "Revert \"Merge pull request #18184 from hrydgard/expand-lines-mem-fix\"" [#18255]: https://github.com/hrydgard/ppsspp/issues/18255 "Fix issue uploading narrow textures in OpenGL." [#18250]: https://github.com/hrydgard/ppsspp/issues/18250 "Separate out accelerometer events from joystick axis events" -[#18249]: https://github.com/hrydgard/ppsspp/issues/18249 "arm64jit: Avoid fused multiplies in vcrsp.t" \ No newline at end of file +[#18249]: https://github.com/hrydgard/ppsspp/issues/18249 "arm64jit: Avoid fused multiplies in vcrsp.t" +[#18332]: https://github.com/hrydgard/ppsspp/issues/18332 "We somehow lost the usage_ counter increment in VulkanDescSetPool, fix that" +[#18323]: https://github.com/hrydgard/ppsspp/issues/18323 "Turn off HTTPS support for iOS." +[#18310]: https://github.com/hrydgard/ppsspp/issues/18310 "Fix waves background" \ No newline at end of file diff --git a/UWP/Package.appxmanifest b/UWP/Package.appxmanifest index 81157024d9..ec681ab8b2 100644 --- a/UWP/Package.appxmanifest +++ b/UWP/Package.appxmanifest @@ -1,6 +1,6 @@ - + PPSSPP - PSP emulator diff --git a/UWP/PackageGold.appxmanifest b/UWP/PackageGold.appxmanifest index 8d7bac4632..0396b3ee4e 100644 --- a/UWP/PackageGold.appxmanifest +++ b/UWP/PackageGold.appxmanifest @@ -1,6 +1,6 @@ - + PPSSPP Gold - PSP emulator diff --git a/android/jni/app-android.cpp b/android/jni/app-android.cpp index 58cc9a14a4..d6d1ea905f 100644 --- a/android/jni/app-android.cpp +++ b/android/jni/app-android.cpp @@ -1448,6 +1448,11 @@ static void VulkanEmuThread(ANativeWindow *wnd); extern "C" bool JNICALL Java_org_ppsspp_ppsspp_NativeActivity_runVulkanRenderLoop(JNIEnv * env, jobject obj, jobject _surf) { _assert_(!useCPUThread); + if (!graphicsContext) { + ERROR_LOG(G3D, "runVulkanRenderLoop: Tried to enter without a created graphics context."); + return false; + } + if (g_vulkanRenderLoopThread.joinable()) { ERROR_LOG(G3D, "runVulkanRenderLoop: Already running"); return false;