nir: Properly preserve metadata in more cases

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5171>
This commit is contained in:
Jason Ekstrand
2020-05-21 22:34:37 -05:00
committed by Marge Bot
parent 5e1c42d85f
commit 2b676b2ce8
11 changed files with 78 additions and 22 deletions

View File

@@ -913,8 +913,10 @@ nir_algebraic_impl(nir_function_impl *impl,
* anything other than constants and ALU instructions.
*/
struct util_dynarray states = {0};
if (!util_dynarray_resize(&states, uint16_t, impl->ssa_alloc))
if (!util_dynarray_resize(&states, uint16_t, impl->ssa_alloc)) {
nir_metadata_preserve(impl, nir_metadata_all);
return false;
}
memset(states.data, 0, states.size);
struct hash_table *range_ht = _mesa_pointer_hash_table_create(NULL);