开发者

Overlay on DirectX11 game

I'm working on a project to show an overlay on any DirectX11 games. Now the overaly can show in some DX11 games but cannot in some others.

I hooked the 开发者_如何学PythonDX11 API IDXGISwapChain::Present() using the MS Detour. In the function Present(), I setup each pipeline, call the DrawIndex and ResourceCopy update my overlay texture to GPU's memory, then call the original Present to bring the back buffer to front buffer. It works fine in some games like Unigene and DIRT2 but it doesn't work on some others like LostPlanet2 and DragonAge2.

Doing some logging with hooking all DX11 functions, I found an interesting things - those not working games call ResourceCopy and ResourceCopyRegion before calling Present.

Like I said previously, I also called the ResourceCopy in my Present(). Is it the reason why it doesn't work? How can I workarround it?

Thanks, Marshall


I am also developing a similar D3D11 proxy hook. However, I begin from the entrypoints D3D11CreateDevice and D3D11CreateDeviceAndSwapChain. Then use replacement classes as hooks to my own. I found that some cases Detours cannot actually perform the detour properly: Error detouring EntryPoint(): 6 I worked around this by actually modifying the Detours 3.0 source code to trampoline the function correctly.

I am working with 64 bit Windows 7 but compiled for x86 Detours 3.0. I can try out those binaries to work. It's quite hard to explain where ResourceCopy can influence the call path other than rendering style used by the programmer. If you like, you can send me your project code and I might be able to help.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜