From 64292c0f05ba891d9c7319e1a1cea98eb0630af4 Mon Sep 17 00:00:00 2001 From: "Thomas H.P. Andersen" Date: Sun, 1 Aug 2021 12:52:56 +0200 Subject: [PATCH] svga: fix bitwise/logical and mixup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The function need_temp_reg_initialization looks suspecious. It will only ever return true if we get past this if: if (!(emit->info.indirect_files && (1u << TGSI_FILE_TEMPORARY)) ... Using the logical && means the intended initialization done based on the result of this check is not performed. This code was both introduced and altered in MR 5317. ccb4ea5a introduces the function. ba37d408 is a collection of performance improvements and misc fixes. This altered the if from using bitwise to logical and. This commit changes it back to bitwise. Spotted from a compile warning. Fixes: ba37d408da3 ("svga: Performance fixes") Reviewed-by: Zoltán Böszörményi Part-of: --- src/gallium/drivers/svga/svga_tgsi_vgpu10.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/drivers/svga/svga_tgsi_vgpu10.c b/src/gallium/drivers/svga/svga_tgsi_vgpu10.c index 8989a57d2ba..a9435a09838 100644 --- a/src/gallium/drivers/svga/svga_tgsi_vgpu10.c +++ b/src/gallium/drivers/svga/svga_tgsi_vgpu10.c @@ -1450,7 +1450,7 @@ static boolean need_temp_reg_initialization(struct svga_shader_emitter_v10 *emit, unsigned index) { - if (!(emit->info.indirect_files && (1u << TGSI_FILE_TEMPORARY)) + if (!(emit->info.indirect_files & (1u << TGSI_FILE_TEMPORARY)) && emit->current_loop_depth == 0) { if (!emit->temp_map[index].initialized && emit->temp_map[index].index < emit->num_shader_temps) {