[Mesa-dev] [PATCH 33/77] glsl: cache interpolation qualifier for frag shader

Timothy Arceri timothy.arceri at collabora.com
Mon Oct 3 06:04:52 UTC 2016


---
 src/compiler/glsl/shader_cache.cpp | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/src/compiler/glsl/shader_cache.cpp b/src/compiler/glsl/shader_cache.cpp
index 6213d63..1d71068 100644
--- a/src/compiler/glsl/shader_cache.cpp
+++ b/src/compiler/glsl/shader_cache.cpp
@@ -988,6 +988,13 @@ write_shader_metadata(struct blob *metadata, gl_linked_shader *shader)
       blob_write_uint32(metadata, shader->num_samplers);
       blob_write_uint32(metadata, shader->active_samplers);
 
+      if (shader->Stage == MESA_SHADER_FRAGMENT) {
+         struct gl_fragment_program *fprog =
+            (struct gl_fragment_program *) glprog;
+         blob_write_bytes(metadata, fprog->InterpQualifier,
+                          sizeof(fprog->InterpQualifier));
+      }
+
       write_shader_parameters(metadata, glprog->Parameters);
 
    } else {
@@ -1023,6 +1030,13 @@ read_shader_metadata(struct blob_reader *metadata,
       linked->num_samplers = blob_read_uint32(metadata);
       linked->active_samplers = blob_read_uint32(metadata);
 
+      if (linked->Stage == MESA_SHADER_FRAGMENT) {
+         struct gl_fragment_program *fprog =
+            (struct gl_fragment_program *) glprog;
+         blob_copy_bytes(metadata, (uint8_t *) fprog->InterpQualifier,
+                         sizeof(fprog->InterpQualifier));
+      }
+
       glprog->Parameters = _mesa_new_parameter_list();
 
       read_shader_parameters(metadata, glprog->Parameters);
-- 
2.7.4



More information about the mesa-dev mailing list