diff --git a/.pick_status.json b/.pick_status.json index ec8dd35ec3b..49bb2593cd1 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -294,7 +294,7 @@ "description": "rusticl/kernel: run opt/lower_memcpy later to fix a crash", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/gallium/frontends/rusticl/core/kernel.rs b/src/gallium/frontends/rusticl/core/kernel.rs index 7a268670bec..ba30c98ed00 100644 --- a/src/gallium/frontends/rusticl/core/kernel.rs +++ b/src/gallium/frontends/rusticl/core/kernel.rs @@ -317,7 +317,7 @@ where res } -fn opt_nir(nir: &mut NirShader, dev: &Device) { +fn opt_nir(nir: &mut NirShader, dev: &Device, has_explicit_types: bool) { let nir_options = unsafe { &*dev .screen @@ -342,7 +342,9 @@ fn opt_nir(nir: &mut NirShader, dev: &Device) { } progress |= nir_pass!(nir, nir_opt_deref); - progress |= nir_pass!(nir, nir_opt_memcpy); + if has_explicit_types { + progress |= nir_pass!(nir, nir_opt_memcpy); + } progress |= nir_pass!(nir, nir_opt_dce); progress |= nir_pass!(nir, nir_opt_undef); progress |= nir_pass!(nir, nir_opt_constant_folding); @@ -452,11 +454,10 @@ fn lower_and_optimize_nir( printf_opts.max_buffer_size = dev.printf_buffer_size() as u32; nir_pass!(nir, nir_lower_printf, &printf_opts); - opt_nir(nir, dev); + opt_nir(nir, dev, false); let mut args = KernelArg::from_spirv_nir(args, nir); let mut internal_args = Vec::new(); - nir_pass!(nir, nir_lower_memcpy); let dv_opts = nir_remove_dead_variables_options { can_remove_var: Some(can_remove_var), @@ -627,7 +628,8 @@ fn lower_and_optimize_nir( Some(glsl_get_cl_type_size_align), ); - opt_nir(nir, dev); + opt_nir(nir, dev, true); + nir_pass!(nir, nir_lower_memcpy); nir_pass!( nir, @@ -656,7 +658,7 @@ fn lower_and_optimize_nir( nir_pass!(nir, nir_lower_convert_alu_types, None); - opt_nir(nir, dev); + opt_nir(nir, dev, true); /* before passing it into drivers, assign locations as drivers might remove nir_variables or * other things we depend on