Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[d3d8] Release refs on previous render targets and depth stencils #140

Closed

Conversation

WinterSnowfall
Copy link

@WinterSnowfall WinterSnowfall commented Apr 19, 2023

As you are aware, the added .ref()s in 08e183f regress almost every game that had issues with refcounts and was fixed by #122, namely the 2 BloodRaynes, Blowout and Firestarter.

The D3D8 docs say the following with regards to IDirect3DDevice8::SetRenderTarget:

The device will call AddRef on each non-NULL surface passed to SetRenderTarget. After that the device calls Release on the previously set color buffer.

Doing exactly that fixes all the above problematic games again, so seems to be a good avenue to explore. I am hoping it will also address the regression with MGS2 in way that doesn't crash the game again, but I don't have the game so can't confirm.

@WinterSnowfall
Copy link
Author

... and these refcount leveling releases apparently regress Borderzone, which now crashes on startup. I'm beginning to think I'm either missing something or there's simply no way to please every game at once. Still, as far as the current state of main is concerned, this PR should fix more than it breaks.

@WinterSnowfall
Copy link
Author

We'll sort this out another way, turns out it's not such a great idea to ref() after all.

@WinterSnowfall WinterSnowfall deleted the d8vk-refcount2 branch April 20, 2023 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant