mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-12-12 22:08:59 +01:00
[d3d9] Allow changing API name for d3d8
This commit is contained in:
parent
d6e7e3e780
commit
022bf1d134
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user