mirror of
https://github.com/jmarshall23/DoomRTX.git
synced 2026-08-17 19:23:51 +02:00
Updated com_showfps to show additional stats.
This commit is contained in:
@@ -1670,8 +1670,11 @@ struct GLState
|
||||
UINT nextSrvIndex = 1;
|
||||
|
||||
ComPtr<IDXGIFactory4> factory;
|
||||
ComPtr<IDXGIAdapter3> adapter;
|
||||
ComPtr<ID3D12Device> device;
|
||||
ComPtr<ID3D12CommandQueue> queue;
|
||||
std::string adapterName;
|
||||
UINT64 dedicatedVideoMemory = 0;
|
||||
|
||||
ComPtr<ID3D12DescriptorHeap> srvHeap;
|
||||
UINT srvStride = 0;
|
||||
@@ -8438,6 +8441,29 @@ static void QD3D12_CreateDevice()
|
||||
|
||||
QD3D12_CHECK(QD3D12_CreateDXGIFactory1ForStreamline(IID_PPV_ARGS(&g_gl.factory)));
|
||||
QD3D12_CHECK(QD3D12_D3D12CreateDeviceForStreamline(nullptr, D3D_FEATURE_LEVEL_11_0, IID_PPV_ARGS(&g_gl.device)));
|
||||
|
||||
g_gl.adapter.Reset();
|
||||
g_gl.adapterName.clear();
|
||||
g_gl.dedicatedVideoMemory = 0;
|
||||
if (g_gl.factory && g_gl.device)
|
||||
{
|
||||
ComPtr<IDXGIAdapter1> adapter1;
|
||||
if (SUCCEEDED(g_gl.factory->EnumAdapterByLuid(g_gl.device->GetAdapterLuid(), IID_PPV_ARGS(&adapter1))) && adapter1)
|
||||
{
|
||||
DXGI_ADAPTER_DESC1 desc{};
|
||||
if (SUCCEEDED(adapter1->GetDesc1(&desc)))
|
||||
{
|
||||
g_gl.dedicatedVideoMemory = desc.DedicatedVideoMemory;
|
||||
|
||||
char name[256] = {};
|
||||
const int chars = WideCharToMultiByte(CP_UTF8, 0, desc.Description, -1, name, sizeof(name), nullptr, nullptr);
|
||||
if (chars > 0)
|
||||
g_gl.adapterName = name;
|
||||
}
|
||||
adapter1.As(&g_gl.adapter);
|
||||
}
|
||||
}
|
||||
|
||||
QD3D12_StreamlineOnDeviceCreated();
|
||||
QD3D12_SelectGBufferSampleCount();
|
||||
|
||||
@@ -17274,6 +17300,34 @@ int QD3D12_GetActiveFrameGenerationMultiplier(void)
|
||||
return 1;
|
||||
}
|
||||
|
||||
const char* QD3D12_GetAdapterName(void)
|
||||
{
|
||||
return g_gl.adapterName.empty() ? nullptr : g_gl.adapterName.c_str();
|
||||
}
|
||||
|
||||
int QD3D12_GetVideoMemoryInfo(uint64_t* usageBytes, uint64_t* budgetBytes, uint64_t* dedicatedBytes)
|
||||
{
|
||||
if (usageBytes)
|
||||
*usageBytes = 0;
|
||||
if (budgetBytes)
|
||||
*budgetBytes = 0;
|
||||
if (dedicatedBytes)
|
||||
*dedicatedBytes = g_gl.dedicatedVideoMemory;
|
||||
|
||||
if (!g_gl.adapter)
|
||||
return 0;
|
||||
|
||||
DXGI_QUERY_VIDEO_MEMORY_INFO info{};
|
||||
if (FAILED(g_gl.adapter->QueryVideoMemoryInfo(0, DXGI_MEMORY_SEGMENT_GROUP_LOCAL, &info)))
|
||||
return 0;
|
||||
|
||||
if (usageBytes)
|
||||
*usageBytes = info.CurrentUsage;
|
||||
if (budgetBytes)
|
||||
*budgetBytes = info.Budget;
|
||||
return 1;
|
||||
}
|
||||
|
||||
void QD3D12_EnableDLAA(int enabled)
|
||||
{
|
||||
const QD3D12UpscalerBackend oldBackend = g_gl.upscalerBackend;
|
||||
|
||||
@@ -2333,6 +2333,8 @@ void QD3D12_SetToneMapBrightness(float brightness);
|
||||
void QD3D12_SetFrameGenerationMultiplier(int multiplier);
|
||||
int QD3D12_GetFrameGenerationMultiplier(void);
|
||||
int QD3D12_GetActiveFrameGenerationMultiplier(void);
|
||||
const char* QD3D12_GetAdapterName(void);
|
||||
int QD3D12_GetVideoMemoryInfo(uint64_t* usageBytes, uint64_t* budgetBytes, uint64_t* dedicatedBytes);
|
||||
void QD3D12_SetCurrentWindowDLSSAllowed(int allowed);
|
||||
|
||||
void QD3D12_EnableTAA(int enabled);
|
||||
|
||||
Reference in New Issue
Block a user