summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas H.P. Andersen <phomes@gmail.com>2021-08-01 12:52:56 +0200
committerDylan Baker <dylan.c.baker@intel.com>2021-11-24 15:47:19 -0800
commit9c7982e44d04202fe35bc29bde4b75f69f0e85d5 (patch)
tree9537609b8ed8d5928c3da86b1b8e8ec5aae03f6c
parent8374d579d034c122279a68f47cbe3be962900303 (diff)
svga: fix bitwise/logical and mixup
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 <zboszor@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12157> (cherry picked from commit 64292c0f05ba891d9c7319e1a1cea98eb0630af4)
-rw-r--r--.pick_status.json2
-rw-r--r--src/gallium/drivers/svga/svga_tgsi_vgpu10.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/.pick_status.json b/.pick_status.json
index 265f31539cd..d3d68393c09 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -247,7 +247,7 @@
"description": "svga: fix bitwise/logical and mixup",
"nominated": true,
"nomination_type": 1,
- "resolution": 0,
+ "resolution": 1,
"main_sha": null,
"because_sha": "ba37d408da30d87b6848d76242d9d797dbef80a0"
},
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) {