-
Notifications
You must be signed in to change notification settings - Fork 0
Enhanced migration #83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Fixes random crashes due to a dead wndproc ptr
With the speed of the current sig scanner caching the results is completely useless
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR performs a comprehensive migration from DirectX 11 to DirectX 12 rendering backend, alongside significant improvements to exception handling, concurrency primitives, and process identification. The changes modernize the codebase with better thread safety, resource management, and error recovery capabilities.
Key Changes:
- Complete migration from D3D11 to D3D12 rendering pipeline with new context management and descriptor heap allocation
- Advanced vectored exception handler with instruction-level recovery using Zydis disassembler
- Enhanced concurrency with improved spinlock implementation and modernized Signal class using std::binary_semaphore
Reviewed changes
Copilot reviewed 39 out of 41 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| vendor/imgui.cmake | Switched from D3D11 to D3D12 backend |
| vendor/discord-rpc.cmake | Pinned discord-rpc to specific commit, removed RapidJSON test flag |
| menu/src/ui/notification/manager.hpp | Added null check to ADD_NOTIFICATION macro |
| menu/src/render/thread.cpp | Added likely/unlikely attributes and optimized callback handling |
| menu/src/render/renderer.hpp | Removed D3D11 COM objects, added D3D12 context |
| menu/src/render/renderer.cpp | Complete rewrite for D3D12 initialization and frame rendering |
| menu/src/render/draw_util.cpp | Improved word wrapping with vector-based memory management |
| menu/src/render/draw_commands.hpp | Updated Image class for D3D12 descriptor handles |
| menu/src/render/draw.hpp | Made read_signal_ mutable |
| menu/src/render/d3d12/heap/descriptor_heap_allocator.hpp | New descriptor heap allocator for D3D12 resources |
| menu/src/render/d3d12/heap/descriptor_heap_allocator.cpp | Implementation of thread-safe descriptor allocation |
| menu/src/render/d3d12/context.hpp | New D3D12 context class managing device, command objects, and frames |
| menu/src/render/d3d12/context.cpp | Complete D3D12 context implementation with synchronization |
| menu/src/render/animate.hpp | Added IsComplete/Reset methods and improved const-correctness |
| menu/src/memory/signature/pattern.cpp | Improved C-style cast to static_cast |
| menu/src/memory/signature/cached_batch.hpp | Removed cached batch scanning feature |
| menu/src/memory/signature/cached_batch.cpp | Removed cached batch scanning implementation |
| menu/src/memory/pointers.hpp | Updated to use IDXGISwapChain3 and added command queue pointer |
| menu/src/memory/pointers.cpp | Simplified pattern scanning, removed resolution/version patterns |
| menu/src/main.cpp | Reordered initialization and improved const-correctness |
| menu/src/logging/plh_logger.hpp | Changed PLH INFO logs to DEBUG level |
| menu/src/hooking/wndproc.hpp | Refactored to use DetourHook instead of SetWindowLongPtr |
| menu/src/hooking/wndproc.cpp | Complete rewrite using PolyHook detours |
| menu/src/hooking/hooking.hpp | Added destructor |
| menu/src/hooking/hooking.cpp | Added destructor implementation and improved const-correctness |
| menu/src/hooking/helpers/vmt.hpp | Improved const-correctness |
| menu/src/hooking/helpers/detour.hpp | Changed void* to auto for og variable |
| menu/src/dllmain.cpp | Updated to use IsGameProcess instead of IsTargetProcess |
| menu/src/discord/rich_presence.hpp | Added last_tick_time_ member |
| menu/src/discord/rich_presence.cpp | Added tick throttling and ready handler |
| menu/CMakeLists.txt | Removed cached_batch files, added D3D12 context files |
| common/src/win32/signal.hpp | Modernized from Windows events to std::binary_semaphore |
| common/src/win32/misc.hpp | Renamed IsTargetProcess to IsGameProcess |
| common/src/win32/misc.cpp | Added support for multiple process names with static optimization |
| common/src/win32/memory.hpp | Added IsAddressInCurrentModule function |
| common/src/win32/memory.cpp | Added IsAddressInCurrentModule implementation and improved const-correctness |
| common/src/logging/exception/vectored_handler.cpp | Added instruction-level exception recovery with Zydis |
| common/src/logging/exception/exception_report.cpp | Moved stack dump earlier in report |
| common/src/globals.hpp | Updated target window class and added Enhanced process names |
| common/src/concurrency/spinlock.hpp | Made lock_count_ atomic |
| common/src/concurrency/spinlock.cpp | Added exponential backoff and improved memory ordering |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|



This pull request introduces several improvements and refactorings across the codebase, focusing on enhanced exception recovery, thread safety, modernization of synchronization primitives, and better process/module handling. Major changes include the addition of a wide-to-ANSI string conversion utility, a robust vectored exception handler with recovery logic, significant concurrency and synchronization improvements, and updates to process/module identification logic.
Exception Handling and Recovery:
common/src/logging/exception/vectored_handler.cpp,common/src/win32/memory.cpp,common/src/win32/memory.hpp) [1] [2] [3] [4]String Conversion and Logging:
CW2Autility class for converting wide strings to ANSI, replacing the previous ATL dependency. Updated logging formatter to use this new utility for thread descriptions. (common/src/conversion/cw2a.hpp,common/src/conversion/cw2a.cpp,common/CMakeLists.txt,common/src/logging/formatter/thread_id.hpp) [1] [2] [3] [4] [5]Concurrency and Synchronization:
SpinlockandRecursiveSpinlockfor better thread safety and performance, including atomic lock count and exponential backoff. (common/src/concurrency/spinlock.cpp,common/src/concurrency/spinlock.hpp) [1] [2] [3]Signalsynchronization primitive by replacing Windows events withstd::binary_semaphore, simplifying the implementation and improving portability. (common/src/win32/signal.hpp)Process and Module Identification:
common/src/globals.hpp,common/src/win32/misc.cpp,common/src/win32/misc.hpp) [1] [2] [3]reinterpret_castfor pointer arithmetic and making function parametersconstwhere appropriate. (common/src/win32/memory.cpp) [1] [2] [3] [4]Minor Improvements and Cleanups:
common/src/logging/exception/exception_report.cpp) [1] [2] [3]These changes collectively improve reliability, maintainability, and performance of the codebase, especially in exception handling and thread synchronization.