From 2c8099adf1842bc4caff31f605bfb023b2c087be Mon Sep 17 00:00:00 2001 From: Joshua Ashton Date: Wed, 11 Aug 2021 04:25:29 +0100 Subject: [PATCH] [d3d9] Use Texture2D for CommonTexture resolution Using the generic texture type was a nice idea in theory, but some compilers did not give it a vtable as it was abstract, resulting in a crash here. --- src/d3d9/d3d9_texture.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/d3d9/d3d9_texture.h b/src/d3d9/d3d9_texture.h index 374dc0b2..cfe6ecc2 100644 --- a/src/d3d9/d3d9_texture.h +++ b/src/d3d9/d3d9_texture.h @@ -196,11 +196,8 @@ namespace dxvk { }; - using D3D9TextureGeneric = D3D9BaseTexture; - static_assert(sizeof(D3D9Texture2D) == sizeof(D3D9Texture3D) && - sizeof(D3D9Texture2D) == sizeof(D3D9TextureCube) && - sizeof(D3D9Texture2D) == sizeof(D3D9TextureGeneric)); + sizeof(D3D9Texture2D) == sizeof(D3D9TextureCube)); inline D3D9CommonTexture* GetCommonTexture(IDirect3DBaseTexture9* ptr) { if (ptr == nullptr) @@ -210,7 +207,7 @@ namespace dxvk { // no matter the texture type. // The compiler is not smart enough to eliminate the call to GetType as it is // not marked const. - return static_cast(ptr)->GetCommonTexture(); + return static_cast(ptr)->GetCommonTexture(); } inline D3D9CommonTexture* GetCommonTexture(D3D9Surface* ptr) { @@ -232,7 +229,7 @@ namespace dxvk { // no matter the texture type. // The compiler is not smart enough to eliminate the call to GetType as it is // not marked const. - return CastRefPrivate(tex, AddRef); + return CastRefPrivate(tex, AddRef); } inline void TextureChangePrivate(IDirect3DBaseTexture9*& dst, IDirect3DBaseTexture9* src) {