From c3122d24318632b124cf6b065b19d5c863537057 Mon Sep 17 00:00:00 2001 From: Arcady Goldmints-Orlov Date: Thu, 29 Nov 2018 15:16:34 +0100 Subject: glsl/serialize: Handle NULL uniform name in write_uniforms() Reviewed-by: Caio Marcelo de Oliveira Filho --- src/compiler/glsl/serialize.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/compiler') diff --git a/src/compiler/glsl/serialize.cpp b/src/compiler/glsl/serialize.cpp index 47e535842fa..825e43fdbba 100644 --- a/src/compiler/glsl/serialize.cpp +++ b/src/compiler/glsl/serialize.cpp @@ -435,7 +435,11 @@ write_uniforms(struct blob *metadata, struct gl_shader_program *prog) for (unsigned i = 0; i < prog->data->NumUniformStorage; i++) { encode_type_to_blob(metadata, prog->data->UniformStorage[i].type); blob_write_uint32(metadata, prog->data->UniformStorage[i].array_elements); - blob_write_string(metadata, prog->data->UniformStorage[i].name); + if (prog->data->UniformStorage[i].name) { + blob_write_string(metadata, prog->data->UniformStorage[i].name); + } else { + blob_write_string(metadata, ""); + } blob_write_uint32(metadata, prog->data->UniformStorage[i].builtin); blob_write_uint32(metadata, prog->data->UniformStorage[i].remap_location); blob_write_uint32(metadata, prog->data->UniformStorage[i].block_index); -- cgit v1.2.3