[Mesa-dev] [PATCH] glsl/cache: save and restore ExternalSamplersUsed
Timothy Arceri
tarceri at itsqueeze.com
Sat Jun 30 05:02:43 UTC 2018
Reviewed-by: Timothy Arceri <tarceri at itsqueeze.com>
On 30/06/18 14:59, Marek Olšák wrote:
> 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);
>
More information about the mesa-dev
mailing list