[Mesa-dev] [PATCH 1/2] tgsi/scan: fix loop exit point in tgsi_scan_tess_ctrl()

Timothy Arceri tarceri at itsqueeze.com
Fri Dec 14 05:32:46 UTC 2018


This just happened not to crash/assert because all loops have at
least 1 if-statement and due to a second bug we end up matching
the same ENDIF to exit both the iteration over the if-statment
and the loop.

The second bug is fixed in the following patch.

Fixes: 386d165d8d09 ("tgsi/scan: add a new pass that analyzes tess factor writes")
---

No changes in shader-db. Didn't run against piglit.

 src/gallium/auxiliary/tgsi/tgsi_scan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/auxiliary/tgsi/tgsi_scan.c b/src/gallium/auxiliary/tgsi/tgsi_scan.c
index 4ca84902dd..6e2e23822c 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_scan.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_scan.c
@@ -1171,7 +1171,7 @@ tgsi_scan_tess_ctrl(const struct tgsi_token *tokens,
 
       case TGSI_OPCODE_BGNLOOP:
          cond_block_tf_writemask |=
-            get_block_tessfactor_writemask(info, &parse, TGSI_OPCODE_ENDIF);
+            get_block_tessfactor_writemask(info, &parse, TGSI_OPCODE_ENDLOOP);
          continue;
 
       case TGSI_OPCODE_BARRIER:
-- 
2.19.2



More information about the mesa-dev mailing list