aboutsummaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/shader_cache.cpp
diff options
context:
space:
mode:
authorJordan Justen <[email protected]>2018-04-08 17:56:34 -0700
committerJordan Justen <[email protected]>2018-07-09 23:02:28 -0700
commit2a55553be3336d5bc969a7569cccbfab85671153 (patch)
tree65f4f61fada64f2a3dc0927b01ce115e25c29561 /src/compiler/glsl/shader_cache.cpp
parent213491600a09aae15efa128fd6d4c46950fa4b4a (diff)
mesa: Add disk shader cache driver blob callback
Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src/compiler/glsl/shader_cache.cpp')
-rw-r--r--src/compiler/glsl/shader_cache.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/compiler/glsl/shader_cache.cpp b/src/compiler/glsl/shader_cache.cpp
index 042f3a60f5b..31d0aa62966 100644
--- a/src/compiler/glsl/shader_cache.cpp
+++ b/src/compiler/glsl/shader_cache.cpp
@@ -102,6 +102,14 @@ shader_cache_write_program_metadata(struct gl_context *ctx,
struct blob metadata;
blob_init(&metadata);
+ if (ctx->Driver.ShaderCacheSerializeDriverBlob) {
+ for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) {
+ struct gl_linked_shader *sh = prog->_LinkedShaders[i];
+ if (sh)
+ ctx->Driver.ShaderCacheSerializeDriverBlob(ctx, sh->Program);
+ }
+ }
+
serialize_glsl_program(&metadata, ctx, prog);
struct cache_item_metadata cache_item_metadata;