Increasing r.ShaderPipelineCache.BackgroundBatchSize

Hi,

We’ve been seeing very slow compilation times for our bundled PSOs, on the order of a couple of minutes, processing around 2k shaders in the background at startup. I noticed that the shader compilation batch size, r.ShaderPipelineCache.BackgroundBatchSize, is set to 1 by default, and raising this to 50 significantly reduces the startup time. Wondering why a default value of 1 was chosen (the batch size used in foreground compliation, r.ShaderPipelineCache.BatchSize, does default to 50), and whether changing this will have any adverse effects?

Thanks,

Alistair

Hi Alistair,

I did some digging in the code, and it looks like this car was added a few years back, so the context around this change has been lost. My educated guess is that this car was set at a conservative value to ensure we are not completely choking up our file I/O when loading the PSOs that need to be compiled in the background task at runtime. If you are getting some gains out of increasing the batch size, you should be safe to keep it this way. Please let me know if you have any comments on this.

Cheers,

Tim