1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-02-01 08:52:11 +01:00

[d3d8] Adjust surface and texture clearing with D3DFMT_UNKNOWN

This commit is contained in:
WinterSnowfall 2024-10-14 11:22:11 +03:00 committed by Robin Kertels
parent a760f4a8dc
commit 1181efd09d

View File

@ -309,6 +309,11 @@ namespace dxvk {
D3DFORMAT Format,
D3DPOOL Pool,
IDirect3DTexture8** ppTexture) {
// D3D8 returns D3DERR_INVALIDCALL for D3DFMT_UNKNOWN
// before clearing the content of ppTexture.
if (unlikely(Format == D3DFMT_UNKNOWN))
return D3DERR_INVALIDCALL;
InitReturnPtr(ppTexture);
if (unlikely(ppTexture == nullptr))
@ -344,6 +349,11 @@ namespace dxvk {
D3DFORMAT Format,
D3DPOOL Pool,
IDirect3DVolumeTexture8** ppVolumeTexture) {
// D3D8 returns D3DERR_INVALIDCALL for D3DFMT_UNKNOWN
// before clearing the content of ppVolumeTexture.
if (unlikely(Format == D3DFMT_UNKNOWN))
return D3DERR_INVALIDCALL;
InitReturnPtr(ppVolumeTexture);
if (unlikely(ppVolumeTexture == nullptr))
@ -371,6 +381,11 @@ namespace dxvk {
D3DFORMAT Format,
D3DPOOL Pool,
IDirect3DCubeTexture8** ppCubeTexture) {
// D3D8 returns D3DERR_INVALIDCALL for D3DFMT_UNKNOWN
// before clearing the content of ppCubeTexture.
if (unlikely(Format == D3DFMT_UNKNOWN))
return D3DERR_INVALIDCALL;
InitReturnPtr(ppCubeTexture);
if (unlikely(ppCubeTexture == nullptr))
@ -444,6 +459,11 @@ namespace dxvk {
D3DMULTISAMPLE_TYPE MultiSample,
BOOL Lockable,
IDirect3DSurface8** ppSurface) {
// D3D8 returns D3DERR_INVALIDCALL for D3DFMT_UNKNOWN
// before clearing the content of ppSurface.
if (unlikely(Format == D3DFMT_UNKNOWN))
return D3DERR_INVALIDCALL;
InitReturnPtr(ppSurface);
if (unlikely(ppSurface == nullptr))
@ -472,6 +492,11 @@ namespace dxvk {
D3DFORMAT Format,
D3DMULTISAMPLE_TYPE MultiSample,
IDirect3DSurface8** ppSurface) {
// D3D8 returns D3DERR_INVALIDCALL for D3DFMT_UNKNOWN
// before clearing the content of ppSurface.
if (unlikely(Format == D3DFMT_UNKNOWN))
return D3DERR_INVALIDCALL;
InitReturnPtr(ppSurface);
if (unlikely(ppSurface == nullptr))
@ -499,8 +524,13 @@ namespace dxvk {
UINT Height,
D3DFORMAT Format,
IDirect3DSurface8** ppSurface) {
// Only D3D8 CreateImageSurface clears the content of ppSurface
// before checking if Format is equal to D3DFMT_UNKNOWN.
InitReturnPtr(ppSurface);
if (unlikely(Format == D3DFMT_UNKNOWN))
return D3DERR_INVALIDCALL;
if (unlikely(ppSurface == nullptr))
return D3DERR_INVALIDCALL;