From e75717021100e2fa646da88fff14f78b7a870f0f Mon Sep 17 00:00:00 2001 From: WinterSnowfall Date: Mon, 13 Jan 2025 20:31:18 +0200 Subject: [PATCH] [d3d8] Remove superfluous methods from D3D8Surface --- src/d3d8/d3d8_surface.cpp | 12 ------------ src/d3d8/d3d8_surface.h | 17 ++++++----------- 2 files changed, 6 insertions(+), 23 deletions(-) diff --git a/src/d3d8/d3d8_surface.cpp b/src/d3d8/d3d8_surface.cpp index 9f4d11156..ac33b1cc9 100644 --- a/src/d3d8/d3d8_surface.cpp +++ b/src/d3d8/d3d8_surface.cpp @@ -20,10 +20,6 @@ namespace dxvk { : D3D8Surface (pDevice, nullptr, std::move(pSurface)) { } - D3DRESOURCETYPE STDMETHODCALLTYPE D3D8Surface::GetType() { - return D3DRESOURCETYPE(GetD3D9()->GetType()); - } - HRESULT STDMETHODCALLTYPE D3D8Surface::GetDesc(D3DSURFACE_DESC* pDesc) { if (unlikely(pDesc == nullptr)) return D3DERR_INVALIDCALL; @@ -48,14 +44,6 @@ namespace dxvk { return GetD3D9()->UnlockRect(); } - HRESULT STDMETHODCALLTYPE D3D8Surface::GetDC(HDC* phDC) { - return GetD3D9()->GetDC(phDC); - } - - HRESULT STDMETHODCALLTYPE D3D8Surface::ReleaseDC(HDC hDC) { - return GetD3D9()->ReleaseDC(hDC); - } - // TODO: Consider creating only one texture to // encompass all surface levels of a texture. Com D3D8Surface::GetBlitImage() { diff --git a/src/d3d8/d3d8_surface.h b/src/d3d8/d3d8_surface.h index c57d15959..377dbc299 100644 --- a/src/d3d8/d3d8_surface.h +++ b/src/d3d8/d3d8_surface.h @@ -5,8 +5,9 @@ namespace dxvk { - // TODO: all inherited methods in D3D8Surface should be final like in d9vk - + // Note: IDirect3DSurface8 does not actually inherit from IDirect3DResource8, + // however it does expose serveral of the methods typically found part of + // IDirect3DResource8, such as Set/Get/FreePrivateData, so model it as such. using D3D8SurfaceBase = D3D8Subresource; class D3D8Surface final : public D3D8SurfaceBase { @@ -21,20 +22,14 @@ namespace dxvk { D3D8Device* pDevice, Com&& pSurface); - D3DRESOURCETYPE STDMETHODCALLTYPE GetType(); - - HRESULT STDMETHODCALLTYPE GetDesc(D3DSURFACE_DESC* pDesc); + HRESULT STDMETHODCALLTYPE GetDesc(D3DSURFACE_DESC* pDesc) final; HRESULT STDMETHODCALLTYPE LockRect( D3DLOCKED_RECT* pLockedRect, CONST RECT* pRect, - DWORD Flags); + DWORD Flags) final; - HRESULT STDMETHODCALLTYPE UnlockRect(); - - HRESULT STDMETHODCALLTYPE GetDC(HDC* phDC); - - HRESULT STDMETHODCALLTYPE ReleaseDC(HDC hDC); + HRESULT STDMETHODCALLTYPE UnlockRect() final; /** * \brief Allocate or reuse an image of the same size