skia2/include
Brian Osman ed58e004e0 Add support for pre-compiling cached SkSL shaders
The client can do a test run of their application with
a persistent cache set to SkSL mode. They store the key
and data blobs that are produced.

Ship those blobs with the application. At startup, call
GrContext::precompileShader for each key/data pair. This
compiles the shaders, and stores the GL program ID, plus
a small amount of metadata in our runtime program cache.

Caveats:
* Currently only implemented for the GL backend. Other
  backends will require more metadata to do any useful
  amount of work. Metal may need a more drastic workflow
  change, involving offline compilation of the shaders.
* Currently only implemented for cached SkSL (not GLSL
  or program binaries). Supporting other formats again
  requires more metadata, and the cached shaders become
  increasingly specialized to GPU and driver versions.
* Reusing the cached SkSL on different hardware is not
  supported. Many driver workarounds are implemented in
  the SkSL -> GLSL transformation, but some are higher
  level. Limiting device variance by artificially hiding
  extensions may help, but there are no guarantees.

* The 'gltestprecompile' DM config exercises this code
  similarly to 'gltestpersistentcache', ensuring that
  results are visually identical when precompiling, and
  that no cache misses occur after precompiling.

Change-Id: Id314c5d5f5a58fe503a0505a613bd4a540cc3589
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239438
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-09-06 19:45:09 +00:00
..
android rewrite includes to not need so much -Ifoo 2019-04-24 16:27:11 +00:00
atlastext rewrite includes to not need so much -Ifoo 2019-04-24 16:27:11 +00:00
c Small fixes to C API. Add SK_API and fix function signature mismatch. 2019-06-07 01:29:23 +00:00
codec Hook up SkHeifCodec for ImageDecoder animation 2019-08-14 16:02:32 +00:00
config update SkUserConfig.h a bit 2019-05-20 17:52:22 +00:00
core Add kRG_88_SkColorType 2019-09-06 17:55:26 +00:00
docs rewrite includes to not need so much -Ifoo 2019-04-24 16:27:11 +00:00
effects Fix GMs broken during API porting 2019-08-05 14:53:45 +00:00
encode Revert "add runtime registration for encoders" 2019-05-15 22:02:39 +00:00
gpu Add support for pre-compiling cached SkSL shaders 2019-09-06 19:45:09 +00:00
pathops rewrite includes to not need so much -Ifoo 2019-04-24 16:27:11 +00:00
ports Change GrCFResource to sk_cf_obj and move to include/ports. 2019-06-10 18:44:28 +00:00
private Add kRG_88_SkColorType 2019-09-06 17:55:26 +00:00
svg [svgcanvas] Add flag to suppress newlines and tabs in XML 2019-08-21 20:17:37 +00:00
third_party Roll skia/third_party/skcms 668026c511f3..853f66269c16 (2 commits) 2019-05-02 20:33:17 +00:00
utils Add Color4f variant for DrawEdgeAAQuad 2019-08-27 23:22:32 +00:00