glsl/serialize: Update write_program_resource_data() to handle NULL input and output...
authorArcady Goldmints-Orlov <agoldmints@igalia.com>
Thu, 20 Dec 2018 01:12:25 +0000 (02:12 +0100)
committerAlejandro Piñeiro <apinheiro@igalia.com>
Fri, 12 Jul 2019 21:42:41 +0000 (23:42 +0200)
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
src/compiler/glsl/serialize.cpp

index 825e43fdbba759ad079e31912fdb96fc44b174e7..552300f7eaf75664eb01dca53c91e927e38c4a91 100644 (file)
@@ -790,7 +790,11 @@ write_program_resource_data(struct blob *metadata,
       encode_type_to_blob(metadata, var->interface_type);
       encode_type_to_blob(metadata, var->outermost_struct_type);
 
-      blob_write_string(metadata, var->name);
+      if (var->name) {
+         blob_write_string(metadata, var->name);
+      } else {
+         blob_write_string(metadata, "");
+      }
 
       size_t s_var_size, s_var_ptrs;
       get_shader_var_and_pointer_sizes(&s_var_size, &s_var_ptrs, var);