Win32 d3d_shared

pull/337/head^2
FlightlessMango 4 years ago
parent cbd87585b4
commit 2ebb381166

@ -34,6 +34,7 @@ vklayer_files = files(
'font_unispace.c',
'logging.cpp',
'config.cpp',
'gpu.cpp',
)
opengl_files = []
if ['windows', 'mingw'].contains(host_machine.system())
@ -43,20 +44,18 @@ if ['windows', 'mingw'].contains(host_machine.system())
'win/main.cpp',
'win/kiero.cpp',
'win/d3d12_hook.cpp',
'win/d3d_shared.cpp'
'win/d3d_shared.cpp',
)
endif
if is_unixy
vklayer_files += files(
'vulkan.cpp',
'overlay_params.cpp',
'blacklist.cpp',
'cpu.cpp',
'file_utils.cpp',
'memory.cpp',
'iostats.cpp',
'gpu.cpp',
'notify.cpp',
'elfhacks.cpp',
'real_dlsym.cpp',

@ -74,7 +74,6 @@ bool open = false;
string gpuString,wineVersion,wineProcess;
float offset_x, offset_y, hudSpacing;
int hudFirstRow, hudSecondRow;
struct fps_limit fps_limit_stats {};
VkPhysicalDeviceDriverProperties driverProps = {};
int32_t deviceID;

@ -1,18 +1,22 @@
#include "kiero.h"
#include "d3d12_hook.h"
#include <cstdio>
#include <cassert>
#include "kiero.h"
#include "d3d12_hook.h"
#include "d3d_shared.h"
#include "../overlay.h"
typedef long(__fastcall* PresentD3D12) (IDXGISwapChain* pSwapChain, UINT SyncInterval, UINT Flags);
PresentD3D12 oPresentD3D12;
long __fastcall hkPresent12(IDXGISwapChain3* pSwapChain, UINT SyncInterval, UINT Flags){
printf("d3d12 present\n");
update_hud_info(sw_stats, params, vendorID);
return oPresentD3D12(pSwapChain, SyncInterval, Flags);
}
void impl::d3d12::init()
{
printf("init d3d12\n");
auto ret = kiero::bind(140, (void**)&oPresentD3D12, reinterpret_cast<void*>(hkPresent12));
assert(ret == kiero::Status::Success);
init_d3d_shared();
}

@ -0,0 +1,15 @@
#include "d3d_shared.h"
bool cfg_inited = false;
ImVec2 window_size;
overlay_params params {};
struct swapchain_stats sw_stats {};
uint32_t vendorID;
void init_d3d_shared(){
if (cfg_inited)
return;
parse_overlay_config(&params, getenv("MANGOHUD_CONFIG"));
cfg_inited = true;
// init_cpu_stats(params);
}

@ -0,0 +1,9 @@
#include "../overlay.h"
extern bool cfg_inited;
extern ImVec2 window_size;
extern struct overlay_params params;
extern struct swapchain_stats sw_stats;
extern uint32_t vendorID;
extern void init_d3d_shared(void);
Loading…
Cancel
Save