Users have reported that AMD Anti-Lag 2 didn't work. The issue turned out to be the incorrect vendor constant. After this patch the Anti-Lag 2 implementation appears to work perfectly.
This constant is used to check if installed (and currently selected) hardware is of target vendor before making any driver API calls.
The compute shader already takes care of this. This code updates the STBSP histogram which won't be used if the cvar 'gpu_driven_tex_stream' is set.
Added a check for if 'gpu_driven_tex_stream' is set, and if so, we don't run this code to save on CPU load.
Should be unsigned int 16, not 32. Member gets accessed with uint16 instructions. Structure is now alligned correctly with the engine, and its size also matches now.
Only update the stream camera if we aren't GPU driven to save on load in the render thread.
The camera is used to get the correct column from the STBSP file. Though, if we use the GPU feedback driven texture streaming system, it doesn't make sense to burn CPU here since the GPU system doesn't use the camera at all.
This code credits textures based on the STBSP column we are in. However, the GPU driven texture streaming system has its own logic for this. Don't run the STBSP world texture crediting code if the GPU driven system is enabled to save on runtime overhead and possible interference.
Remove structure packing (not needed), and properly lay it out. The material glue class is a wrapper around the actual material struct, which is what has been seperated out in this path.
The material struct also contains more newly reversed members.
Reversed the last used frame (last time the texture was accumulated), and the last time the texture was credited. Also reversed the actual histogram bin fields; in Apex Legends there is a new one for the GPU driven texture streaming system.
Later versions of the game store their cube maps in the RPak as DDS textures now, the engine needs a modification to its texture creation code to support these.
The extra runtime overhead this creates is negligible as all patterns will be searched once, and have their results being cached off. Due to a planned future change, we can't extern it anymore.
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.
The engine has a bug where it would use GPU feedback even when a static precomputed texture streaming database file exists. If we have an STBSP file for the given level or override, load that in and disable GPU feedback so proper use of the static file could be made. Else we load gpu_driven.stbsp which is a dummy to enable the dynamic, GPU based texture streaming system.
This is a dummy file which enables the GPU driven texture streaming system, which loads/drops textures based on GPU feedback rather than a static texture streaming database file.
Class has been reworked to always take the reverve seek amount into account when adding to output size. Previously, we still incremented the output size even when we seeked back and modified data rather than appending to the end.
The manual write size calculation was a design choice as seeking and calling tellp is slow.
The enum has also been slightly reworked by removing the BINARY enumerant, and adding a new mode which allows you to open a stream in read/write mode.
Use static and const where possible, and rename 'segments' to 'slabs' as this represents a huge buffer in which pages are allocated to, and slab fits this name better.
Use an actual static structure array rather than a std::pair, and make sure the array is sized exactly to what we need (there are 62, the rest was also part of the game, but not from the bytesPerPixel array and therefore shouldn't have been copied. Also improved the error message to always show the texture as some paks don't have texture names.
mp_gamemode's development flag added back in commit 3209af9a6c2509e5e6969199f5d9913b0ddb6ed0 as it was being set internally only previously, but we have to run it through cbuf in the following frame when we launch into the new map to allow the engine to apply it to all global states properly, to run it through cbuf the developmentonly flag needs to be removed from the cvar.
- We don't need to call CVEngineServer::LockNetworkStringTables, as CVEngineServer::CreateFakeClient already does this.
- We should never run CVEngineServer::CreateFakeClient() and CServerGameClients::ClientFullyConnect() when we aren't doing this from the server frame thread, or when we are doing it outside the server frame thread while its active. We not wait and help with other jobs until the server frame thread is finished before adding our bot.
- Removed team number check, this is already performed in CClient::SetTeam().
This reverts commit 9939d963efa13332a1b9c2cf0d53bd90bc772ed1. It turns out we actually should check on !g_pServer->IsActive() as we shouldn't restrict on our listen server. Development code heavily relies on this.
This check is meant to drop the restrictions if we are in single player mode, we should however properly check in this by checking the actual game mode rather than if the listen server is running.
No longer needed as of commit 3209af9a6c2509e5e6969199f5d9913b0ddb6ed0. These defaults were for the server browser but this code has now been moved over properly.