[Mesa-dev] [PATCH 62/87] glsl: reserve parameter storage on cache restore

Timothy Arceri timothy.arceri at collabora.com
Wed Jul 13 02:47:57 UTC 2016


Since we know how big the list will be we can allocate the storage
upfront.
---
 src/compiler/glsl/shader_cache.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/compiler/glsl/shader_cache.cpp b/src/compiler/glsl/shader_cache.cpp
index 72e45c1..13b7d27 100644
--- a/src/compiler/glsl/shader_cache.cpp
+++ b/src/compiler/glsl/shader_cache.cpp
@@ -898,6 +898,7 @@ read_shader_parameters(struct blob_reader *metadata,
 
    num_parameters = blob_read_uint32(metadata);
 
+   _mesa_reserve_parameter_storage(params, num_parameters);
    for (i = 0; i < num_parameters; i++) {
 
       type = (gl_register_file) blob_read_uint32(metadata);
-- 
2.7.4



More information about the mesa-dev mailing list