Mesa (master): i965/fs: Check for compilation failure and bail before optimizing.

Kenneth Graunke kwg at kemper.freedesktop.org
Sun Jun 19 00:54:24 UTC 2011


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

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Fri Jun 10 16:00:03 2011 -0700

i965/fs: Check for compilation failure and bail before optimizing.

Prior to this patch, it would attempt to optimize and allocate registers
for the program even if it failed to compile.  This seems wasteful.

More importantly, the "message length > 11" failure seems to choke the
instruction scheduler, making it somehow use an undefined value and
segmentation fault.

Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Eric Anholt <eric at anholt.net>

---

 src/mesa/drivers/dri/i965/brw_fs.cpp |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index 8580c78..1cd6739 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -1533,6 +1533,8 @@ fs_visitor::run()
 	 this->result = reg_undef;
 	 ir->accept(this);
       }
+      if (failed)
+	 return false;
 
       emit_fb_writes();
 




More information about the mesa-commit mailing list