diff options
Diffstat (limited to 'src/compiler/glsl/shader_cache.cpp')
-rw-r--r-- | src/compiler/glsl/shader_cache.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/compiler/glsl/shader_cache.cpp b/src/compiler/glsl/shader_cache.cpp index 1ad8fdd62a4..8220c85f276 100644 --- a/src/compiler/glsl/shader_cache.cpp +++ b/src/compiler/glsl/shader_cache.cpp @@ -1129,6 +1129,7 @@ write_shader_metadata(struct blob *metadata, gl_linked_shader *shader) { assert(shader->Program); struct gl_program *glprog = shader->Program; + unsigned i; blob_write_bytes(metadata, glprog->TexturesUsed, sizeof(glprog->TexturesUsed)); @@ -1145,6 +1146,13 @@ write_shader_metadata(struct blob *metadata, gl_linked_shader *shader) blob_write_bytes(metadata, glprog->sh.ImageUnits, sizeof(glprog->sh.ImageUnits)); + blob_write_uint32(metadata, glprog->sh.NumBindlessSamplers); + blob_write_uint32(metadata, glprog->sh.HasBoundBindlessSampler); + for (i = 0; i < glprog->sh.NumBindlessSamplers; i++) { + blob_write_bytes(metadata, &glprog->sh.BindlessSamplers[i], + sizeof(struct gl_bindless_sampler)); + } + write_shader_parameters(metadata, glprog->Parameters); } @@ -1153,6 +1161,8 @@ read_shader_metadata(struct blob_reader *metadata, struct gl_program *glprog, gl_linked_shader *linked) { + unsigned i; + blob_copy_bytes(metadata, (uint8_t *) glprog->TexturesUsed, sizeof(glprog->TexturesUsed)); glprog->SamplersUsed = blob_read_uint64(metadata); @@ -1168,6 +1178,19 @@ read_shader_metadata(struct blob_reader *metadata, blob_copy_bytes(metadata, (uint8_t *) glprog->sh.ImageUnits, sizeof(glprog->sh.ImageUnits)); + glprog->sh.NumBindlessSamplers = blob_read_uint32(metadata); + glprog->sh.HasBoundBindlessSampler = blob_read_uint32(metadata); + if (glprog->sh.NumBindlessSamplers > 0) { + glprog->sh.BindlessSamplers = + rzalloc_array(glprog, gl_bindless_sampler, + glprog->sh.NumBindlessSamplers); + + for (i = 0; i < glprog->sh.NumBindlessSamplers; i++) { + blob_copy_bytes(metadata, (uint8_t *) &glprog->sh.BindlessSamplers[i], + sizeof(struct gl_bindless_sampler)); + } + } + glprog->Parameters = _mesa_new_parameter_list(); read_shader_parameters(metadata, glprog->Parameters); } |