[Mesa-dev] [PATCH 1/5/2] i965/fs: Bail out of opt_sampler_eot() if last instruction isn't EOT.

Matt Turner mattst88 at gmail.com
Wed Aug 17 21:12:35 UTC 2016


... instead of assert failing. Can only happen when the program has an
unconditional infinite loop.
---
Sigh.

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

diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index d1ac80a..08e9b6c 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -2511,8 +2511,9 @@ fs_visitor::opt_sampler_eot()
    /* Look for a texturing instruction immediately before the final FB_WRITE. */
    bblock_t *block = cfg->blocks[cfg->num_blocks - 1];
    fs_inst *fb_write = (fs_inst *)block->end();
-   assert(fb_write->eot);
-   assert(fb_write->opcode == FS_OPCODE_FB_WRITE_LOGICAL);
+   if (unlikely(!fb_write->eot) ||
+       unlikely(fb_write->opcode != FS_OPCODE_FB_WRITE_LOGICAL))
+      return false;
 
    /* There wasn't one; nothing to do. */
    if (unlikely(fb_write->prev->is_head_sentinel()))
-- 
2.7.3



More information about the mesa-dev mailing list