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

[MOD: Cry of Fear] Excedding VGUI_MAX_TEXTURES 1024 limits will cause killing server. #1924

Closed
TheKingFireS opened this issue Dec 20, 2024 · 5 comments

Comments

@TheKingFireS
Copy link

Anything that used VGUI, best case is hovering cursor on inventory item icon.

Info:
Patch version: 1.55 (1.2 and 1.0 untested)
Xash3D-FWGS: e751092
OS: Windows 10 x86_64bit
GPU: GTX 1650
Custom renderer: Enabled
Map: Any

@nekonomicon
Copy link
Member

It's knowledge bug, CoF has a big memory leak in inventory code, even 1.6 version.

@TheKingFireS
Copy link
Author

TheKingFireS commented Dec 30, 2024

I have stupid idea, make environment variable named I_WANT_MEMORY_LEAK that allow unlimited amount of VGUI_MAX_TEXTURES instead of limited 1024. Because Goldsrc let vgui memory leak pass without stop, until it crash.

@a1batross
Copy link
Member

It won't help that much because there is MAX_TEXTURES limit in the engine.

@a1batross
Copy link
Member

Well, I made a dead simple deduplicator by taking MD5 from texture data, and then looking up if any of the textures have the same hash. It helps to avoid hitting MAX_TEXTURES limit in the engine and potentially leaking VRAM.

The problem is that we cannot deduplicate the texture IDs we sent to VGUI. We might reallocate the array until some hard limit, and after that the engine will refuse loading any new VGUI textures, thus avoiding Host_Error, potential crash and also letting Cry of Fear leak memory all it wants.

@a1batross
Copy link
Member

a1batross commented Dec 30, 2024

Fixed by d6ebff8

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

No branches or pull requests

3 participants