Remove hacks skipping guest resource removal if they are bound
Fixes games running out of guest memory: - Outrun 2 - Monster Garage - probably many more Removes "Skipping Release of..." test cases
This commit is contained in:
parent
dc5f56222e
commit
74333af9c0
|
@ -8732,44 +8732,6 @@ __declspec(naked) void WINAPI xbox::EMUPATCH(D3D_BlockOnTime_4)( dword_xt Unknow
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool DestroyResource_Common(xbox::X_D3DResource* pResource)
|
|
||||||
{
|
|
||||||
if (pResource == g_pXbox_RenderTarget) {
|
|
||||||
LOG_TEST_CASE("Skipping Release of active Xbox Render Target");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (pResource == g_pXbox_DepthStencil) {
|
|
||||||
LOG_TEST_CASE("Skipping Release of active Xbox Depth Stencil");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (pResource == g_pXbox_BackBufferSurface) {
|
|
||||||
LOG_TEST_CASE("Skipping Release of active Xbox BackBuffer");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (pResource == g_pXbox_DefaultDepthStencilSurface) {
|
|
||||||
LOG_TEST_CASE("Skipping Release of default Xbox Depth Stencil");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int i = 0; i < xbox::X_D3DTS_STAGECOUNT; i++) {
|
|
||||||
if (pResource == g_pXbox_SetTexture[i]) {
|
|
||||||
// This shouldn't happen, since texture resources that get destroyed,
|
|
||||||
// shouldn't be set to any stage anymore.
|
|
||||||
LOG_TEST_CASE("Skipping Release of active Xbox Texture");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Release the host copy (if it exists!)
|
|
||||||
FreeHostResource(GetHostResourceKey(pResource));
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
// * patch: D3D_DestroyResource
|
// * patch: D3D_DestroyResource
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
|
@ -8777,10 +8739,11 @@ void WINAPI xbox::EMUPATCH(D3D_DestroyResource)(X_D3DResource* pResource)
|
||||||
{
|
{
|
||||||
LOG_FUNC_ONE_ARG(pResource);
|
LOG_FUNC_ONE_ARG(pResource);
|
||||||
|
|
||||||
if (DestroyResource_Common(pResource)) {
|
// Release the host copy (if it exists!)
|
||||||
// Call the Xbox version of DestroyResource
|
FreeHostResource(GetHostResourceKey(pResource));
|
||||||
XB_TRMP(D3D_DestroyResource)(pResource);
|
|
||||||
}
|
// Call the Xbox version of DestroyResource
|
||||||
|
XB_TRMP(D3D_DestroyResource)(pResource);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
|
@ -8793,12 +8756,13 @@ void WINAPI xbox::EMUPATCH(D3D_DestroyResource__LTCG)()
|
||||||
mov pResource, edi
|
mov pResource, edi
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DestroyResource_Common(pResource)) {
|
// Release the host copy (if it exists!)
|
||||||
// Call the Xbox version of DestroyResource
|
FreeHostResource(GetHostResourceKey(pResource));
|
||||||
__asm {
|
|
||||||
mov edi, pResource
|
// Call the Xbox version of DestroyResource
|
||||||
call XB_TRMP(D3D_DestroyResource__LTCG)
|
__asm {
|
||||||
}
|
mov edi, pResource
|
||||||
|
call XB_TRMP(D3D_DestroyResource__LTCG)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue