mirror of
https://github.com/Dingo-Shenanigans/ReSkate.git
synced 2026-10-17 12:57:01 +02:00
Raise the streamed texture limit to 32764, and warn when it is close
The game can stream 20480 textures at once. When a map and its mods need one more, it takes a slot past the end of its table and waits for ever on a byte that is part of a counter: a hang, then a crash in the hang's own report (crash reports of 2026-10-11). The limit is raised to 32764, the most a texture's 16-bit handle can index, before the game makes its texture streaming manager: - The manager is allocated longer (6.0 MB, was 2.3 MB) and its slot table and per-slot floats moved behind its end. Each of the 226 instructions that hold one of those offsets or sizes gets another number; no code is added. Its four fixed lists are pointed at longer storage once the constructor has run. - The renderer keeps a block of floats per slot for each of four layers. Its object grows to match (27 instructions), and the two places that index a layer's block as layer * 20480 become a multiply by the new count, in the same twelve bytes. - Three functions keep 20480 entries on their own stack. Two list filters go through a longer list a stretch at a time, and the sort is given scratch room of its own past that many. Up to 20480 they run as the game wrote them. Every instruction is checked byte for byte first, and nothing is changed if any differs or the manager already exists. An empty texture_limit_stock.txt beside the game leaves the limit as it is. Players are told when they come close: a notice at 90% of the limit in force and an error at 100%, each once until use falls below 80%. The log records each new high in steps of 5%. Also: when a function of the game finds its stack written over, the game ends itself with exit code 0xc0000409 and no crash report. The log now names that function and its callers first. The site table (texture_streaming_sites.inc) is generated from a sweep of the supported build; texture_streaming.h describes the layout. Tested in game below 20480 textures only. Nothing has run above the old limit, where the three stack guards and the longer lists first matter. At 32764 the game still hangs; the notice is the protection.
This commit is contained in:
1 parent
3df1a3cdfc
commit
a83cb83bb4
9 files changed
+785
No files matched your search
@@ -8,6 +8,8 @@
|
||||
#include "Extension/Settings/replay_guard.h"
|
||||
#include "Extension/World/load_error_guard.h"
|
||||
#include "Extension/World/mesh_unload_guard.h"
|
||||
#include "Extension/World/stack_check_report.h"
|
||||
#include "Extension/World/texture_handle_limit.h"
|
||||
#include "Extension/Console/commands.h"
|
||||
#include "Extension/UI/ui_pointer_skip.h"
|
||||
#include "Engine/Game/Build/addresses.h"
|
||||
@@ -319,6 +321,8 @@ extern "C" __declspec(dllexport) BOOL WINAPI DingoSDKDebugInitialize() {
|
||||
(void)dingosdk::replay_guard::install(r.base);
|
||||
(void)dingosdk::mesh_unload_guard::install(r.base);
|
||||
(void)dingosdk::load_error_guard::install(r.base);
|
||||
(void)dingosdk::texture_handle_limit::install(r.base);
|
||||
(void)dingosdk::stack_check_report::install(r.base);
|
||||
dingosdk::console::start_memory_trace_from_environment();
|
||||
const bool fixed_stop_provider = (global_offline_hook && progression_guard_armed) &&
|
||||
dingosdk::prepare_fixed_stop_entitlement_provider(r.base);
|
||||
|
||||
Reference in new issue
Block a user