[Mesa-dev] [PATCH 1/2] st/shader_cache: add st_{de}serialise_nir_program() helpers

Timothy Arceri tarceri at itsqueeze.com
Tue Feb 13 03:27:29 UTC 2018


These will be used for NIR GL_ARB_get_program_binary support.
---
 src/mesa/state_tracker/st_shader_cache.c | 14 ++++++++++++++
 src/mesa/state_tracker/st_shader_cache.h |  8 ++++++++
 2 files changed, 22 insertions(+)

diff --git a/src/mesa/state_tracker/st_shader_cache.c b/src/mesa/state_tracker/st_shader_cache.c
index 8eccf7c921..6ff404220a 100644
--- a/src/mesa/state_tracker/st_shader_cache.c
+++ b/src/mesa/state_tracker/st_shader_cache.c
@@ -408,3 +408,17 @@ st_deserialise_tgsi_program(struct gl_context *ctx,
 {
    st_deserialise_ir_program(ctx, shProg, prog, false);
 }
+
+void
+st_serialise_nir_program(struct gl_context *ctx, struct gl_program *prog)
+{
+   st_serialise_ir_program(ctx, prog, true);
+}
+
+void
+st_deserialise_nir_program(struct gl_context *ctx,
+                           struct gl_shader_program *shProg,
+                           struct gl_program *prog)
+{
+   st_deserialise_ir_program(ctx, shProg, prog, true);
+}
diff --git a/src/mesa/state_tracker/st_shader_cache.h b/src/mesa/state_tracker/st_shader_cache.h
index 4457047e83..132dac00c0 100644
--- a/src/mesa/state_tracker/st_shader_cache.h
+++ b/src/mesa/state_tracker/st_shader_cache.h
@@ -43,6 +43,14 @@ st_deserialise_tgsi_program(struct gl_context *ctx,
                             struct gl_shader_program *shProg,
                             struct gl_program *prog);
 
+void
+st_serialise_nir_program(struct gl_context *ctx, struct gl_program *prog);
+
+void
+st_deserialise_nir_program(struct gl_context *ctx,
+                           struct gl_shader_program *shProg,
+                           struct gl_program *prog);
+
 bool
 st_load_ir_from_disk_cache(struct gl_context *ctx,
                            struct gl_shader_program *prog,
-- 
2.14.3



More information about the mesa-dev mailing list