From: Oscar Blumberg Date: Sat, 26 Jan 2019 15:47:42 +0000 (+0100) Subject: intel/fs: Fix memory corruption when compiling a CS X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fea5b8e5ad5042725cb52d6d37256b9185115502;p=mesa.git intel/fs: Fix memory corruption when compiling a CS Missing check for shader stage in the fs_visitor would corrupt the cs_prog_data.push information and trigger crashes / corruption later when uploading the CS state. Reviewed-by: Kenneth Graunke --- diff --git a/src/intel/compiler/brw_fs_nir.cpp b/src/intel/compiler/brw_fs_nir.cpp index f16627b8a64..9012fe11d44 100644 --- a/src/intel/compiler/brw_fs_nir.cpp +++ b/src/intel/compiler/brw_fs_nir.cpp @@ -3782,7 +3782,8 @@ fs_visitor::nir_emit_intrinsic(const fs_builder &bld, nir_intrinsic_instr *instr const fs_reg data = retype(get_nir_src(instr->src[2]), BRW_REGISTER_TYPE_UD); - brw_wm_prog_data(prog_data)->has_side_effects = true; + if (stage == MESA_SHADER_FRAGMENT) + brw_wm_prog_data(prog_data)->has_side_effects = true; emit_untyped_write(bld, image, addr, data, 1, instr->num_components);