-
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.
Choose command queue associated to swap chain in DirectX 12 hook (#209)
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. --------- Co-authored-by: Rico <[email protected]>
- Loading branch information
1 parent
216c680
commit 08246f5
Showing
5 changed files
with
219 additions
and
28 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[alias] | ||
c = "xwin clippy --target x86_64-pc-windows-msvc --all" | ||
t = "xwin test --target x86_64-pc-windows-msvc" |
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
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
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
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