From e98cf9c24baa3ebc6b4c7ed478c6a7d2f1dd399d Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Thu, 8 Nov 2018 21:48:37 -0800 Subject: [PATCH] iris: Clone the NIR The backend compiler used to do this for us, but after a rebase, it's now the driver's responsibility. This lets us alter it for say, clip vertex lowering, at the global level rather than the per-variant level. --- src/gallium/drivers/iris/iris_program.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/gallium/drivers/iris/iris_program.c b/src/gallium/drivers/iris/iris_program.c index 626098c6a7a..fdb29df55d7 100644 --- a/src/gallium/drivers/iris/iris_program.c +++ b/src/gallium/drivers/iris/iris_program.c @@ -471,7 +471,7 @@ iris_compile_vs(struct iris_context *ice, struct brw_vue_prog_data *vue_prog_data = &vs_prog_data->base; struct brw_stage_prog_data *prog_data = &vue_prog_data->base; - nir_shader *nir = ish->nir; + nir_shader *nir = nir_shader_clone(mem_ctx, ish->nir); // XXX: alt mode assign_common_binding_table_offsets(devinfo, nir, prog_data, 0); @@ -607,7 +607,7 @@ iris_compile_tcs(struct iris_context *ice, nir_shader *nir; if (ish) { - nir = ish->nir; + nir = nir_shader_clone(mem_ctx, ish->nir); assign_common_binding_table_offsets(devinfo, nir, prog_data, 0); iris_setup_uniforms(compiler, mem_ctx, nir, prog_data); @@ -684,7 +684,7 @@ iris_compile_tes(struct iris_context *ice, struct brw_vue_prog_data *vue_prog_data = &tes_prog_data->base; struct brw_stage_prog_data *prog_data = &vue_prog_data->base; - nir_shader *nir = ish->nir; + nir_shader *nir = nir_shader_clone(mem_ctx, ish->nir); assign_common_binding_table_offsets(devinfo, nir, prog_data, 0); @@ -755,7 +755,7 @@ iris_compile_gs(struct iris_context *ice, struct brw_vue_prog_data *vue_prog_data = &gs_prog_data->base; struct brw_stage_prog_data *prog_data = &vue_prog_data->base; - nir_shader *nir = ish->nir; + nir_shader *nir = nir_shader_clone(mem_ctx, ish->nir); assign_common_binding_table_offsets(devinfo, nir, prog_data, 0); @@ -830,7 +830,7 @@ iris_compile_fs(struct iris_context *ice, rzalloc(mem_ctx, struct brw_wm_prog_data); struct brw_stage_prog_data *prog_data = &fs_prog_data->base; - nir_shader *nir = ish->nir; + nir_shader *nir = nir_shader_clone(mem_ctx, ish->nir); // XXX: alt mode assign_common_binding_table_offsets(devinfo, nir, prog_data, @@ -1020,7 +1020,7 @@ iris_compile_cs(struct iris_context *ice, rzalloc(mem_ctx, struct brw_cs_prog_data); struct brw_stage_prog_data *prog_data = &cs_prog_data->base; - nir_shader *nir = ish->nir; + nir_shader *nir = nir_shader_clone(mem_ctx, ish->nir); cs_prog_data->binding_table.work_groups_start = 0; assign_common_binding_table_offsets(devinfo, nir, prog_data, 1); -- 2.30.2