From: Paul Berry <stereotype...@gmail.com>

Fixes an assertion failure when compiling certain shaders that need both
pull constants and register spilling:

brw_eu_emit.c:204: validate_reg: Assertion `execsize >= width' failed.

Reviewed-by: Kenneth Graunke <kenn...@whitecape.org>
---
 src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp | 8 ++++++++
 1 file changed, 8 insertions(+)

Patch contents by Paul; commit message by me.

diff --git a/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp 
b/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp
index e7f11ae..a819ae0 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp
@@ -317,11 +317,19 @@ fs_visitor::choose_spill_reg(struct ra_graph *g)
       for (unsigned int i = 0; i < 3; i++) {
         if (inst->src[i].file == GRF) {
            spill_costs[inst->src[i].reg] += loop_scale;
+
+            if (inst->src[i].smear >= 0) {
+               no_spill[inst->src[i].reg] = true;
+            }
         }
       }
 
       if (inst->dst.file == GRF) {
         spill_costs[inst->dst.reg] += inst->regs_written() * loop_scale;
+
+         if (inst->dst.smear >= 0) {
+            no_spill[inst->dst.reg] = true;
+         }
       }
 
       switch (inst->opcode) {
-- 
1.7.11.4

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to