Mesa (glsl2): mesa: Only complain about an infinite loop in a swrast program once.

Eric Anholt anholt at kemper.freedesktop.org
Thu Jul 22 20:13:58 UTC 2010


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

Author: Eric Anholt <eric at anholt.net>
Date:   Thu Jul 22 12:16:11 2010 -0700

mesa: Only complain about an infinite loop in a swrast program once.

Chances are, if one fragment looped badly, others will too, and
debugging output gets overwhelmed by the looping complaints.

---

 src/mesa/shader/prog_execute.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/src/mesa/shader/prog_execute.c b/src/mesa/shader/prog_execute.c
index f85c651..b6da344 100644
--- a/src/mesa/shader/prog_execute.c
+++ b/src/mesa/shader/prog_execute.c
@@ -1788,7 +1788,11 @@ _mesa_execute_program(GLcontext * ctx,
 
       numExec++;
       if (numExec > maxExec) {
-         _mesa_problem(ctx, "Infinite loop detected in fragment program");
+	 static GLboolean reported = GL_FALSE;
+	 if (!reported) {
+	    _mesa_problem(ctx, "Infinite loop detected in fragment program");
+	    reported = GL_TRUE;
+	 }
          return GL_TRUE;
       }
 




More information about the mesa-commit mailing list