mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-02-20 01:54:16 +01:00
[hud] Add option to show DXVK version
General idea based on PR #490. Closes #488.
This commit is contained in:
parent
2fce0a7685
commit
65ffa4122d
@ -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`.
|
||||
|
||||
|
@ -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);
|
||||
|
@ -12,6 +12,7 @@ namespace dxvk::hud {
|
||||
{ "submissions", HudElement::StatSubmissions },
|
||||
{ "pipelines", HudElement::StatPipelines },
|
||||
{ "memory", HudElement::StatMemory },
|
||||
{ "version", HudElement::DxvkVersion },
|
||||
}};
|
||||
|
||||
|
||||
|
@ -18,6 +18,7 @@ namespace dxvk::hud {
|
||||
StatSubmissions = 4,
|
||||
StatPipelines = 5,
|
||||
StatMemory = 6,
|
||||
DxvkVersion = 7,
|
||||
};
|
||||
|
||||
using HudElements = Flags<HudElement>;
|
||||
|
Loading…
x
Reference in New Issue
Block a user