summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2017-08-16 08:43:08 -0700
committerJason Ekstrand <[email protected]>2017-12-04 09:21:09 -0800
commitd74bec1a544e8d2df5e92504bd095a542bb8a4ac (patch)
treefb0edb60d63873c0dfa1134733cbdcab29540e86 /src
parent1ec1ae47f73cc948e05c1a49d55b90887d1fe15b (diff)
spirv: Parent the nir_shader to the builder while building
Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/compiler/spirv/spirv_to_nir.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/compiler/spirv/spirv_to_nir.c b/src/compiler/spirv/spirv_to_nir.c
index b36772caad1..353d99cc613 100644
--- a/src/compiler/spirv/spirv_to_nir.c
+++ b/src/compiler/spirv/spirv_to_nir.c
@@ -3351,7 +3351,7 @@ spirv_to_nir(const uint32_t *words, size_t word_count,
return NULL;
}
- b->shader = nir_shader_create(NULL, stage, nir_options, NULL);
+ b->shader = nir_shader_create(b, stage, nir_options, NULL);
/* Set shader info defaults */
b->shader->info.gs.invocations = 1;
@@ -3390,6 +3390,9 @@ spirv_to_nir(const uint32_t *words, size_t word_count,
nir_function *entry_point = b->entry_point->func->impl->function;
assert(entry_point);
+ /* Unparent the shader from the vtn_builder before we delete the builder */
+ ralloc_steal(NULL, b->shader);
+
ralloc_free(b);
return entry_point;