From 5e0c24ad8437a02c1c62325d1d0e5f39e6684f90 Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Fri, 3 Jan 2025 22:32:37 +0100 Subject: [PATCH] Resource: patch out forced texture streaming disable code If we do not have resident pages, then we can still rely on the GPU driven texture streaming system. However, this code forces the mode to TSM_OPMODE_LEGACY_PICMIP. This is a bug because it contradicts the ability to switch between the dynamic and static systems. Patched the jump from a conditional one to an unconditional one to always skip over this broken code. This also ultimately drops the need for having a dummy STBSP file, and the benefit of not having a dummy STBSP file is that 'hasResidentPages' will be false, which disables the STBSP world texture crediting code, reducing frame times. --- src/resource/patch/r5apex.patch | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/resource/patch/r5apex.patch b/src/resource/patch/r5apex.patch index 0e57d4f2..3221c7ad 100644 --- a/src/resource/patch/r5apex.patch +++ b/src/resource/patch/r5apex.patch @@ -53,6 +53,13 @@ 0x1E3CB6: "xor rax, rax" // NULL RAX instead of mov'ing '0xDEADFEEDDEADFEED' to cache ptr in 'Pak_UpdateModelAsset()' 0x1E3EE2: "xor rax, rax" // NULL RAX instead of mov'ing '0xDEADFEEDDEADFEED' to cache ptr in 'Pak_UpdateAnimRigAsset()' +// If we don't have an STBSP file, the field s_textureStreamMgr.hasResidentPages will be false. But if the texture +// stream manager is initialized and the stream mode is set to default, the code will force the stream mode to disabled. +// However, our engine has a working implementation of the GPU driven texture streaming system, and the correct thing +// to do here is to not force anything, since our SDK will enable the GPU driven texture streaming system if an STBSP +// file wasn't provided for the level. We turn the conditional jump to an unconditional jump here to skip this code. +0x3E0363: "EB 0F" + ///////////////////////////// ///////////////////////////// //// Code defects ////