From fea5b8e5ad5042725cb52d6d37256b9185115502 Mon Sep 17 00:00:00 2001 From: Oscar Blumberg Date: Sat, 26 Jan 2019 16:47:42 +0100 Subject: [PATCH] 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 --- src/intel/compiler/brw_fs_nir.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); -- 2.30.2