Cosmetica-cc / Cosmetica

Custom public cosmetics, Free for everyone. Forever. Ongoing Development is happening at Cosmetica-2, still WIP
https://cosmetica.cc
Apache License 2.0
54 stars 11 forks source link

Inconsistent Custom Texture Uploading Behaviour #4

Closed valoeghese closed 2 years ago

valoeghese commented 2 years ago

The TextureAtlasSprite#upload method, when called, seems to only work about 3/20ths of the time or less on average. Other times it silently fails, or spits out OpenGL errors such as GL_INVALID_VALUE and GL_INVALID_OPERATION.

Observations: The behaviour seemingly is random per game session (resetting caches would provide the same behaviour. only restarting the game changes it). This somewhat resembled what would be expected from a race condition aside from I would expect it to be random every time with a race condition, rather than per game session.

The images are always present and stored in the NativeImage[] successfully enough that an image dump will provide the correct value. Therefore it is the uploading that fails.

Making it generate the baked model every time doesn't change anything. The problem is with uploading.

Helpful Debugging Mechanisms: If you launch the game in a dev environment or with -Dcosmetics.debug=true, you will enable debug mode, in which a config file called debug_settings.json will be created. Various debug settings can be enabled from there, and this file will be read at game launch.

Set your UUID in the dev environment using the vanilla --uuid flag Relevant code is currently in the regional-effects-&-guis branch