From 94fa449318b507c1bd00927b403fcd095d6b3a61 Mon Sep 17 00:00:00 2001 From: Caio Oliveira Date: Fri, 17 Jan 2025 01:53:44 -0800 Subject: [PATCH] intel/brw: Add missing cases to flags_written() These virtual opcodes will write the whole flag set, either directly (via brw_fill_flag()) or indirectly by using LOAD_LIVE_CHANNELS. Issue was found when analysing a hang that would disappear if the lowering of those opcodes was pulled all the way up right before brw_opt_cmod_propagation (which uses the flags_written). Fixes: 019770f026a ("intel/brw: Add SHADER_OPCODE_VOTE_*") Fixes: 2bd7592b0b0 ("intel/brw: Add SHADER_OPCODE_BALLOT") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12347 Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12479 Reviewed-by: Lionel Landwerlin Part-of: --- src/intel/compiler/brw_fs.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/intel/compiler/brw_fs.cpp b/src/intel/compiler/brw_fs.cpp index 6c7e5dc05c3..8812309b723 100644 --- a/src/intel/compiler/brw_fs.cpp +++ b/src/intel/compiler/brw_fs.cpp @@ -743,7 +743,11 @@ fs_inst::flags_written(const intel_device_info *devinfo) const opcode != BRW_OPCODE_IF && opcode != BRW_OPCODE_WHILE)) { return brw_fs_flag_mask(this, 1); - } else if (opcode == FS_OPCODE_LOAD_LIVE_CHANNELS) { + } else if (opcode == FS_OPCODE_LOAD_LIVE_CHANNELS || + opcode == SHADER_OPCODE_BALLOT || + opcode == SHADER_OPCODE_VOTE_ANY || + opcode == SHADER_OPCODE_VOTE_ALL || + opcode == SHADER_OPCODE_VOTE_EQUAL) { return brw_fs_flag_mask(this, 32); } else { return brw_fs_flag_mask(dst, size_written);