diff --git a/src/d3d9/d3d9_bridge.cpp b/src/d3d9/d3d9_bridge.cpp index d5248e5308c..88448ba9a70 100644 --- a/src/d3d9/d3d9_bridge.cpp +++ b/src/d3d9/d3d9_bridge.cpp @@ -28,6 +28,10 @@ namespace dxvk { return m_device->QueryInterface(riid, ppvObject); } + void DxvkD3D8Bridge::SetAPIName(const char* name) { + m_device->m_implicitSwapchain->SetApiName(name); + } + HRESULT DxvkD3D8Bridge::UpdateTextureFromBuffer( IDirect3DSurface9* pDestSurface, IDirect3DSurface9* pSrcSurface, diff --git a/src/d3d9/d3d9_bridge.h b/src/d3d9/d3d9_bridge.h index 99c53031223..f1c121043e8 100644 --- a/src/d3d9/d3d9_bridge.h +++ b/src/d3d9/d3d9_bridge.h @@ -23,6 +23,13 @@ IDxvkD3D8Bridge : public IUnknown { using IDirect3DSurface9 = d3d9::IDirect3DSurface9; #endif + /** + * \brief Changes the API name displayed on the HUD + * + * \param [in] name The new API name + */ + virtual void SetAPIName(const char* name) = 0; + /** * \brief Updates a D3D9 surface from a D3D9 buffer * @@ -45,6 +52,7 @@ MIDL_INTERFACE("D3D9D3D8-A407-773E-18E9-CAFEBEEF3000") IDxvkD3D8InterfaceBridge : public IUnknown { /** * \brief Retrieves the DXVK configuration + * * \returns The DXVK Config object */ virtual const dxvk::Config* GetConfig() const = 0; @@ -74,6 +82,8 @@ namespace dxvk { REFIID riid, void** ppvObject); + void SetAPIName(const char* name); + HRESULT UpdateTextureFromBuffer( IDirect3DSurface9* pDestSurface, IDirect3DSurface9* pSrcSurface, diff --git a/src/d3d9/d3d9_swapchain.cpp b/src/d3d9/d3d9_swapchain.cpp index 90fb35b0036..3807af03097 100644 --- a/src/d3d9/d3d9_swapchain.cpp +++ b/src/d3d9/d3d9_swapchain.cpp @@ -1066,9 +1066,13 @@ namespace dxvk { void D3D9SwapChainEx::SyncFrameLatency() { // Wait for the sync event so that we respect the maximum frame latency m_frameLatencySignal->wait(m_frameId - GetActualFrameLatency()); + } + + void D3D9SwapChainEx::SetApiName(const char* name) { + m_apiName = name; + CreateHud(); } - uint32_t D3D9SwapChainEx::GetActualFrameLatency() { uint32_t maxFrameLatency = m_parent->GetFrameLatency(); @@ -1298,7 +1302,11 @@ namespace dxvk { std::string D3D9SwapChainEx::GetApiName() { - return this->GetParent()->IsExtended() ? "D3D9Ex" : "D3D9"; + if (m_apiName == nullptr) { + return this->GetParent()->IsExtended() ? "D3D9Ex" : "D3D9"; + } else { + return m_apiName; + } } D3D9VkExtSwapchain::D3D9VkExtSwapchain(D3D9SwapChainEx *pSwapChain) diff --git a/src/d3d9/d3d9_swapchain.h b/src/d3d9/d3d9_swapchain.h index 5d925227c21..662e4664dba 100644 --- a/src/d3d9/d3d9_swapchain.h +++ b/src/d3d9/d3d9_swapchain.h @@ -122,6 +122,8 @@ namespace dxvk { void DestroyBackBuffers(); + void SetApiName(const char* name); + private: enum BindingIds : uint32_t { @@ -167,6 +169,8 @@ namespace dxvk { double m_displayRefreshRate = 0.0; + const char* m_apiName = nullptr; + bool m_warnedAboutGDIFallback = false; VkColorSpaceKHR m_colorspace = VK_COLOR_SPACE_SRGB_NONLINEAR_KHR;