Skip to content
  • Eric Karl's avatar
    Add zlib compression to memory program cache · d625a73a
    Eric Karl authored
    The memory program cache currently uses quite a lot of memory: Up to 6MB
    on desktop, 2MB on normal Android and 512Kb on low-end Android.
    
    Compressing shader binaries results in a 4-10x decrease in size
    (depending on the driver's binary representation).
    
    Compression adds a measureable performance hit (around 500-1000
    microseconds). But when compared to overall shader compile/link time,
    which is around 6000 to 25000 microseconds, this seems acceptable for
    the memory wins. UMA stats have been added so we can ensure these values
    behave as expected in the wild.
    
    Decompression is fairly cheap (<200 microseconds).
    
    Currently, this feature is only turned on for low-end devices, as
    those are the ones with the most memory pressure. However, if the
    results are good, it might make sense to enable this in general.
    
    Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
    Change-Id: Ie5d389f060504837efc86993811e83af8d630ce8
    Reviewed-on: https://chromium-review.googlesource.com/572546
    
    
    Commit-Queue: Eric Karl <ericrk@chromium.org>
    Reviewed-by: default avatarAntoine Labour <piman@chromium.org>
    Reviewed-by: default avatarLeon Scroggins <scroggo@chromium.org>
    Reviewed-by: default avatarIlya Sherman <isherman@chromium.org>
    Reviewed-by: default avatarZhenyao Mo <zmo@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#491865}
    d625a73a