Skip to content

Commit

Permalink
Don't create an extra render target texture
Browse files Browse the repository at this point in the history
  • Loading branch information
elishacloud committed Jul 23, 2024
1 parent 3ea05e5 commit d1fe34e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 25 deletions.
2 changes: 1 addition & 1 deletion Resources/BuildNo.rc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#define BUILD_NUMBER 2152
#define BUILD_NUMBER 2153
24 changes: 1 addition & 23 deletions Wrappers/d3d8/IDirect3DDevice8.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -483,29 +483,7 @@ HRESULT m_IDirect3DDevice8::CreateRenderTarget(THIS_ UINT Width, UINT Height, D3
MultiSample = DeviceMultiSampleType;
}

HRESULT hr = D3DERR_INVALIDCALL;
if (IsScaledResolutionsEnabled())
{
// Create render texture
IDirect3DTexture8* pTexture = nullptr;
if (SUCCEEDED(ProxyInterface->CreateTexture(BufferWidth, BufferHeight, 1, D3DUSAGE_RENDERTARGET, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &pTexture)))
{
// Get render surface
if (SUCCEEDED(pTexture->GetSurfaceLevel(0, ppSurface)))
{
RenderTextureVector.push_back(pTexture);
hr = D3D_OK;
}
else
{
ReleaseInterface(&pTexture);
}
}
}
else
{
hr = ProxyInterface->CreateRenderTarget(Width, Height, Format, MultiSample, Lockable, ppSurface);
}
HRESULT hr = ProxyInterface->CreateRenderTarget(Width, Height, Format, MultiSample, Lockable, ppSurface);

if (SUCCEEDED(hr) && ppSurface)
{
Expand Down
2 changes: 1 addition & 1 deletion Wrappers/d3d8/IDirect3DSurface8.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ HRESULT m_IDirect3DSurface8::LockRect(THIS_ D3DLOCKED_RECT* pLockedRect, CONST R

HRESULT hr = ProxyInterface->LockRect(pLockedRect, pRect, Flags);

if (hr == D3DERR_INVALIDCALL && !IsLocked && pLockedRect && !pEmuSurface && (DeviceMultiSampleType != D3DMULTISAMPLE_NONE || IsScaledResolutionsEnabled()))
if (hr == D3DERR_INVALIDCALL && !IsLocked && pLockedRect && !pEmuSurface && DeviceMultiSampleType != D3DMULTISAMPLE_NONE)
{
D3DSURFACE_DESC Desc;
if (SUCCEEDED(GetDesc(&Desc)))
Expand Down

0 comments on commit d1fe34e

Please sign in to comment.