glsl: add new uniform fields to be used to restore state from cache
authorCarl Worth <cworth@cworth.org>
Thu, 14 Apr 2016 00:48:19 +0000 (10:48 +1000)
committerTimothy Arceri <t_arceri@yahoo.com.au>
Mon, 30 Jan 2017 22:51:30 +0000 (09:51 +1100)
Signed-off-by: Timothy Arceri <timothy.arceri@collabora.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/compiler/glsl/link_uniforms.cpp
src/mesa/main/mtypes.h

index a450aa03a8cc6617c1e57f4e6ed744390cccb7c3..8930d26a5ca2812e588fd420d1c8357b9c746fe3 100644 (file)
@@ -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);
 }
 
index b0a97b30881570e78ad05bd7e78e3c5d1c287c22..4ac75312d6c1005cb7808e338e8ce619ca946c54 100644 (file)
@@ -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;