[hud] Add option to show DXVK version

General idea based on PR #490. Closes #488.
This commit is contained in:
Philip Rebohle 2018-07-11 17:40:07 +02:00
parent 2fce0a7685
commit 65ffa4122d
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
4 changed files with 14 additions and 2 deletions

View File

@ -74,6 +74,7 @@ The `DXVK_HUD` environment variable controls a HUD which can display the framera
- `drawcalls`: Shows the number of draw calls and render passes per frame.
- `pipelines`: Shows the total number of graphics and compute pipelines.
- `memory`: Shows the amount of device memory allocated and used.
- `version`: Shows DXVK version.
Additionally, `DXVK_HUD=1` has the same effect as `DXVK_HUD=devinfo,fps`.

View File

@ -1,6 +1,7 @@
#include "dxvk_hud.h"
#include <cstring>
#include <version.h>
#include "dxvk_hud.h"
namespace dxvk::hud {
@ -83,6 +84,14 @@ namespace dxvk::hud {
void Hud::renderHudElements(const Rc<DxvkContext>& ctx) {
HudPos position = { 8.0f, 24.0f };
if (m_config.elements.test(HudElement::DxvkVersion)) {
m_renderer.drawText(ctx, 16.0f,
{ position.x, position.y },
{ 1.0f, 1.0f, 1.0f, 1.0f },
"DXVK " DXVK_VERSION);
position.y += 24.0f;
}
if (m_config.elements.test(HudElement::DeviceInfo)) {
position = m_hudDeviceInfo.render(
ctx, m_renderer, position);

View File

@ -12,6 +12,7 @@ namespace dxvk::hud {
{ "submissions", HudElement::StatSubmissions },
{ "pipelines", HudElement::StatPipelines },
{ "memory", HudElement::StatMemory },
{ "version", HudElement::DxvkVersion },
}};

View File

@ -18,6 +18,7 @@ namespace dxvk::hud {
StatSubmissions = 4,
StatPipelines = 5,
StatMemory = 6,
DxvkVersion = 7,
};
using HudElements = Flags<HudElement>;