[Mesa-dev] [PATCH 36/59] i965/fs: fix assign_constant_locations() for doubles

Samuel Iglesias Gonsálvez siglesias at igalia.com
Fri Apr 29 11:29:33 UTC 2016


From: Connor Abbott <connor.w.abbott at intel.com>

Uniform doubles will read two registers, in which case we need to mark
both as being live.
---
 src/mesa/drivers/dri/i965/brw_fs.cpp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index 90c1e93..ac170d5 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -2045,8 +2045,10 @@ fs_visitor::assign_constant_locations()
             }
             is_live[last] = true;
          } else {
-            if (constant_nr >= 0 && constant_nr < (int) uniforms)
-               is_live[constant_nr] = true;
+            if (constant_nr >= 0 && constant_nr < (int) uniforms) {
+               for (int j = 0; j < inst->regs_read(i); j++)
+                  is_live[constant_nr + j] = true;
+            }
          }
       }
    }
-- 
2.5.0



More information about the mesa-dev mailing list