[Mesa-dev] [PATCH] glsl/cache: save and restore ExternalSamplersUsed
Marek Olšák
maraeo at gmail.com
Sat Jun 30 04:59:03 UTC 2018
From: Marek Olšák <marek.olsak at amd.com>
Shaders that need special code for external samplers were broken if
they were loaded from the cache.
Cc: 18.1 <mesa-stable at lists.freedesktop.org>
---
src/compiler/glsl/serialize.cpp | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/compiler/glsl/serialize.cpp b/src/compiler/glsl/serialize.cpp
index 9c21453f91e..889038fb5e2 100644
--- a/src/compiler/glsl/serialize.cpp
+++ b/src/compiler/glsl/serialize.cpp
@@ -1037,20 +1037,21 @@ write_shader_metadata(struct blob *metadata, gl_linked_shader *shader)
blob_write_bytes(metadata, glprog->TexturesUsed,
sizeof(glprog->TexturesUsed));
blob_write_uint64(metadata, glprog->SamplersUsed);
blob_write_bytes(metadata, glprog->SamplerUnits,
sizeof(glprog->SamplerUnits));
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));
blob_write_bytes(metadata, glprog->sh.ImageUnits,
sizeof(glprog->sh.ImageUnits));
size_t ptr_size = sizeof(GLvoid *);
blob_write_uint32(metadata, glprog->sh.NumBindlessSamplers);
blob_write_uint32(metadata, glprog->sh.HasBoundBindlessSampler);
@@ -1089,20 +1090,21 @@ read_shader_metadata(struct blob_reader *metadata,
blob_copy_bytes(metadata, (uint8_t *) glprog->TexturesUsed,
sizeof(glprog->TexturesUsed));
glprog->SamplersUsed = blob_read_uint64(metadata);
blob_copy_bytes(metadata, (uint8_t *) glprog->SamplerUnits,
sizeof(glprog->SamplerUnits));
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));
blob_copy_bytes(metadata, (uint8_t *) glprog->sh.ImageUnits,
sizeof(glprog->sh.ImageUnits));
size_t ptr_size = sizeof(GLvoid *);
glprog->sh.NumBindlessSamplers = blob_read_uint32(metadata);
glprog->sh.HasBoundBindlessSampler = blob_read_uint32(metadata);
--
2.17.1
More information about the mesa-dev
mailing list