-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create a builder-like data structure that has to have a IDXGISwapChain set first, and a ID3D12CommandQueue set later, provided it is associated with the previously-set swap chain. The heuristic used is to check the first 512 pointers in the memory pointed to by the swap chain, dereference each of them, and see if any of them matches the command queue that gets passed in. In practice, the command queue is among the first few pointers. A bit of extra care is given in checking for memory readability with VirtualQuery before dereferencing. There is some overhead but it is probably negligible, and only happens the first time the methods are hooked, so it's way less than a frame in total. Some concern might be raised by the fact that now we need to lock a mutex twice per frame, but practically that will happen almost always on the same thread and parking_lot has good performance for that case. Besides, we already do that successfully with the Pipeline.
- Loading branch information
Showing
1 changed file
with
111 additions
and
38 deletions.
There are no files selected for viewing
This file contains 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