mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-02-08 01:54:15 +01:00
[d3d8] Set D3D8 compatibility at D3D9 interface level
This commit is contained in:
parent
11d5f9ee36
commit
35352b9c52
@ -52,10 +52,6 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_bridge->SetAPIName("D3D8");
|
m_bridge->SetAPIName("D3D8");
|
||||||
m_bridge->SetD3D8CompatibilityMode(true);
|
|
||||||
// The default value of D3DRS_POINTSIZE_MIN in D3D8 is 0.0f,
|
|
||||||
// whereas it's initialized to 1.0f in D3D9 by default
|
|
||||||
GetD3D9()->SetRenderState(d3d9::D3DRS_POINTSIZE_MIN, bit::cast<DWORD>(0.0f));
|
|
||||||
|
|
||||||
ResetState();
|
ResetState();
|
||||||
RecreateBackBuffersAndAutoDepthStencil();
|
RecreateBackBuffersAndAutoDepthStencil();
|
||||||
|
@ -15,6 +15,8 @@ namespace dxvk
|
|||||||
throw DxvkError("D3D8Device: ERROR! Failed to get D3D9 Bridge. d3d9.dll might not be DXVK!");
|
throw DxvkError("D3D8Device: ERROR! Failed to get D3D9 Bridge. d3d9.dll might not be DXVK!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_bridge->SetD3D8CompatibilityMode(true);
|
||||||
|
|
||||||
m_d3d8Options = D3D8Options(*m_bridge->GetConfig());
|
m_d3d8Options = D3D8Options(*m_bridge->GetConfig());
|
||||||
|
|
||||||
m_adapterCount = m_d3d9->GetAdapterCount();
|
m_adapterCount = m_d3d9->GetAdapterCount();
|
||||||
|
@ -32,10 +32,6 @@ namespace dxvk {
|
|||||||
m_device->m_implicitSwapchain->SetApiName(name);
|
m_device->m_implicitSwapchain->SetApiName(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DxvkD3D8Bridge::SetD3D8CompatibilityMode(const bool compatMode) {
|
|
||||||
m_device->SetD3D8CompatibilityMode(compatMode);
|
|
||||||
}
|
|
||||||
|
|
||||||
HRESULT DxvkD3D8Bridge::UpdateTextureFromBuffer(
|
HRESULT DxvkD3D8Bridge::UpdateTextureFromBuffer(
|
||||||
IDirect3DSurface9* pDestSurface,
|
IDirect3DSurface9* pDestSurface,
|
||||||
IDirect3DSurface9* pSrcSurface,
|
IDirect3DSurface9* pSrcSurface,
|
||||||
@ -105,6 +101,10 @@ namespace dxvk {
|
|||||||
return m_interface->QueryInterface(riid, ppvObject);
|
return m_interface->QueryInterface(riid, ppvObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DxvkD3D8InterfaceBridge::SetD3D8CompatibilityMode(const bool compatMode) {
|
||||||
|
m_interface->SetD3D8CompatibilityMode(compatMode);
|
||||||
|
}
|
||||||
|
|
||||||
const Config* DxvkD3D8InterfaceBridge::GetConfig() const {
|
const Config* DxvkD3D8InterfaceBridge::GetConfig() const {
|
||||||
return &m_interface->GetInstance()->config();
|
return &m_interface->GetInstance()->config();
|
||||||
}
|
}
|
||||||
|
@ -28,13 +28,6 @@ IDxvkD3D8Bridge : public IUnknown {
|
|||||||
*/
|
*/
|
||||||
virtual void SetAPIName(const char* name) = 0;
|
virtual void SetAPIName(const char* name) = 0;
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Enables or disables D3D9-specific device features and validations
|
|
||||||
*
|
|
||||||
* \param [in] compatMode Compatibility state
|
|
||||||
*/
|
|
||||||
virtual void SetD3D8CompatibilityMode(const bool compatMode) = 0;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Updates a D3D9 surface from a D3D9 buffer
|
* \brief Updates a D3D9 surface from a D3D9 buffer
|
||||||
*
|
*
|
||||||
@ -55,6 +48,13 @@ IDxvkD3D8Bridge : public IUnknown {
|
|||||||
*/
|
*/
|
||||||
MIDL_INTERFACE("D3D9D3D8-A407-773E-18E9-CAFEBEEF3000")
|
MIDL_INTERFACE("D3D9D3D8-A407-773E-18E9-CAFEBEEF3000")
|
||||||
IDxvkD3D8InterfaceBridge : public IUnknown {
|
IDxvkD3D8InterfaceBridge : public IUnknown {
|
||||||
|
/**
|
||||||
|
* \brief Enables or disables D3D9-specific features and validations
|
||||||
|
*
|
||||||
|
* \param [in] compatMode Compatibility state
|
||||||
|
*/
|
||||||
|
virtual void SetD3D8CompatibilityMode(const bool compatMode) = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Retrieves the DXVK configuration
|
* \brief Retrieves the DXVK configuration
|
||||||
*
|
*
|
||||||
@ -85,7 +85,6 @@ namespace dxvk {
|
|||||||
void** ppvObject);
|
void** ppvObject);
|
||||||
|
|
||||||
void SetAPIName(const char* name);
|
void SetAPIName(const char* name);
|
||||||
void SetD3D8CompatibilityMode(const bool compatMode);
|
|
||||||
|
|
||||||
HRESULT UpdateTextureFromBuffer(
|
HRESULT UpdateTextureFromBuffer(
|
||||||
IDirect3DSurface9* pDestSurface,
|
IDirect3DSurface9* pDestSurface,
|
||||||
@ -108,6 +107,8 @@ namespace dxvk {
|
|||||||
REFIID riid,
|
REFIID riid,
|
||||||
void** ppvObject);
|
void** ppvObject);
|
||||||
|
|
||||||
|
void SetD3D8CompatibilityMode(const bool compatMode);
|
||||||
|
|
||||||
const Config* GetConfig() const;
|
const Config* GetConfig() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -54,6 +54,7 @@ namespace dxvk {
|
|||||||
, m_d3d9Options ( dxvkDevice, pParent->GetInstance()->config() )
|
, m_d3d9Options ( dxvkDevice, pParent->GetInstance()->config() )
|
||||||
, m_multithread ( BehaviorFlags & D3DCREATE_MULTITHREADED )
|
, m_multithread ( BehaviorFlags & D3DCREATE_MULTITHREADED )
|
||||||
, m_isSWVP ( (BehaviorFlags & D3DCREATE_SOFTWARE_VERTEXPROCESSING) ? true : false )
|
, m_isSWVP ( (BehaviorFlags & D3DCREATE_SOFTWARE_VERTEXPROCESSING) ? true : false )
|
||||||
|
, m_isD3D8Compatible ( pParent->IsD3D8Compatible() )
|
||||||
, m_csThread ( dxvkDevice, dxvkDevice->createContext() )
|
, m_csThread ( dxvkDevice, dxvkDevice->createContext() )
|
||||||
, m_csChunk ( AllocCsChunk() )
|
, m_csChunk ( AllocCsChunk() )
|
||||||
, m_submissionFence ( new sync::Fence() )
|
, m_submissionFence ( new sync::Fence() )
|
||||||
|
@ -1024,13 +1024,6 @@ namespace dxvk {
|
|||||||
return m_isD3D8Compatible;
|
return m_isD3D8Compatible;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetD3D8CompatibilityMode(bool compatMode) {
|
|
||||||
if (compatMode)
|
|
||||||
Logger::info("The D3D9 device is now operating in D3D8 compatibility mode.");
|
|
||||||
|
|
||||||
m_isD3D8Compatible = compatMode;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Device Lost
|
// Device Lost
|
||||||
bool IsDeviceLost() const {
|
bool IsDeviceLost() const {
|
||||||
return m_deviceLostState != D3D9DeviceLostState::Ok;
|
return m_deviceLostState != D3D9DeviceLostState::Ok;
|
||||||
@ -1505,7 +1498,7 @@ namespace dxvk {
|
|||||||
D3D9ShaderMasks m_psShaderMasks = FixedFunctionMask;
|
D3D9ShaderMasks m_psShaderMasks = FixedFunctionMask;
|
||||||
|
|
||||||
bool m_isSWVP;
|
bool m_isSWVP;
|
||||||
bool m_isD3D8Compatible = false;
|
bool m_isD3D8Compatible;
|
||||||
bool m_amdATOC = false;
|
bool m_amdATOC = false;
|
||||||
bool m_nvATOC = false;
|
bool m_nvATOC = false;
|
||||||
bool m_ffZTest = false;
|
bool m_ffZTest = false;
|
||||||
|
@ -131,6 +131,17 @@ namespace dxvk {
|
|||||||
|
|
||||||
bool IsExtended() { return m_extended; }
|
bool IsExtended() { return m_extended; }
|
||||||
|
|
||||||
|
bool IsD3D8Compatible() const {
|
||||||
|
return m_isD3D8Compatible;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SetD3D8CompatibilityMode(bool compatMode) {
|
||||||
|
if (compatMode)
|
||||||
|
Logger::info("The D3D9 interface is now operating in D3D8 compatibility mode.");
|
||||||
|
|
||||||
|
m_isD3D8Compatible = compatMode;
|
||||||
|
}
|
||||||
|
|
||||||
Rc<DxvkInstance> GetInstance() { return m_instance; }
|
Rc<DxvkInstance> GetInstance() { return m_instance; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -145,6 +156,8 @@ namespace dxvk {
|
|||||||
|
|
||||||
bool m_extended;
|
bool m_extended;
|
||||||
|
|
||||||
|
bool m_isD3D8Compatible = false;
|
||||||
|
|
||||||
D3D9Options m_d3d9Options;
|
D3D9Options m_d3d9Options;
|
||||||
|
|
||||||
std::vector<D3D9Adapter> m_adapters;
|
std::vector<D3D9Adapter> m_adapters;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user