mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-02-27 13:54:16 +01:00
[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.
This commit is contained in:
parent
ab7fc42f2f
commit
2c8099adf1
@ -196,11 +196,8 @@ namespace dxvk {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
using D3D9TextureGeneric = D3D9BaseTexture<D3D9Surface, IDirect3DBaseTexture9>;
|
|
||||||
|
|
||||||
static_assert(sizeof(D3D9Texture2D) == sizeof(D3D9Texture3D) &&
|
static_assert(sizeof(D3D9Texture2D) == sizeof(D3D9Texture3D) &&
|
||||||
sizeof(D3D9Texture2D) == sizeof(D3D9TextureCube) &&
|
sizeof(D3D9Texture2D) == sizeof(D3D9TextureCube));
|
||||||
sizeof(D3D9Texture2D) == sizeof(D3D9TextureGeneric));
|
|
||||||
|
|
||||||
inline D3D9CommonTexture* GetCommonTexture(IDirect3DBaseTexture9* ptr) {
|
inline D3D9CommonTexture* GetCommonTexture(IDirect3DBaseTexture9* ptr) {
|
||||||
if (ptr == nullptr)
|
if (ptr == nullptr)
|
||||||
@ -210,7 +207,7 @@ namespace dxvk {
|
|||||||
// no matter the texture type.
|
// no matter the texture type.
|
||||||
// The compiler is not smart enough to eliminate the call to GetType as it is
|
// The compiler is not smart enough to eliminate the call to GetType as it is
|
||||||
// not marked const.
|
// not marked const.
|
||||||
return static_cast<D3D9TextureGeneric*>(ptr)->GetCommonTexture();
|
return static_cast<D3D9Texture2D*>(ptr)->GetCommonTexture();
|
||||||
}
|
}
|
||||||
|
|
||||||
inline D3D9CommonTexture* GetCommonTexture(D3D9Surface* ptr) {
|
inline D3D9CommonTexture* GetCommonTexture(D3D9Surface* ptr) {
|
||||||
@ -232,7 +229,7 @@ namespace dxvk {
|
|||||||
// no matter the texture type.
|
// no matter the texture type.
|
||||||
// The compiler is not smart enough to eliminate the call to GetType as it is
|
// The compiler is not smart enough to eliminate the call to GetType as it is
|
||||||
// not marked const.
|
// not marked const.
|
||||||
return CastRefPrivate<D3D9TextureGeneric>(tex, AddRef);
|
return CastRefPrivate<D3D9Texture2D>(tex, AddRef);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void TextureChangePrivate(IDirect3DBaseTexture9*& dst, IDirect3DBaseTexture9* src) {
|
inline void TextureChangePrivate(IDirect3DBaseTexture9*& dst, IDirect3DBaseTexture9* src) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user