summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2016-08-17 14:10:34 -0700
committerMatt Turner <mattst88@gmail.com>2016-08-18 10:19:08 -0700
commitdea08d95c24ea35474b5b2f40539037363b0af41 (patch)
tree80ccb9fd0dc6dc9070d393c1efe6730c5eff5b6b
parentd2e44f88719b366dab7da089f8cb0aa676f12ecc (diff)
i965/fs: Bail out of opt_sampler_eot() if last instruction isn't EOT.
... instead of assert failing. Can only happen when the program has an unconditional infinite loop.
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index d1ac80a78fc..7dd559e222e 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();
+ if (unlikely(fb_write->opcode != FS_OPCODE_FB_WRITE_LOGICAL))
+ return false;
assert(fb_write->eot);
- assert(fb_write->opcode == FS_OPCODE_FB_WRITE_LOGICAL);
/* There wasn't one; nothing to do. */
if (unlikely(fb_write->prev->is_head_sentinel()))