1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-03-15 16:29:16 +01:00

[hud] Add function to change API name dynamically

Needed for D3D8 due to implicit swapchain shenanigans.
This commit is contained in:
Philip Rebohle 2025-01-13 11:32:12 +01:00 committed by Philip Rebohle
parent 0eeedf9259
commit c1ed8cd1f3
2 changed files with 13 additions and 2 deletions

View File

@ -112,7 +112,7 @@ namespace dxvk::hud {
HudClientApiItem::HudClientApiItem(std::string api) HudClientApiItem::HudClientApiItem(std::string api)
: m_api(api) { : m_api(std::move(api)) {
} }
@ -122,12 +122,20 @@ namespace dxvk::hud {
} }
void HudClientApiItem::setApiName(std::string api) {
std::lock_guard lock(m_mutex);
m_api = std::move(api);
}
HudPos HudClientApiItem::render( HudPos HudClientApiItem::render(
const DxvkContextObjects& ctx, const DxvkContextObjects& ctx,
const HudPipelineKey& key, const HudPipelineKey& key,
const HudOptions& options, const HudOptions& options,
HudRenderer& renderer, HudRenderer& renderer,
HudPos position) { HudPos position) {
std::lock_guard lock(m_mutex);
position.y += 16; position.y += 16;
renderer.drawText(16, position, 0xffffffffu, m_api); renderer.drawText(16, position, 0xffffffffu, m_api);

View File

@ -163,6 +163,8 @@ namespace dxvk::hud {
~HudClientApiItem(); ~HudClientApiItem();
void setApiName(std::string api);
HudPos render( HudPos render(
const DxvkContextObjects& ctx, const DxvkContextObjects& ctx,
const HudPipelineKey& key, const HudPipelineKey& key,
@ -172,6 +174,7 @@ namespace dxvk::hud {
private: private:
sync::Spinlock m_mutex;
std::string m_api; std::string m_api;
}; };