diff options
author | Timothy Arceri <[email protected]> | 2020-01-28 15:18:14 +1100 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-03-06 23:22:14 +0000 |
commit | b1bc24f826f4d08f22efd26f067621de84a100f0 (patch) | |
tree | cda89ce13eefbcf993974db04b0a47476ab488d1 /src/compiler | |
parent | 576b5ace9e2e90803d1c6b9f1b1728b1e5e8c4ed (diff) |
glsl: dont try to assign uniform storage for uniform blocks
Fixes a crash in some shaders.
Reviewed-by: Alejandro PiƱeiro <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4050>
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/glsl/gl_nir_link_uniforms.c | 6 |
1 files changed, 4 insertions, 2 deletions
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; } } } |