From 2d9a3bb093488dba99e61cc9fd4f7768bcec706c Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Wed, 31 May 2023 12:15:02 -0700 Subject: [PATCH] intel/compiler: Fix a fallthrough in components_read() for atomics MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In commit 284f0c9a57e17b14c044c04c7cf9ae77d6694492 I refactored the handling of the data source to just call a helper rather than special casing opcodes with 0 or 2 sources. Unfortunately, I also dropped the "else return 1", creating a fallthrough for all sources other than SURFACE_LOGICAL_SRC_ADDRESS and SURFACE_LOGICAL_SRC_DATA. The case below happened to return the correct value for all cases except SURFACE_LOGICAL_SRC_SURFACE, which has been returning 2 instead of 1 since that commit. Restore the else case. Thanks to Marcin Ślusarz for catching this. Fixes: 284f0c9a57e1 ("intel/compiler: Add an lsc_op_num_data_values() helper") Reviewed-by: Lionel Landwerlin Reviewed-by: Marcin Ślusarz Part-of: --- src/intel/compiler/brw_fs.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/intel/compiler/brw_fs.cpp b/src/intel/compiler/brw_fs.cpp index 92d038a4ea6..7681f32b8ea 100644 --- a/src/intel/compiler/brw_fs.cpp +++ b/src/intel/compiler/brw_fs.cpp @@ -825,6 +825,8 @@ fs_inst::components_read(unsigned i) const /* Surface operation source. */ else if (i == SURFACE_LOGICAL_SRC_DATA) return lsc_op_num_data_values(op); + else + return 1; } case FS_OPCODE_INTERPOLATE_AT_PER_SLOT_OFFSET: return (i == 0 ? 2 : 1);