[Mesa-dev] [PATCH 35/77] glsl: cache some more image metadata

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


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

diff --git a/src/compiler/glsl/shader_cache.cpp b/src/compiler/glsl/shader_cache.cpp
index ddf0c5d..3e2e2f1 100644
--- a/src/compiler/glsl/shader_cache.cpp
+++ b/src/compiler/glsl/shader_cache.cpp
@@ -990,6 +990,12 @@ write_shader_metadata(struct blob *metadata, gl_linked_shader *shader)
 
       blob_write_uint32(metadata, glprog->ClipDistanceArraySize);
 
+      blob_write_uint32(metadata, shader->NumImages);
+      blob_write_bytes(metadata, shader->ImageAccess,
+                       sizeof(shader->ImageAccess));
+      blob_write_bytes(metadata, shader->ImageUnits,
+                       sizeof(shader->ImageUnits));
+
       if (shader->Stage == MESA_SHADER_FRAGMENT) {
          struct gl_fragment_program *fprog =
             (struct gl_fragment_program *) glprog;
@@ -1034,6 +1040,12 @@ read_shader_metadata(struct blob_reader *metadata,
 
       glprog->ClipDistanceArraySize = blob_read_uint32(metadata);
 
+      linked->NumImages  = blob_read_uint32(metadata);
+      blob_copy_bytes(metadata, (uint8_t *) linked->ImageAccess,
+                      sizeof(linked->ImageAccess));
+      blob_copy_bytes(metadata, (uint8_t *) linked->ImageUnits,
+                      sizeof(linked->ImageUnits));
+
       if (linked->Stage == MESA_SHADER_FRAGMENT) {
          struct gl_fragment_program *fprog =
             (struct gl_fragment_program *) glprog;
-- 
2.7.4



More information about the mesa-dev mailing list