intel/brw: Fix undefined left shift of negative value in brw_texture_offset
When -fsanitize=shift is used, many instances of the following are produced: src/intel/compiler/brw_fs_nir.cpp:114:30: runtime error: left shift of negative value -1 Reviewed-by: Caio Oliveira <caio.oliveira@intel.com> Reviewed-by: Matt Turner <mattst88@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30333>
This commit is contained in:
@@ -111,7 +111,7 @@ brw_texture_offset(const nir_tex_instr *tex, unsigned src,
|
||||
return false;
|
||||
|
||||
const unsigned shift = 4 * (2 - i);
|
||||
offset_bits |= (offset << shift) & (0xF << shift);
|
||||
offset_bits |= (offset & 0xF) << shift;
|
||||
}
|
||||
|
||||
*offset_bits_out = offset_bits;
|
||||
|
Reference in New Issue
Block a user