mirror of
https://github.com/optiscaler/OptiScaler.git
synced 2026-08-26 16:17:01 +00:00
Barebones antilag 2 support for dx12
This commit is contained in:
@@ -307,10 +307,30 @@ namespace nvd {
|
||||
}
|
||||
|
||||
NvAPI_Status __cdecl NvAPI_D3D_SetLatencyMarker(IUnknown* pDev, NV_LATENCY_MARKER_PARAMS* pSetLatencyMarkerParams) {
|
||||
if (!pDev)
|
||||
return Error();
|
||||
if (!al2_context.m_pAntiLagAPI) {
|
||||
ID3D12Device* device = nullptr;
|
||||
HRESULT hr = pDev->QueryInterface(__uuidof(ID3D12Device), reinterpret_cast<void**>(&device));
|
||||
auto res = AMD::AntiLag2DX12::Initialize(&al2_context, device);
|
||||
log(std::format("AL2 Init: {}", S_OK == res));
|
||||
}
|
||||
if (pSetLatencyMarkerParams->markerType == SIMULATION_START) {
|
||||
AMD::AntiLag2DX12::Update(&al2_context, true, 0);
|
||||
}
|
||||
return Ok();
|
||||
}
|
||||
|
||||
NvAPI_Status __cdecl NvAPI_D3D_Sleep(IUnknown* pDevice) {
|
||||
if (!pDevice)
|
||||
return Error();
|
||||
if (!al2_context.m_pAntiLagAPI) {
|
||||
ID3D12Device* device = nullptr;
|
||||
HRESULT hr = pDevice->QueryInterface(__uuidof(ID3D12Device), reinterpret_cast<void**>(&device));
|
||||
auto res = AMD::AntiLag2DX12::Initialize(&al2_context, device);
|
||||
log(std::format("AL2 Init: {}", S_OK == res));
|
||||
}
|
||||
AMD::AntiLag2DX12::Update(&al2_context, true, 0);
|
||||
return Ok();
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#endif
|
||||
#include <vector>
|
||||
|
||||
#include "../include/ffx_antilag2_dx12.h"
|
||||
#include "util.h"
|
||||
#include "spoofInfo.h"
|
||||
#include "log.h"
|
||||
@@ -20,13 +21,14 @@ namespace nvd {
|
||||
static auto drsSession = reinterpret_cast<NvDRSSessionHandle>(&drs);
|
||||
static auto drsProfile = reinterpret_cast<NvDRSProfileHandle>(&drs);
|
||||
|
||||
|
||||
static LUID luid;
|
||||
static UINT deviceId;
|
||||
static UINT vendorId;
|
||||
static UINT subSysId;
|
||||
static UINT revisionId;
|
||||
|
||||
static AMD::AntiLag2DX12::Context al2_context = {};
|
||||
|
||||
NvAPI_Status __cdecl NvAPI_Initialize();
|
||||
NvAPI_Status __cdecl NvAPI_GetInterfaceVersionString(NvAPI_ShortString desc);
|
||||
NvAPI_Status __cdecl NvAPI_EnumPhysicalGPUs(NvPhysicalGpuHandle handles[NVAPI_MAX_PHYSICAL_GPUS], NvU32* count);
|
||||
|
||||
Reference in New Issue
Block a user