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

Timothy Arceri timothy.arceri at collabora.com
Mon Oct 3 06:04:23 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              | 3 ++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/compiler/glsl/link_uniforms.cpp b/src/compiler/glsl/link_uniforms.cpp
index b3c3c5a..c9bb6ad 100644
--- a/src/compiler/glsl/link_uniforms.cpp
+++ b/src/compiler/glsl/link_uniforms.cpp
@@ -1215,6 +1215,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->NumUniformDataSlots = num_data_slots;
+   prog->UniformDataSlots = data;
+
    link_set_uniform_initializers(prog, boolean_true);
 }
 
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index b279fc4..e62b23f 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -2833,7 +2833,8 @@ struct gl_shader_program
    unsigned NumUniformStorage;
    unsigned NumHiddenUniforms;
    struct gl_uniform_storage *UniformStorage;
-
+   unsigned NumUniformDataSlots;
+   union gl_constant_value *UniformDataSlots;
    /**
     * Mapping from GL uniform locations returned by \c glUniformLocation to
     * UniformStorage entries. Arrays will have multiple contiguous slots
-- 
2.7.4



More information about the mesa-dev mailing list