From: Timothy Arceri Date: Tue, 28 Jan 2020 04:18:14 +0000 (+1100) Subject: glsl: dont try to assign uniform storage for uniform blocks X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b1bc24f826f4d08f22efd26f067621de84a100f0;p=mesa.git glsl: dont try to assign uniform storage for uniform blocks Fixes a crash in some shaders. Reviewed-by: Alejandro PiƱeiro Part-of: --- diff --git a/src/compiler/glsl/gl_nir_link_uniforms.c b/src/compiler/glsl/gl_nir_link_uniforms.c index ec0c7afca55..f57d2e9a3da 100644 --- a/src/compiler/glsl/gl_nir_link_uniforms.c +++ b/src/compiler/glsl/gl_nir_link_uniforms.c @@ -132,14 +132,16 @@ nir_setup_uniform_remap_tables(struct gl_context *ctx, unsigned num_slots = glsl_get_component_slots(uniform->type); - uniform->storage = &data[data_pos]; + if (uniform->block_index == -1) + uniform->storage = &data[data_pos]; /* Set remap table entries point to correct gl_uniform_storage. */ for (unsigned j = 0; j < entries; j++) { unsigned element_loc = uniform->remap_location + j; prog->UniformRemapTable[element_loc] = uniform; - data_pos += num_slots; + if (uniform->block_index == -1) + data_pos += num_slots; } } }