src/libANGLE/BlobCache.cpp


Log

Author Commit Date CI Message
Amy Liu 95935176 2021-03-26T17:38:21 Handle the compression of big pipeline cache. Big pipeline cache will cost much time to compress. Regarding the perfomance, handle the compression of big pipeline cache in this way: 1)Return when the pipeline cache data is larger than 10M. 2)Use worker thread to complete compression. Bug: angleproject:4722 Change-Id: I62eb69d8c46729261f0502af01450ec301c258f3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2788169 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Amy Liu 1fb7f648 2021-03-18T16:17:25 Compression of the data from vkGetPipelineCacheData. The size of pipelineCacheData sometimes is greater than 64k which cannot be saved because of the Android blob cache limitation (single cache data size should be < 64k). Implement the compression to store more cache data. Re-land this patch before fixing the performance regression of big pipeline cache. Bug: angleproject:4722 Change-Id: I4bc05a88334c3e7e9e945d1a0877429db1750422 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2771840 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Amy Liu 0ee360de 2021-03-05T06:02:25 Revert "Compression of the data from vkGetPipelineCacheData." This reverts commit cc5083e071e9e0663979c02376e7848c7de11765. Reason for revert: Re-land this patch after fixing the performance regression of big blob cache (discussed in angle issue 4722). Original change's description: > Compression of the data from vkGetPipelineCacheData. > > The size of pipelineCacheData sometimes is greater than > 64k which cannot be saved because of the Android blob cache > limitation (single cache data size should be < 64k). > Implement the compression to store more cache data. > > Bug: angleproject:4722 > Change-Id: I435b086d70d0e6378f1141464ae2bafbe076f193 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2631511 > Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Reviewed-by: Geoff Lang <geofflang@chromium.org> Bug: angleproject:4722 Change-Id: Ie4de10eabf5cd8f0b4748e2c1a4c3ab6b8ea092c No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2739098 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Amy Liu cc5083e0 2021-01-15T10:29:36 Compression of the data from vkGetPipelineCacheData. The size of pipelineCacheData sometimes is greater than 64k which cannot be saved because of the Android blob cache limitation (single cache data size should be < 64k). Implement the compression to store more cache data. Bug: angleproject:4722 Change-Id: I435b086d70d0e6378f1141464ae2bafbe076f193 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2631511 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 62778cb9 2020-09-22T23:10:04 Rename version/commit headers. Prefix the files with angle_ to disambiguate them from other tools. Bug: b/168736059 Change-Id: I7be25ca18fb69d7f2ab71bdf355932865d134954 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2425197 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tim Van Patten b55f0f78 2020-06-02T18:01:24 Compress Program binaries saved in blob cache The Android blob cache has a limit of 2MB, so ANGLE should compress the Program binaries that are saved into it to maximize its effectiveness. ANGLE will gzip the program binaries before being stored in the blob cache and then uncompress them when retrieved. Using gzip, the binaries are compressed to ~25% of their size when running the T-Rex benchmark. Some examples (in bytes): Uncompressed: 20193, Compressed: 4455 Uncompressed: 8767, Compressed: 2369 Uncompressed: 11144, Compressed: 2927 This doesn't appear to affect the T-Rex benchmark since all of the programs are loaded/decompressed as part of the benchmark initialization, and the programs are small enough to all fit in the blob cache without compression. Bug: b/155184635 Test: T-Rex, CQ Change-Id: Ie6a101c32ab5fd49baae1cb7aecdd26a934e15af Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2227529 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Tim Van Patten <timvp@google.com>
Jamie Madill 0df92012 2020-06-03T17:08:43 Rename Platform.h to PlatformMethods.h. "platform.h" is too common a name and causes headers to be included incorrectly. Disambiguate the header using a more specific name. Solves a problem that came up with the GLES 1 tests and the standalone test harness. Bug: angleproject:3162 Change-Id: I88229a2c9407e0db57f5beee44daa11a4075f700 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2229065 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Rafael Cintron 5d01d538 2020-05-12T18:13:52 Resolve Bad Binary Link Failures When ANGLE_PROGRAM_BINARY_LOAD is enabled, Program::loadBinary unconditionally returns angle::Result::Continue to the caller. The caller, gl::Program::link, postpones the resolution of the link until resolveLinkImpl. Unfortunately, resolveLinkImpl is not able to tell whether the link failed because the shader from the developer is bad or because the loaded binary is not compatible with the backend. The former case should fail link. In the latter case, we should fallback to linking the program from the original shader sources. The loaded binary could be read from the on-disk shader cache and be corrupted or serialized with different revision and subsystem id than the currently loaded ANGLE backend. This fix adjusts Program::loadBinary and ProgramD3D::load so that angle::Result::Incomplete is returned to gl::Program::link when the binary is incompatible with the backend. gl::Program:link falls back to compilation from original shader sources. Since no code checks the return value of SizedMRUCache::eraseByKey, modified it to now return void. Bug: chromium:1079497 Change-Id: Id5271d7badad8627563e87859d1c9fdb81de5785 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2197944 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Rafael Cintron <rafael.cintron@microsoft.com>
Shahbaz Youssefi 37d2e606 2019-01-10T12:46:16 Make BlobCache use independent from ANGLE_program_cache_control The decision to enable caching or not was based on the size of the cache as directed by eglProgramCacheResizeANGLE, which is incorrect for applications that only use the ANDROID_blob_cache extension. The new behavior is as follows: - If EGL_CONTEXT_PROGRAM_BINARY_CACHE_ENABLED_ANGLE is specifically requested and set to true, but the size of the cache is 0, caching is disabled for the context. - If EGL_CONTEXT_PROGRAM_BINARY_CACHE_ENABLED_ANGLE is specifically requested and set to false, caching is disabled for the context. - Otherwise, caching is left enabled for the context, although the cache possibly has a size of zero, which effectively disables it. During application execution, if the blob cache callbacks are set, the application cache will be used. Bug: 896406, angleproject:2516 Change-Id: Ic0cabda03fb6bf53994e86e3ede30afc8021d67e Reviewed-on: https://chromium-review.googlesource.com/c/1405708 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill b980c563 2018-11-27T11:34:27 Reformat all cpp and h files. This applies git cl format --full to all ANGLE sources. Bug: angleproject:2986 Change-Id: Ib504e618c1589332a37e97696cdc3515d739308f Reviewed-on: https://chromium-review.googlesource.com/c/1351367 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 996628a4 2018-09-24T16:39:26 Vulkan: Add support for VkPipelineCache The cache is initialized from the application's blob cache and is occasionally written back to it for disk storage. Bug: angleproject:2516 Change-Id: I4cba4b00a7b9641c2983ef07159bc62cd10a5519 Reviewed-on: https://chromium-review.googlesource.com/1241373 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 9137adea 2018-08-27T14:22:37 Add support for EGL_ANDROID_blob_cache The functionality of MemoryProgramCache is divided up in two. BlobCache is now a generic binary cache, which interfaces with the callbacks from EGL_ANDROID_blob_cache. MemoryProgramCache handles program [de]serialization and interacts with BlobCache. Bug: angleproject:2516 Change-Id: Ie4328a2e56a26338e033d84f4e53a1103411937d Reviewed-on: https://chromium-review.googlesource.com/1194285 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>