Add the tracker call here too to allow for debugging changes and catching bugs. Remaned the function from TrackDefaultValue to TrackValueChange as its no longer exclusive to the create method.
There is code that checks if the given string is nullptr, and if so, sets it to an empty string (""). But this new pointer wasn't used on InternalSetColorFromString and atof. InternalSetColorFromString calls sscanf on the given string which if null, is undefined behavior.
The bug was also present in the engine code, this has been patched on assembly level and confirmed correct.
Make sure to always return the most recently loaded pak instead of the first hit with provided name. The pak system supports live asset hot swapping so we need to take this into account here.
g_pakGlobals->loadedPakCount counts the total number of paks loaded in the runtime, which can exceed PAK_MAX_LOADED_PAKS, which is the absolute maximum number of live loaded paks. So we would overrun the buffer if we had loaded more than PAK_MAX_LOADED_PAKS (512) paks during the life of the process.
Just go over every pak memory instance and check if it isn't unloaded and then print out its details or perform the unload. We need to go over each slot because we can have a valid handle in slot 4 and slot 480 while having the rest inbetween marked as PAK_STATUS_FREED.
We checked on the wrong far, materialGlue->Get() returns the static instance within the class, and since its always offset with 16 bytes, the address would be 0x10 if materialGlue is nullptr so the check would always be satisfied. Check on materialGlue itself now and only get the static instance if its available.
Most textures in the retail product do not have debug names. A GUID however is still very useful to have. Log the GUID here too.
The CreateShaderResourceView call already logs the GUID along with the texture debug name.
Returns the gamepad type. A confusion was made earlier when this was reverse engineered as this was used to determine the joystick deadzone index. But it is actually the controller type which it uses to index into the deadzone parameters.
For future updates, this allows for customizing the main menu to its full extend without modifying larger ui rpak files as we separate all title screen assets and put it into this new pak.
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.