Skip to content

Draft: radv: optimize the shaders disk cache by reducing amount of stored metadata

The shaders disk cache size could be reduced by reducing the metadata info which is radv_shader_info. This data structure is a mess that contains a bunch of shader related info that are used for different things that aren't necessarily needed to be stored in the cache.

It seems the fields could be separated in 3 parts:

  1. fields that are only used to declare shader arguments, eg. uses_grid_size
  2. fields that are used to declare shader arguments and to configure the RSRC registers, eg. uses_block_id
  3. fields that are used to configure the context registers and such, eg. block_size

The approach here is to stop storing fields 1) and 2) that are only useful for compilation. It seems to make sense to store the "post-processed" RSRC1,2,3 registers to the cache instead of relying on radv_shader_info when the driver loads shaders from the cache.

This MR only implements this approach for compute shaders, feedbacks and opinions welcome!

Merge request reports