Hi,
I'm the developer of the cyberpunk camera tools used by many people. One of the features is to resize the game's viewport by setting the new resolution in memory, after which the engine will resize the window and viewport to the new resolution. This is called 'Hotsampling' and is often used by virtual photographers to take a screenshot at a higher resolution.
Resizing the viewport of the game that way when CET is used however leads to a specific crash in ffx_backend_dx12_x64.dll:

When CET isn't active, no crash occurs.
Looking at your code, it seems you're hooking the engine's resize function instead of the swapchain's ResizeBuffers (d3d12 swapchain VTable[13]).
|
if (MH_CreateHook(resizeInternal.GetAddr(), reinterpret_cast<void*>(&CRenderGlobal_Resize), reinterpret_cast<void**>(&m_realInternalResize)) != MH_OK || |
My question is: why not hook the swapchain resize buffers to get the callback, then do the cleanup? Could this be changed perhaps in the future so these crashes on AMD cards are avoided?
The resolution struct is interceptible using AOB: 8B 41 7C 39 41 18 75 19 8B 81 80 00 00 00 39 41 1C 75 0E, where rcx contains the structure pointer. offset 0x7C in that struct contains the screen width, offset 0x80 contains the height (in pixels). Changing any of the values there will resize the viewport by the engine and will then trigger the crash on AMD hardware.
Thanks!