glsl/cache: save and restore ExternalSamplersUsed
authorMarek Olšák <marek.olsak@amd.com>
Sat, 30 Jun 2018 04:57:08 +0000 (00:57 -0400)
committerMarek Olšák <marek.olsak@amd.com>
Sat, 30 Jun 2018 05:04:16 +0000 (01:04 -0400)
Shaders that need special code for external samplers were broken if
they were loaded from the cache.

Cc: 18.1 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/compiler/glsl/serialize.cpp

index 9c21453f91e9424f37ef6f1432b165331e815126..889038fb5e2a9419fff6eb9ddacb8971da3c9c1d 100644 (file)
@@ -1044,6 +1044,7 @@ write_shader_metadata(struct blob *metadata, gl_linked_shader *shader)
    blob_write_bytes(metadata, glprog->sh.SamplerTargets,
                     sizeof(glprog->sh.SamplerTargets));
    blob_write_uint32(metadata, glprog->ShadowSamplers);
+   blob_write_uint32(metadata, glprog->ExternalSamplersUsed);
 
    blob_write_bytes(metadata, glprog->sh.ImageAccess,
                     sizeof(glprog->sh.ImageAccess));
@@ -1096,6 +1097,7 @@ read_shader_metadata(struct blob_reader *metadata,
    blob_copy_bytes(metadata, (uint8_t *) glprog->sh.SamplerTargets,
                    sizeof(glprog->sh.SamplerTargets));
    glprog->ShadowSamplers = blob_read_uint32(metadata);
+   glprog->ExternalSamplersUsed = blob_read_uint32(metadata);
 
    blob_copy_bytes(metadata, (uint8_t *) glprog->sh.ImageAccess,
                    sizeof(glprog->sh.ImageAccess));