Merged
Conversation
Fixes random crashes due to a dead wndproc ptr
With the speed of the current sig scanner caching the results is completely useless
Contributor
There was a problem hiding this comment.
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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



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.