diff options
author | Samuel Pitoiset <[email protected]> | 2017-05-12 11:35:43 +0200 |
---|---|---|
committer | Samuel Pitoiset <[email protected]> | 2017-06-14 10:04:36 +0200 |
commit | 3a087dd7a4bd5d7e69ea2b79ca0e2004badb073d (patch) | |
tree | 053df2980fa5203cfd9affd5eb5dd1e2a6e28ade /src/compiler/glsl/shader_cache.cpp | |
parent | 9e756de7d19307044c9b4a08b285836fbe128589 (diff) |
glsl: process uniform images declared bindless
Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/compiler/glsl/shader_cache.cpp')
-rw-r--r-- | src/compiler/glsl/shader_cache.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/compiler/glsl/shader_cache.cpp b/src/compiler/glsl/shader_cache.cpp index 8220c85f276..fdeab8e56c6 100644 --- a/src/compiler/glsl/shader_cache.cpp +++ b/src/compiler/glsl/shader_cache.cpp @@ -1153,6 +1153,13 @@ write_shader_metadata(struct blob *metadata, gl_linked_shader *shader) sizeof(struct gl_bindless_sampler)); } + blob_write_uint32(metadata, glprog->sh.NumBindlessImages); + blob_write_uint32(metadata, glprog->sh.HasBoundBindlessImage); + for (i = 0; i < glprog->sh.NumBindlessImages; i++) { + blob_write_bytes(metadata, &glprog->sh.BindlessImages[i], + sizeof(struct gl_bindless_image)); + } + write_shader_parameters(metadata, glprog->Parameters); } @@ -1191,6 +1198,19 @@ read_shader_metadata(struct blob_reader *metadata, } } + glprog->sh.NumBindlessImages = blob_read_uint32(metadata); + glprog->sh.HasBoundBindlessImage = blob_read_uint32(metadata); + if (glprog->sh.NumBindlessImages > 0) { + glprog->sh.BindlessImages = + rzalloc_array(glprog, gl_bindless_image, + glprog->sh.NumBindlessImages); + + for (i = 0; i < glprog->sh.NumBindlessImages; i++) { + blob_copy_bytes(metadata, (uint8_t *) &glprog->sh.BindlessImages[i], + sizeof(struct gl_bindless_image)); + } + } + glprog->Parameters = _mesa_new_parameter_list(); read_shader_parameters(metadata, glprog->Parameters); } |