* renderer/vulkan: Drain VK wait thread queue in sceGxmFinish
renderer::finish() only waited for the renderer command thread (via Nop),
but the VK wait thread that writes notification values after GPU fences
complete runs asynchronously. This caused a race where sceGxmFinish
returned before all notifications were written, allowing late writes to
overwrite values the game expected to be final (e.g. display callback
resets to 0), resulting in deadlocks during scene transitions.
* renderer/vulkan: Address review comments for VK wait thread drain
- Push a dummy CallbackRequest before wait_empty to ensure the last
request on the queue has been fully processed, not just dequeued
- Use static_cast instead of reinterpret_cast
While investigating #2733, I noticed that Vita3K would render an
_ancient_ frame from a previous scene transition (with a red hue)
whenever a new scene transition occurred.
This happens because `surface_cache` includes a stale texture from the
previous transition. By adding a `dirty` flag to the cache entries by
trapping writes to texture memory we can skip the `surface_cache` for
stale textures and pass through to `texture_cache` instead.
Also, set `can_mprotect_mapped_memory` if using double buffering.
Fixes#2733.
When closing Vita3k via a window manager while a game is running, there
was a shutdown deadlock instead of clean exit.
Two fixed issues:
- CPU: `sceGxmNotificationWait` could block indefinitely; make it aware
of abort and notify on quit
- GPU (Vulkan): `gpu_request_wait_thread` could block indefinitely;
abort `request_queue` and join the thread in `preclose_action`.
Remove implementation from .h file and disable permanent storage of yaml node.
Also simplify .h file and remove as much includes as possible for faster compilation
- Replace `std::stringstream::operator<<` with faster `fmt::format_to` and `std::string::operator+=`.
- Replace `std::stringstream::operator>>` with faster `std::strtoul`.
- Use `std::move` when return `std::stringstream::str`.
- Distinguish between output-only and input-only streams.
Add the "Fullscreen HD res pixel perfect" checkbox in the GUI section to set 1080p and 4K resolutions to a perfect integer pixel ratio by cropping 2 pixels in the top and the bottom in fullscreen mode.
Fix bugs
* gui/disassembly_dialog: fix bug. Can't enter addresses >= 0x80000000
* utils/vc_runtime_checker: fix almost impossible AV in vc_runtime_checker
* util/net_utils: fix warning and error in parseHeaders function
* patch: fix almost impossible bug, also drop unused var
* modules/SceAvPlayer: fix error (wrong mutex)
* kernel: more correct value of export variable __sce_libcparam (NID:0xDF084DFA)
* interface.cpp/get_contents_path (Looks like mistype in duplicate search)
Needs recheck of refactoring. I found something strange, but I'm not sure if it's intended or not.
* renderer::vulkan/VKContext::VKContext (Looks like mistype in variable name)
* spirv_recompiler/create_fragment_inputs (Variable anonimous is always false here. It's not static and reinit every loop iteration)
* renderer/transfer: fix strange (and maybe never run) code if pixel format is unknown
* renderer/vulkan/replacement: fix some type to type converson
Refactoring and enhancements
* codec/atrac9: better error logs
* util/fs_utils: Function read_data which read file to vector. Also use it if possible
* util/log: custom formatter for Ptr<> type (it simplifies logging)
* util/tracy: set tracy_module_id variable static
* util/warning.h : header to cross-platform disable warnings
* renderer/transfer: fix strange (and maybe never run) code if pixel format is unknown
* nids: typo fix
* modules/module_parent: remove link to nids.inc from header
* modules/module_parent: move macro to other such macros in bridge.h
* kernel: refactoring use get_thread instead of lock_and_find
* mem/ptr: set type Ptr<T> trivial (trivially copiable, movable and so on)
Fix warnings:
* some retype in BitmapAllocator (mem-tests are OK)
* typecasts
* remove unused variables and fields
* push_back->emplace_back
* rename duplicate variables (usually in nested loops)
* drop excessive brackets
* remove some unused includes
* set 'static' for functions if possible
* gui:home_screen/draw_home_screen: same values around ? operator.
* convert declare SCE_*_ERROR_* to enums
* bracket initialisation instead of memset
* other compiler warnings
* external: Update VulkanMemoryAllocator-Hpp to version v3.2.1
* external: Update capstone to version 5.0.6
* external: Update cubeb
* external: Update fmt to version 11.1.4
* external: Update googletest to version v1.16.0
* external: Update imgui to version v1.91.3
* external: Update imgui_club
* external: Update libfat16
* external: Update nativefiledialog-extended to version v1.2.1
* external: Update pugixml to version v1.15
* external: Update sdl to version 2.30.11
* external: Update spdlog to version v1.15.2
* external: Update stb
* external: Update vita-toolchain
* external: Update xxHash to version v0.8.3
* vita3k: Use C++17 nested namespace definition
* vita3k: Remove redundant call to c_str()
* vita3k: Prefer C++ header
* vita3k: Use structured bindings
* shader: Add explicit fallthrough
* vita3k: Cleanup headers and dependencies
* util: Add WIN32_LEAN_AND_MEAN before <Windows.h>
* modules: Remove redundant 'const' specifier on a constexpr variable
* modules: Remove redundant return statement at the end of a function with a void return type
* clang-format: Use C++20 standard
* vita3k: Insert new line at EOF
* host: rename filesystem.hpp to filesystem.h
* external: download MoltenVK when configuring build system
* external: add option to build OpenSSL on macOS
* external: build custom boost with specific arch on macOS
* cmake: unify mixed and wrong indentations with tabs
* vita3K/ci: set macOS minimun version with 11.0