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

Timothy Arceri timothy.arceri at collabora.com
Tue Nov 29 03:58:02 UTC 2016


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 9f0f73f..9c0387c 100644
--- a/src/compiler/glsl/link_uniforms.cpp
+++ b/src/compiler/glsl/link_uniforms.cpp
@@ -1261,6 +1261,10 @@ link_assign_uniform_storage(struct gl_context *ctx,
 
    link_setup_uniform_remap_tables(ctx, prog, num_explicit_uniform_locs);
 
+   /* 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 783f133..a385279 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -2642,6 +2642,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.7.4



More information about the mesa-dev mailing list