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

Author: Marek Olšák <[email protected]>
Date:   Sat Mar 20 18:31:11 2010 +0100

r300/compiler: fix assertion failure in the r500-fragprog emission path

---

 .../drivers/dri/r300/compiler/r500_fragprog_emit.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c 
b/src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c
index 710cae7..4e84eef 100644
--- a/src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c
+++ b/src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c
@@ -469,9 +469,8 @@ void r500BuildFragmentProgramHwCode(struct 
r300_fragment_program_compiler *compi
        if (compiler->Base.Error)
                return;
 
-       assert(code->inst_end >= 0);
-
-       if ((code->inst[code->inst_end].inst0 & R500_INST_TYPE_MASK) != 
R500_INST_TYPE_OUT) {
+       if (code->inst_end == -1 ||
+           (code->inst[code->inst_end].inst0 & R500_INST_TYPE_MASK) != 
R500_INST_TYPE_OUT) {
                /* This may happen when dead-code elimination is disabled or
                 * when most of the fragment program logic is leading to a KIL 
*/
                if (code->inst_end >= 511) {

_______________________________________________
mesa-commit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to