Skip to content

Commit 8b6d605

Browse files
committed
Switch to RED4ext::GpuApi where applicable
1 parent 7a472f8 commit 8b6d605

File tree

7 files changed

+7
-41
lines changed

7 files changed

+7
-41
lines changed

Diff for: src/d3d12/D3D12_Hooks.cpp

+3-5
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
#include "D3D12.h"
66
#include "reverse/Addresses.h"
7-
#include "reverse/RenderContext.h"
87

98
#include <VersionHelpers.h>
109

@@ -23,8 +22,6 @@ void* D3D12::CRenderNode_Present_InternalPresent(int32_t* apDeviceIndex, uint8_t
2322
{
2423
auto& d3d12 = CET::Get().GetD3D12();
2524

26-
const auto* pContext = RenderContext::GetInstance();
27-
auto* pSwapChain = pContext->devices[*apDeviceIndex - 1].pSwapChain;
2825
if (d3d12.m_initialized)
2926
d3d12.Update();
3027
else
@@ -34,8 +31,9 @@ void* D3D12::CRenderNode_Present_InternalPresent(int32_t* apDeviceIndex, uint8_t
3431
// DX12 does not work on Windows 8 and 8.1 so we should be safe with this check
3532
if (IsWindows8OrGreater())
3633
{
37-
d3d12.m_pCommandQueue = pContext->pDirectQueue;
38-
d3d12.m_pdxgiSwapChain = pSwapChain;
34+
const auto& deviceData = RED4ext::GpuApi::GetDeviceData();
35+
d3d12.m_pCommandQueue = deviceData.directCommandQueue;
36+
d3d12.m_pdxgiSwapChain = deviceData.swapChains.GetData(*apDeviceIndex).swapChain;
3937
d3d12.Initialize();
4038
}
4139
else

Diff for: src/reverse/Addresses.h

-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ constexpr uint32_t CPhotoMode_SetRecordID = 4241565651UL; // <UNKNOWN_SYMBOL>
2828
#pragma endregion
2929

3030
#pragma region CRenderGlobal
31-
constexpr uint32_t CRenderGlobal_InstanceOffset = 1239944840UL; // <UNKNOWN_SYMBOL>
3231
constexpr uint32_t CRenderGlobal_Resize = 239671909UL; // GpuApi::ResizeBackbuffer
3332
constexpr uint32_t CRenderGlobal_Shutdown = 3192982283UL; // <UNKNOWN_SYMBOL>
3433
#pragma endregion

Diff for: src/reverse/RenderContext.cpp

-10
This file was deleted.

Diff for: src/reverse/RenderContext.h

-24
This file was deleted.

Diff for: src/stdafx.h

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include <RED4ext/DynArray.hpp>
1717
#include "RED4ext/GameApplication.hpp"
1818
#include <RED4ext/GameEngine.hpp>
19+
#include <RED4ext/GpuApi/DeviceData.hpp>
1920
#include <RED4ext/Hashing/CRC.hpp>
2021
#include <RED4ext/ISerializable.hpp>
2122
#include <RED4ext/Relocation.hpp>

Diff for: xmake.lua

+2
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ target("RED4ext.SDK")
6161
set_group("vendor")
6262
add_headerfiles("vendor/RED4ext.SDK/include/**.hpp")
6363
add_includedirs("vendor/RED4ext.SDK/include/", { public = true })
64+
add_headerfiles("vendor/RED4ext.SDK/vendor/D3D12MemAlloc/**.h")
65+
add_includedirs("vendor/RED4ext.SDK/vendor/D3D12MemAlloc/", { public = true })
6466
on_install(function() end)
6567

6668
target("cyber_engine_tweaks")

0 commit comments

Comments
 (0)