Skip to content

Commit

Permalink
Share interface cache between Device and DeviceEx
Browse files Browse the repository at this point in the history
  • Loading branch information
elishacloud committed Aug 23, 2024
1 parent 5aadda9 commit ea5e5b4
Show file tree
Hide file tree
Showing 24 changed files with 94 additions and 75 deletions.
2 changes: 1 addition & 1 deletion Dllmain/BuildNo.rc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#define BUILD_NUMBER 7104
#define BUILD_NUMBER 7105
89 changes: 53 additions & 36 deletions d3d9/AddressLookupTable.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,12 @@ template <typename D>
class AddressLookupTableD3d9
{
public:
explicit AddressLookupTableD3d9(D *pDevice) : pDevice(pDevice) {}
explicit AddressLookupTableD3d9(D*) {}
~AddressLookupTableD3d9()
{
ConstructorFlag = true;

for (const auto& cache : g_map)
{
for (const auto& entry : cache)
{
entry.second->DeleteMe();
}
}
ClearAllInterfaces();
}

template <typename T>
Expand Down Expand Up @@ -64,57 +58,57 @@ class AddressLookupTableD3d9
{
return new m_IDirect3DDevice9Ex(static_cast<m_IDirect3DDevice9Ex*>(Proxy), Device, riid);
}
m_IDirect3DCubeTexture9* CreateInterface(m_IDirect3DCubeTexture9* Proxy, void*, REFIID)
m_IDirect3DCubeTexture9* CreateInterface(m_IDirect3DCubeTexture9* Proxy, m_IDirect3DDevice9Ex* Device, REFIID)
{
return new m_IDirect3DCubeTexture9(static_cast<m_IDirect3DCubeTexture9*>(Proxy), pDevice);
return new m_IDirect3DCubeTexture9(static_cast<m_IDirect3DCubeTexture9*>(Proxy), Device);
}
m_IDirect3DIndexBuffer9* CreateInterface(m_IDirect3DIndexBuffer9* Proxy, void*, REFIID)
m_IDirect3DIndexBuffer9* CreateInterface(m_IDirect3DIndexBuffer9* Proxy, m_IDirect3DDevice9Ex* Device, REFIID)
{
return new m_IDirect3DIndexBuffer9(static_cast<m_IDirect3DIndexBuffer9*>(Proxy), pDevice);
return new m_IDirect3DIndexBuffer9(static_cast<m_IDirect3DIndexBuffer9*>(Proxy), Device);
}
m_IDirect3DPixelShader9* CreateInterface(m_IDirect3DPixelShader9* Proxy, void*, REFIID)
m_IDirect3DPixelShader9* CreateInterface(m_IDirect3DPixelShader9* Proxy, m_IDirect3DDevice9Ex* Device, REFIID)
{
return new m_IDirect3DPixelShader9(static_cast<m_IDirect3DPixelShader9*>(Proxy), pDevice);
return new m_IDirect3DPixelShader9(static_cast<m_IDirect3DPixelShader9*>(Proxy), Device);
}
m_IDirect3DQuery9* CreateInterface(m_IDirect3DQuery9* Proxy, void*, REFIID)
m_IDirect3DQuery9* CreateInterface(m_IDirect3DQuery9* Proxy, m_IDirect3DDevice9Ex* Device, REFIID)
{
return new m_IDirect3DQuery9(static_cast<m_IDirect3DQuery9*>(Proxy), pDevice);
return new m_IDirect3DQuery9(static_cast<m_IDirect3DQuery9*>(Proxy), Device);
}
m_IDirect3DStateBlock9* CreateInterface(m_IDirect3DStateBlock9* Proxy, void*, REFIID)
m_IDirect3DStateBlock9* CreateInterface(m_IDirect3DStateBlock9* Proxy, m_IDirect3DDevice9Ex* Device, REFIID)
{
return new m_IDirect3DStateBlock9(static_cast<m_IDirect3DStateBlock9*>(Proxy), pDevice);
return new m_IDirect3DStateBlock9(static_cast<m_IDirect3DStateBlock9*>(Proxy), Device);
}
m_IDirect3DSurface9* CreateInterface(m_IDirect3DSurface9* Proxy, void*, REFIID)
m_IDirect3DSurface9* CreateInterface(m_IDirect3DSurface9* Proxy, m_IDirect3DDevice9Ex* Device, REFIID)
{
return new m_IDirect3DSurface9(static_cast<m_IDirect3DSurface9*>(Proxy), pDevice);
return new m_IDirect3DSurface9(static_cast<m_IDirect3DSurface9*>(Proxy), Device);
}
m_IDirect3DSwapChain9Ex* CreateInterface(m_IDirect3DSwapChain9Ex* Proxy, void*, REFIID riid)
m_IDirect3DSwapChain9Ex* CreateInterface(m_IDirect3DSwapChain9Ex* Proxy, m_IDirect3DDevice9Ex* Device, REFIID riid)
{
return new m_IDirect3DSwapChain9Ex(static_cast<m_IDirect3DSwapChain9Ex*>(Proxy), pDevice, riid);
return new m_IDirect3DSwapChain9Ex(static_cast<m_IDirect3DSwapChain9Ex*>(Proxy), Device, riid);
}
m_IDirect3DTexture9* CreateInterface(m_IDirect3DTexture9* Proxy, void*, REFIID)
m_IDirect3DTexture9* CreateInterface(m_IDirect3DTexture9* Proxy, m_IDirect3DDevice9Ex* Device, REFIID)
{
return new m_IDirect3DTexture9(static_cast<m_IDirect3DTexture9*>(Proxy), pDevice);
return new m_IDirect3DTexture9(static_cast<m_IDirect3DTexture9*>(Proxy), Device);
}
m_IDirect3DVertexBuffer9* CreateInterface(m_IDirect3DVertexBuffer9* Proxy, void*, REFIID)
m_IDirect3DVertexBuffer9* CreateInterface(m_IDirect3DVertexBuffer9* Proxy, m_IDirect3DDevice9Ex* Device, REFIID)
{
return new m_IDirect3DVertexBuffer9(static_cast<m_IDirect3DVertexBuffer9*>(Proxy), pDevice);
return new m_IDirect3DVertexBuffer9(static_cast<m_IDirect3DVertexBuffer9*>(Proxy), Device);
}
m_IDirect3DVertexDeclaration9* CreateInterface(m_IDirect3DVertexDeclaration9* Proxy, void*, REFIID)
m_IDirect3DVertexDeclaration9* CreateInterface(m_IDirect3DVertexDeclaration9* Proxy, m_IDirect3DDevice9Ex* Device, REFIID)
{
return new m_IDirect3DVertexDeclaration9(static_cast<m_IDirect3DVertexDeclaration9*>(Proxy), pDevice);
return new m_IDirect3DVertexDeclaration9(static_cast<m_IDirect3DVertexDeclaration9*>(Proxy), Device);
}
m_IDirect3DVertexShader9* CreateInterface(m_IDirect3DVertexShader9* Proxy, void*, REFIID)
m_IDirect3DVertexShader9* CreateInterface(m_IDirect3DVertexShader9* Proxy, m_IDirect3DDevice9Ex* Device, REFIID)
{
return new m_IDirect3DVertexShader9(static_cast<m_IDirect3DVertexShader9*>(Proxy), pDevice);
return new m_IDirect3DVertexShader9(static_cast<m_IDirect3DVertexShader9*>(Proxy), Device);
}
m_IDirect3DVolume9* CreateInterface(m_IDirect3DVolume9* Proxy, void*, REFIID)
m_IDirect3DVolume9* CreateInterface(m_IDirect3DVolume9* Proxy, m_IDirect3DDevice9Ex* Device, REFIID)
{
return new m_IDirect3DVolume9(static_cast<m_IDirect3DVolume9*>(Proxy), pDevice);
return new m_IDirect3DVolume9(static_cast<m_IDirect3DVolume9*>(Proxy), Device);
}
m_IDirect3DVolumeTexture9* CreateInterface(m_IDirect3DVolumeTexture9* Proxy, void*, REFIID)
m_IDirect3DVolumeTexture9* CreateInterface(m_IDirect3DVolumeTexture9* Proxy, m_IDirect3DDevice9Ex* Device, REFIID)
{
return new m_IDirect3DVolumeTexture9(static_cast<m_IDirect3DVolumeTexture9*>(Proxy), pDevice);
return new m_IDirect3DVolumeTexture9(static_cast<m_IDirect3DVolumeTexture9*>(Proxy), Device);
}

template <typename T, typename D>
Expand All @@ -139,6 +133,10 @@ class AddressLookupTableD3d9
template <typename T>
void SaveAddress(T *Wrapper, void *Proxy)
{
while (ClearFlag)
{
Sleep(0);
}
constexpr UINT CacheIndex = AddressCacheIndex<T>::CacheIndex;
if (Wrapper && Proxy)
{
Expand All @@ -149,7 +147,7 @@ class AddressLookupTableD3d9
template <typename T>
void DeleteAddress(T *Wrapper)
{
if (!Wrapper || ConstructorFlag)
if (!Wrapper || ConstructorFlag || ClearFlag)
{
return;
}
Expand All @@ -164,9 +162,28 @@ class AddressLookupTableD3d9
}
}

UINT GetDeviceCount()
{
return g_map[AddressCacheIndex<m_IDirect3DDevice9Ex>::CacheIndex].size();
}

void ClearAllInterfaces()
{
ClearFlag = true;
for (UINT x = 0; x < MaxIndex; x++)
{
for (const auto& entry : g_map[x])
{
entry.second->DeleteMe();
}
g_map[x].clear();
}
ClearFlag = false;
}

private:
bool ConstructorFlag = false;
D *const pDevice;
bool ClearFlag = false;
std::unordered_map<void*, class AddressLookupTableD3d9Object*> g_map[MaxIndex];
};

Expand Down
2 changes: 1 addition & 1 deletion d3d9/IDirect3DCubeTexture9.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ HRESULT m_IDirect3DCubeTexture9::GetCubeMapSurface(THIS_ D3DCUBEMAP_FACES FaceTy

if (SUCCEEDED(hr) && ppCubeMapSurface)
{
*ppCubeMapSurface = m_pDeviceEx->ProxyAddressLookupTable->FindAddress<m_IDirect3DSurface9, m_IDirect3DDevice9Ex>(*ppCubeMapSurface, m_pDeviceEx, IID_IDirect3DTexture9);
*ppCubeMapSurface = ProxyAddressLookupTable9.FindAddress<m_IDirect3DSurface9, m_IDirect3DDevice9Ex>(*ppCubeMapSurface, m_pDeviceEx, IID_IDirect3DTexture9);
}

return hr;
Expand Down
2 changes: 1 addition & 1 deletion d3d9/IDirect3DCubeTexture9.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class m_IDirect3DCubeTexture9 : public IDirect3DCubeTexture9, public AddressLook
{
LOG_LIMIT(3, "Creating interface " << __FUNCTION__ << " (" << this << ")");

pDevice->ProxyAddressLookupTable->SaveAddress(this, ProxyInterface);
ProxyAddressLookupTable9.SaveAddress(this, ProxyInterface);
}
~m_IDirect3DCubeTexture9()
{
Expand Down
26 changes: 13 additions & 13 deletions d3d9/IDirect3DDevice9Ex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ HRESULT m_IDirect3DDevice9Ex::EndStateBlock(THIS_ IDirect3DStateBlock9** ppSB)

if (SUCCEEDED(hr) && ppSB)
{
*ppSB = ProxyAddressLookupTable->FindAddress<m_IDirect3DStateBlock9, m_IDirect3DDevice9Ex>(*ppSB, this, IID_IDirect3DStateBlock9);
*ppSB = ProxyAddressLookupTable9.FindAddress<m_IDirect3DStateBlock9, m_IDirect3DDevice9Ex>(*ppSB, this, IID_IDirect3DStateBlock9);
}

return hr;
Expand Down Expand Up @@ -542,7 +542,7 @@ HRESULT m_IDirect3DDevice9Ex::GetRenderTarget(THIS_ DWORD RenderTargetIndex, IDi

if (SUCCEEDED(hr) && ppRenderTarget)
{
*ppRenderTarget = ProxyAddressLookupTable->FindAddress<m_IDirect3DSurface9, m_IDirect3DDevice9Ex>(*ppRenderTarget, this, IID_IDirect3DSurface9);
*ppRenderTarget = ProxyAddressLookupTable9.FindAddress<m_IDirect3DSurface9, m_IDirect3DDevice9Ex>(*ppRenderTarget, this, IID_IDirect3DSurface9);
}

return hr;
Expand Down Expand Up @@ -645,7 +645,7 @@ HRESULT m_IDirect3DDevice9Ex::GetIndices(THIS_ IDirect3DIndexBuffer9** ppIndexDa

if (SUCCEEDED(hr) && ppIndexData)
{
*ppIndexData = ProxyAddressLookupTable->FindAddress<m_IDirect3DIndexBuffer9, m_IDirect3DDevice9Ex>(*ppIndexData, this, IID_IDirect3DIndexBuffer9);
*ppIndexData = ProxyAddressLookupTable9.FindAddress<m_IDirect3DIndexBuffer9, m_IDirect3DDevice9Ex>(*ppIndexData, this, IID_IDirect3DIndexBuffer9);
}

return hr;
Expand Down Expand Up @@ -838,7 +838,7 @@ HRESULT m_IDirect3DDevice9Ex::GetPixelShader(THIS_ IDirect3DPixelShader9** ppSha

if (SUCCEEDED(hr) && ppShader)
{
*ppShader = ProxyAddressLookupTable->FindAddress<m_IDirect3DPixelShader9, m_IDirect3DDevice9Ex>(*ppShader, this, IID_IDirect3DPixelShader9);
*ppShader = ProxyAddressLookupTable9.FindAddress<m_IDirect3DPixelShader9, m_IDirect3DDevice9Ex>(*ppShader, this, IID_IDirect3DPixelShader9);
}

return hr;
Expand Down Expand Up @@ -994,7 +994,7 @@ HRESULT m_IDirect3DDevice9Ex::GetStreamSource(THIS_ UINT StreamNumber, IDirect3D

if (SUCCEEDED(hr) && ppStreamData)
{
*ppStreamData = ProxyAddressLookupTable->FindAddress<m_IDirect3DVertexBuffer9, m_IDirect3DDevice9Ex>(*ppStreamData, this, IID_IDirect3DVertexBuffer9);
*ppStreamData = ProxyAddressLookupTable9.FindAddress<m_IDirect3DVertexBuffer9, m_IDirect3DDevice9Ex>(*ppStreamData, this, IID_IDirect3DVertexBuffer9);
}

return hr;
Expand All @@ -1020,7 +1020,7 @@ HRESULT m_IDirect3DDevice9Ex::GetBackBuffer(THIS_ UINT iSwapChain, UINT iBackBuf

if (SUCCEEDED(hr) && ppBackBuffer)
{
*ppBackBuffer = ProxyAddressLookupTable->FindAddress<m_IDirect3DSurface9, m_IDirect3DDevice9Ex>(*ppBackBuffer, this, IID_IDirect3DSurface9);
*ppBackBuffer = ProxyAddressLookupTable9.FindAddress<m_IDirect3DSurface9, m_IDirect3DDevice9Ex>(*ppBackBuffer, this, IID_IDirect3DSurface9);
}

return hr;
Expand All @@ -1034,7 +1034,7 @@ HRESULT m_IDirect3DDevice9Ex::GetDepthStencilSurface(IDirect3DSurface9 **ppZSten

if (SUCCEEDED(hr) && ppZStencilSurface)
{
*ppZStencilSurface = ProxyAddressLookupTable->FindAddress<m_IDirect3DSurface9, m_IDirect3DDevice9Ex>(*ppZStencilSurface, this, IID_IDirect3DSurface9);
*ppZStencilSurface = ProxyAddressLookupTable9.FindAddress<m_IDirect3DSurface9, m_IDirect3DDevice9Ex>(*ppZStencilSurface, this, IID_IDirect3DSurface9);
}

return hr;
Expand All @@ -1051,13 +1051,13 @@ HRESULT m_IDirect3DDevice9Ex::GetTexture(DWORD Stage, IDirect3DBaseTexture9 **pp
switch ((*ppTexture)->GetType())
{
case D3DRTYPE_TEXTURE:
*ppTexture = ProxyAddressLookupTable->FindAddress<m_IDirect3DTexture9, m_IDirect3DDevice9Ex>(*ppTexture, this, IID_IDirect3DTexture9);
*ppTexture = ProxyAddressLookupTable9.FindAddress<m_IDirect3DTexture9, m_IDirect3DDevice9Ex>(*ppTexture, this, IID_IDirect3DTexture9);
break;
case D3DRTYPE_VOLUMETEXTURE:
*ppTexture = ProxyAddressLookupTable->FindAddress<m_IDirect3DVolumeTexture9, m_IDirect3DDevice9Ex>(*ppTexture, this, IID_IDirect3DVolumeTexture9);
*ppTexture = ProxyAddressLookupTable9.FindAddress<m_IDirect3DVolumeTexture9, m_IDirect3DDevice9Ex>(*ppTexture, this, IID_IDirect3DVolumeTexture9);
break;
case D3DRTYPE_CUBETEXTURE:
*ppTexture = ProxyAddressLookupTable->FindAddress<m_IDirect3DCubeTexture9, m_IDirect3DDevice9Ex>(*ppTexture, this, IID_IDirect3DCubeTexture9);
*ppTexture = ProxyAddressLookupTable9.FindAddress<m_IDirect3DCubeTexture9, m_IDirect3DDevice9Ex>(*ppTexture, this, IID_IDirect3DCubeTexture9);
break;
default:
return D3DERR_INVALIDCALL;
Expand Down Expand Up @@ -1281,7 +1281,7 @@ HRESULT m_IDirect3DDevice9Ex::GetVertexShader(THIS_ IDirect3DVertexShader9** ppS

if (SUCCEEDED(hr) && ppShader)
{
*ppShader = ProxyAddressLookupTable->FindAddress<m_IDirect3DVertexShader9, m_IDirect3DDevice9Ex>(*ppShader, this, IID_IDirect3DVertexShader9);
*ppShader = ProxyAddressLookupTable9.FindAddress<m_IDirect3DVertexShader9, m_IDirect3DDevice9Ex>(*ppShader, this, IID_IDirect3DVertexShader9);
}

return hr;
Expand Down Expand Up @@ -1473,7 +1473,7 @@ HRESULT m_IDirect3DDevice9Ex::GetVertexDeclaration(THIS_ IDirect3DVertexDeclarat

if (SUCCEEDED(hr) && ppDecl)
{
*ppDecl = ProxyAddressLookupTable->FindAddress<m_IDirect3DVertexDeclaration9, m_IDirect3DDevice9Ex>(*ppDecl, this, IID_IDirect3DVertexDeclaration9);
*ppDecl = ProxyAddressLookupTable9.FindAddress<m_IDirect3DVertexDeclaration9, m_IDirect3DDevice9Ex>(*ppDecl, this, IID_IDirect3DVertexDeclaration9);
}

return hr;
Expand Down Expand Up @@ -2054,7 +2054,7 @@ HRESULT m_IDirect3DDevice9Ex::GetSwapChain(THIS_ UINT iSwapChain, IDirect3DSwapC

if (SUCCEEDED(hr))
{
*ppSwapChain = ProxyAddressLookupTable->FindAddress<m_IDirect3DSwapChain9Ex, m_IDirect3DDevice9Ex>(*ppSwapChain, this, IID_IDirect3DSwapChain9);
*ppSwapChain = ProxyAddressLookupTable9.FindAddress<m_IDirect3DSwapChain9Ex, m_IDirect3DDevice9Ex>(*ppSwapChain, this, IID_IDirect3DSwapChain9);
}

return hr;
Expand Down
12 changes: 6 additions & 6 deletions d3d9/IDirect3DDevice9Ex.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ class m_IDirect3DDevice9Ex : public IDirect3DDevice9Ex, public AddressLookupTabl

ReInitDevice();

ProxyAddressLookupTable = new AddressLookupTableD3d9<m_IDirect3DDevice9Ex>(this);

ProxyAddressLookupTableDevice9.SaveAddress(this, ProxyInterface);
}
~m_IDirect3DDevice9Ex()
Expand All @@ -76,9 +74,13 @@ class m_IDirect3DDevice9Ex : public IDirect3DDevice9Ex, public AddressLookupTabl
WndProc::RemoveWndProc(DeviceDetails.DeviceWindow);
}

delete ProxyAddressLookupTable;

ProxyAddressLookupTableDevice9.DeleteAddress(this);

// Clear unused interfaces
if (ProxyAddressLookupTableDevice9.GetDeviceCount() == 0)
{
ProxyAddressLookupTable9.ClearAllInterfaces();
}
}
void SetDeviceDetails(DEVICEDETAILS& NewDeviceDetails)
{
Expand All @@ -92,8 +94,6 @@ class m_IDirect3DDevice9Ex : public IDirect3DDevice9Ex, public AddressLookupTabl
}
}

AddressLookupTableD3d9<m_IDirect3DDevice9Ex> *ProxyAddressLookupTable = nullptr;

/*** IUnknown methods ***/
STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj);
STDMETHOD_(ULONG, AddRef)(THIS);
Expand Down
2 changes: 1 addition & 1 deletion d3d9/IDirect3DIndexBuffer9.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class m_IDirect3DIndexBuffer9 : public IDirect3DIndexBuffer9, public AddressLook
{
LOG_LIMIT(3, "Creating interface " << __FUNCTION__ << " (" << this << ")");

pDevice->ProxyAddressLookupTable->SaveAddress(this, ProxyInterface);
ProxyAddressLookupTable9.SaveAddress(this, ProxyInterface);
}
~m_IDirect3DIndexBuffer9()
{
Expand Down
2 changes: 1 addition & 1 deletion d3d9/IDirect3DPixelShader9.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class m_IDirect3DPixelShader9 : public IDirect3DPixelShader9, public AddressLook
{
LOG_LIMIT(3, "Creating interface " << __FUNCTION__ << " (" << this << ")");

pDevice->ProxyAddressLookupTable->SaveAddress(this, ProxyInterface);
ProxyAddressLookupTable9.SaveAddress(this, ProxyInterface);
}
~m_IDirect3DPixelShader9()
{
Expand Down
2 changes: 1 addition & 1 deletion d3d9/IDirect3DQuery9.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class m_IDirect3DQuery9 : public IDirect3DQuery9, public AddressLookupTableD3d9O
{
LOG_LIMIT(3, "Creating interface " << __FUNCTION__ << " (" << this << ")");

pDevice->ProxyAddressLookupTable->SaveAddress(this, ProxyInterface);
ProxyAddressLookupTable9.SaveAddress(this, ProxyInterface);
}
~m_IDirect3DQuery9()
{
Expand Down
2 changes: 1 addition & 1 deletion d3d9/IDirect3DStateBlock9.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class m_IDirect3DStateBlock9 : public IDirect3DStateBlock9, public AddressLookup
{
LOG_LIMIT(3, "Creating interface " << __FUNCTION__ << " (" << this << ")");

pDevice->ProxyAddressLookupTable->SaveAddress(this, ProxyInterface);
ProxyAddressLookupTable9.SaveAddress(this, ProxyInterface);
}
~m_IDirect3DStateBlock9()
{
Expand Down
2 changes: 1 addition & 1 deletion d3d9/IDirect3DSurface9.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class m_IDirect3DSurface9 : public IDirect3DSurface9, public AddressLookupTableD
LOG_LIMIT(3, __FUNCTION__ << " Failed to GetDesc()!" << this << ")");
}

pDevice->ProxyAddressLookupTable->SaveAddress(this, ProxyInterface);
ProxyAddressLookupTable9.SaveAddress(this, ProxyInterface);
}
~m_IDirect3DSurface9()
{
Expand Down
2 changes: 1 addition & 1 deletion d3d9/IDirect3DSwapChain9Ex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ HRESULT m_IDirect3DSwapChain9Ex::GetBackBuffer(THIS_ UINT BackBuffer, D3DBACKBUF

if (SUCCEEDED(hr) && ppBackBuffer)
{
*ppBackBuffer = m_pDeviceEx->ProxyAddressLookupTable->FindAddress<m_IDirect3DSurface9, m_IDirect3DDevice9Ex>(*ppBackBuffer, m_pDeviceEx, IID_IDirect3DSurface9);
*ppBackBuffer = ProxyAddressLookupTable9.FindAddress<m_IDirect3DSurface9, m_IDirect3DDevice9Ex>(*ppBackBuffer, m_pDeviceEx, IID_IDirect3DSurface9);
}

return hr;
Expand Down
2 changes: 1 addition & 1 deletion d3d9/IDirect3DSwapChain9Ex.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class m_IDirect3DSwapChain9Ex : public IDirect3DSwapChain9Ex, public AddressLook
ProxyInterfaceEx = pSwapChain9;
}

pDevice->ProxyAddressLookupTable->SaveAddress(this, ProxyInterface);
ProxyAddressLookupTable9.SaveAddress(this, ProxyInterface);
}
~m_IDirect3DSwapChain9Ex()
{
Expand Down
2 changes: 1 addition & 1 deletion d3d9/IDirect3DTexture9.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ HRESULT m_IDirect3DTexture9::GetSurfaceLevel(THIS_ UINT Level, IDirect3DSurface9

if (SUCCEEDED(hr) && ppSurfaceLevel)
{
*ppSurfaceLevel = m_pDeviceEx->ProxyAddressLookupTable->FindAddress<m_IDirect3DSurface9, m_IDirect3DDevice9Ex>(*ppSurfaceLevel, m_pDeviceEx, IID_IDirect3DSurface9);
*ppSurfaceLevel = ProxyAddressLookupTable9.FindAddress<m_IDirect3DSurface9, m_IDirect3DDevice9Ex>(*ppSurfaceLevel, m_pDeviceEx, IID_IDirect3DSurface9);
}

return hr;
Expand Down
2 changes: 1 addition & 1 deletion d3d9/IDirect3DTexture9.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class m_IDirect3DTexture9 : public IDirect3DTexture9, public AddressLookupTableD
{
LOG_LIMIT(3, "Creating interface " << __FUNCTION__ << " (" << this << ")");

pDevice->ProxyAddressLookupTable->SaveAddress(this, ProxyInterface);
ProxyAddressLookupTable9.SaveAddress(this, ProxyInterface);
}
~m_IDirect3DTexture9()
{
Expand Down
Loading

0 comments on commit ea5e5b4

Please sign in to comment.