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

Vulkan: Fix double-free in the low-memory fallback. Also, reject too-big textures #18475

Merged
merged 2 commits into from
Dec 4, 2023

Conversation

hrydgard
Copy link
Owner

@hrydgard hrydgard commented Dec 4, 2023

We incorrectly assumed that an "entry" would still be valid after decimate, but it might not be, so let's add an exclusion argument to Decimate.

Also, if a game specifies a texture larger than 512x512 and it's not a remaster, we're probably executing a bogus display list, and just need to try not to crash, in the hopes that the situation can rectify itself.

@hrydgard hrydgard added Vulkan GE emulation Backend-independent GPU issues labels Dec 4, 2023
@hrydgard hrydgard added this to the v1.17.0 milestone Dec 4, 2023
@hrydgard hrydgard merged commit 256d670 into master Dec 4, 2023
18 checks passed
@hrydgard hrydgard deleted the texture-low-mem-fixes branch December 4, 2023 21:04
@@ -2803,6 +2812,14 @@ bool TextureCacheCommon::PrepareBuildTexture(BuildTexturePlan &plan, TexCacheEnt
plan.w = gstate.getTextureWidth(0);
plan.h = gstate.getTextureHeight(0);

if (!g_DoubleTextureCoordinates) {
// Refuse to load invalid-ly sized textures, which can happen through display list corruption.
if (plan.w > 512 || plan.h > 512) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought Tactics Ogre or something accessed a 1024x texture at some point? They have predictable behavior, and work fine as long as you use the top left 512x512 of them. I don't think I've ever seen above 1024 though.

-[Unknown]

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I had to change this to 1024 later, for this reason (was reported in FF III though).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GE emulation Backend-independent GPU issues Vulkan
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants