From: Kenneth Graunke Date: Fri, 9 Nov 2018 05:48:37 +0000 (-0800) Subject: iris: Clone the NIR X-Git-Tag: upstream/19.3.0~9054 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e98cf9c24baa3ebc6b4c7ed478c6a7d2f1dd399d;p=platform%2Fupstream%2Fmesa.git 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. --- diff --git a/src/gallium/drivers/iris/iris_program.c b/src/gallium/drivers/iris/iris_program.c index 626098c..fdb29df 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);