diff options
author | Timothy Arceri <[email protected]> | 2016-06-08 10:18:33 +1000 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2017-02-17 11:18:43 +1100 |
commit | ed6153012167fc7176a23f23ee4cccce9cbaee4a (patch) | |
tree | 3d588468c2b741009c636986e6426136d65be168 | |
parent | 1183eb487f65cc8f101578866c404026d6b6dfaa (diff) |
glsl: reserve parameter storage on cache restore
Since we know how big the list will be we can allocate the storage
upfront.
Reviewed-by: Nicolai Hähnle <[email protected]>
-rw-r--r-- | src/compiler/glsl/shader_cache.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/compiler/glsl/shader_cache.cpp b/src/compiler/glsl/shader_cache.cpp index 92417e8eb30..d95f136074e 100644 --- a/src/compiler/glsl/shader_cache.cpp +++ b/src/compiler/glsl/shader_cache.cpp @@ -1101,6 +1101,7 @@ read_shader_parameters(struct blob_reader *metadata, uint32_t i = 0; uint32_t num_parameters = blob_read_uint32(metadata); + _mesa_reserve_parameter_storage(params, num_parameters); while (i < num_parameters) { gl_register_file type = (gl_register_file) blob_read_uint32(metadata); const char *name = blob_read_string(metadata); |