Mesa (master): r300: add just in case warn I don' t think this can actually happen

Dave Airlie airlied at kemper.freedesktop.org
Sat Aug 15 10:31:04 UTC 2009


Module: Mesa
Branch: master
Commit: 3cc9a28b9b493d2426e2f182fc26b9da847e0c7f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=3cc9a28b9b493d2426e2f182fc26b9da847e0c7f

Author: Dave Airlie <airlied at redhat.com>
Date:   Sat Aug 15 20:30:45 2009 +1000

r300: add just in case warn I don't think this can actually happen

---

 src/mesa/drivers/dri/r300/r300_render.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c
index 8e6b496..4bf09c2 100644
--- a/src/mesa/drivers/dri/r300/r300_render.c
+++ b/src/mesa/drivers/dri/r300/r300_render.c
@@ -380,6 +380,11 @@ void r300RunRenderPrimitive(GLcontext * ctx, int start, int end, int prim)
 				    if (align % 4)
 					nr -= incr;
 				} while(align % 4);
+				if (nr <= 0) {
+					WARN_ONCE("did the impossible happen? we never aligned nr to dword\n");
+					return;
+				}
+					
 			}
 			r300FireEB(rmesa, nr, type, offset);
 




More information about the mesa-commit mailing list