Mesa (main): r600/sfn: Don't use assert to test success of operation

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jul 12 16:54:59 UTC 2022


Module: Mesa
Branch: main
Commit: cf1715e391df0e729aa986aed0ad70f6fa95c797
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=cf1715e391df0e729aa986aed0ad70f6fa95c797

Author: Gert Wollny <gert.wollny at collabora.com>
Date:   Tue Jul 12 18:15:41 2022 +0200

r600/sfn: Don't use assert to test success of operation

With that the actual call will be eliminated if the code is
compiled with NDEBUG.

Fixes: 79ca456b4837b3bc21cf9ef3c03c505c4b4909f6
  r600/sfn: rewrite NIR backend

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6832
Signed-off-by: Gert Wollny <gert.wollny at collabora.com>
Reviewed-by: Filip Gawin <filip at gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17496>

---

 src/gallium/drivers/r600/sfn/sfn_shader.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/r600/sfn/sfn_shader.cpp b/src/gallium/drivers/r600/sfn/sfn_shader.cpp
index 1f6e5dfd4f7..7ee4562ce87 100644
--- a/src/gallium/drivers/r600/sfn/sfn_shader.cpp
+++ b/src/gallium/drivers/r600/sfn/sfn_shader.cpp
@@ -664,8 +664,8 @@ bool Shader::process_if(nir_if *if_stmt)
    }
 
    if (!child_block_empty(if_stmt->else_list)) {
-      assert(emit_control_flow(ControlFlowInstr::cf_else));
-
+      if (!emit_control_flow(ControlFlowInstr::cf_else))
+         return false;
       foreach_list_typed(nir_cf_node, n, node, &if_stmt->else_list)
             if (!process_cf_node(n)) return false;
    }



More information about the mesa-commit mailing list