diff options
Diffstat (limited to 'src/compiler/glsl/shader_cache.cpp')
-rw-r--r-- | src/compiler/glsl/shader_cache.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/compiler/glsl/shader_cache.cpp b/src/compiler/glsl/shader_cache.cpp index 3af14be9a1d..a6e99821842 100644 --- a/src/compiler/glsl/shader_cache.cpp +++ b/src/compiler/glsl/shader_cache.cpp @@ -76,10 +76,9 @@ compile_shaders(struct gl_context *ctx, struct gl_shader_program *prog) { static void get_struct_type_field_and_pointer_sizes(size_t *s_field_size, - size_t *s_field_ptrs, - unsigned num_fields) + size_t *s_field_ptrs) { - *s_field_size = sizeof(glsl_struct_field) * num_fields; + *s_field_size = sizeof(glsl_struct_field); *s_field_ptrs = sizeof(((glsl_struct_field *)0)->type) + sizeof(((glsl_struct_field *)0)->name); @@ -140,8 +139,7 @@ encode_type_to_blob(struct blob *blob, const glsl_type *type) blob_write_uint32(blob, type->length); size_t s_field_size, s_field_ptrs; - get_struct_type_field_and_pointer_sizes(&s_field_size, &s_field_ptrs, - type->length); + get_struct_type_field_and_pointer_sizes(&s_field_size, &s_field_ptrs); for (unsigned i = 0; i < type->length; i++) { encode_type_to_blob(blob, type->fields.structure[i].type); @@ -213,8 +211,7 @@ decode_type_from_blob(struct blob_reader *blob) unsigned num_fields = blob_read_uint32(blob); size_t s_field_size, s_field_ptrs; - get_struct_type_field_and_pointer_sizes(&s_field_size, &s_field_ptrs, - num_fields); + get_struct_type_field_and_pointer_sizes(&s_field_size, &s_field_ptrs); glsl_struct_field *fields = (glsl_struct_field *) malloc(s_field_size * num_fields); |