[Mesa-dev] [PATCH 1/2] nir: Avoid making an unused info struct in cloning shaders.

Eric Anholt eric at anholt.net
Thu Oct 27 20:30:23 UTC 2016


We were implictly making one in create, which would get overwritten by
ns->info = s->info below and hang around until nir_sweep() time.
---
 src/compiler/nir/nir_clone.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/compiler/nir/nir_clone.c b/src/compiler/nir/nir_clone.c
index f23fabc70158..9f3bd7ff6baa 100644
--- a/src/compiler/nir/nir_clone.c
+++ b/src/compiler/nir/nir_clone.c
@@ -682,7 +682,7 @@ nir_shader_clone(void *mem_ctx, const nir_shader *s)
    clone_state state;
    init_clone_state(&state, true);
 
-   nir_shader *ns = nir_shader_create(mem_ctx, s->stage, s->options, NULL);
+   nir_shader *ns = nir_shader_create(mem_ctx, s->stage, s->options, s->info);
    state.ns = ns;
 
    clone_var_list(&state, &ns->uniforms, &s->uniforms);
-- 
2.10.1



More information about the mesa-dev mailing list