v3dv: Fix assert.
authorVinson Lee <vlee@freedesktop.org>
Sat, 23 Jan 2021 02:49:12 +0000 (18:49 -0800)
committerMarge Bot <eric+marge@anholt.net>
Sun, 31 Jan 2021 22:28:53 +0000 (22:28 +0000)
Fix defect reported by Coverity Scan.

Side effect in assertion (ASSERT_SIDE_EFFECT)
assignment_where_comparison_intended: Assignment job->ez_state =
VC5_EZ_DISABLED has a side effect. This code will work differently in a
non-debug build.

Fixes: cec2ed7c80f ("v3dv: fix disabling Early Z for the whole frame")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Alejandro PiƱeiro <apinheiro@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8666>

src/broadcom/vulkan/v3dv_cmd_buffer.c

index 93de64c..e390305 100644 (file)
@@ -3005,7 +3005,7 @@ job_update_ez_state(struct v3dv_job *job,
     * packet, so ez_state must also be VC5_EZ_DISABLED;
     */
    if (job->first_ez_state == VC5_EZ_DISABLED) {
-      assert(job->ez_state = VC5_EZ_DISABLED);
+      assert(job->ez_state == VC5_EZ_DISABLED);
       return;
    }