Choose your operating system:
Windows
macOS
Linux
In order for the Pipeline State Object (PSO) caching system to function correctly, it has to map the requested Shaders to the Materials that requested them. This is accomplished by using the ShaderPipelineCacheTools commandlet to build a file that contains this mapping information. In the following How-To, we will take a look at how to use the ShaderPipelineCacheTools commandlet to build the needed files.
Steps
First, on the root of your C drive, make a new folder called PSOCaching.
Next, open your UE4 project folder to the following location and look for the scl.csv file.
ProjectName\Saved\Cooked\PlatfourmYouCookedFor\ProjectName\Metadata\PipelineCaches
Click for full image.
If you are working with Android, you will need to add the following to your
AndroidEngine.ini
file:[DevOptions.Shaders] NeedsShaderStableKeys=true
If you do not have
NeedsShaderStableKeys
enabled, it will not create thescl.csv
files in metadata needed to generate thestable.csv
file later.Copy the both scl.csv files that are in the Pipeline Caches folder into the PSOCaching folder that was created on the root of your C drive.
Next, copy the rec.upipelinecache file that was generated when the project was run on a target device to the PSOCaching folder that was created on the C drive.
To generate the needed files we will need to use UE4 commandlet function. To use the commandlet function, first open up the Engine\Binaries\Win64 folder and look for the UE4Editor-Cmd.exe file.
Right-click the UE4Editor-Cmd.exe file, and from the displayed list select the Create Shortcut option.
Move the newly created shortcut to the PSOCaching folder that was created on the root of your C drive.
Right-click UE4Editor-Cmd.exe shortcut, and from the displayed menu select the Properties option.
In the Target input, add the following command line parameters after the end of UE4Editor-Cmd.exe.
ActionRPG -run=ShaderPipelineCacheTools expand C:/PSOCaching/*.rec.upipelinecache C:/PSOCaching/*.scl.csv ActionRPG_GLSL_ES3_1_ANDROID.stablepc.csv
Click OK to close the shortcut properties dialogue box and then double-click UE4Editor-Cmd.exe - Shortcut to run the commandlet.
Once the commandlet is finished running, a new file called stablepc.csv is created and placed in the PSOCaching folder that was created on the root of the C drive.
If you are not able to locate this file try checking in the Engine\Binaries\Win64 folder.
End Result
With the scl.csv and the rec.upipelinecache files now combined together to produce the stablepc.csv file, next we need to place the stablepc.csv file in a specific location so that it will be used when your UE4 project is being built..
For more information on where the stablepc.csv files should go, check out the Building A UE4 Project with PSO Caching How - To.