[Mesa-dev] [PATCH 03/37] glsl: add new uniform fields to be used to restore state from cache

Timothy Arceri t_arceri at yahoo.com.au
Mon Jan 23 23:12:42 UTC 2017


From: Carl Worth <cworth at cworth.org>

Signed-off-by: Timothy Arceri <timothy.arceri at collabora.com>
---
 src/compiler/glsl/link_uniforms.cpp | 4 ++++
 src/mesa/main/mtypes.h              | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/src/compiler/glsl/link_uniforms.cpp b/src/compiler/glsl/link_uniforms.cpp
index a450aa0..8930d26 100644
--- a/src/compiler/glsl/link_uniforms.cpp
+++ b/src/compiler/glsl/link_uniforms.cpp
@@ -1265,6 +1265,10 @@ link_assign_uniform_storage(struct gl_context *ctx,
 
    link_setup_uniform_remap_tables(ctx, prog);
 
+   /* Set shader cache fields */
+   prog->data->NumUniformDataSlots = num_data_slots;
+   prog->data->UniformDataSlots = data;
+
    link_set_uniform_initializers(prog, boolean_true);
 }
 
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index b0a97b3..4ac7531 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -2662,6 +2662,10 @@ struct gl_shader_program_data
    struct gl_active_atomic_buffer *AtomicBuffers;
    unsigned NumAtomicBuffers;
 
+   /* Shader cache variables used during restore */
+   unsigned NumUniformDataSlots;
+   union gl_constant_value *UniformDataSlots;
+
    /** List of all active resources after linking. */
    struct gl_program_resource *ProgramResourceList;
    unsigned NumProgramResourceList;
-- 
2.9.3



More information about the mesa-dev mailing list