intel/elk: Fix assert with side effect

Fix defect reported by Coverity Scan.

Side effect in assertion (ASSERT_SIDE_EFFECT)
assert_side_effect: Argument ++eot_count of assert() has a side effect.
The containing function might work differently in a non-debug build.

Fixes: ebd6738260 ("intel/elk/chv: Implement WaClearArfDependenciesBeforeEot")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
(cherry picked from commit 83809f06a7)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33113>
This commit is contained in:
Vinson Lee
2025-01-04 22:25:19 -08:00
committed by Dylan Baker
parent 1022c4589c
commit db73e1121d
2 changed files with 3 additions and 2 deletions

View File

@@ -1954,7 +1954,7 @@
"description": "intel/elk: Fix assert with side effect",
"nominated": true,
"nomination_type": 2,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "ebd67382604d0b7bddf2ebd2aa824a272e8e9bb2",
"notes": null

View File

@@ -3387,7 +3387,8 @@ elk_fs_visitor::workaround_source_arf_before_eot()
/* Currently, we always emit only one EOT per program,
* this WA should be updated if it ever changes.
*/
assert(++eot_count == 1);
++eot_count;
assert(eot_count == 1);
const fs_builder ibld(this, block, inst);
const fs_builder ubld = ibld.exec_all().group(1, 0);