[Mesa-dev] [PATCH 57/59] i965/fs: demote_pull_constants() did not take into account double types

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


The constants could be double, and it was allocating size for float types
for the destination register of varying pull constant loads.

Then the fs_visitor::validate() will complain.

Signed-off-by: Samuel Iglesias Gonsálvez <siglesias at igalia.com>
---
 src/mesa/drivers/dri/i965/brw_fs.cpp | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index 5aa6ded..059edc6 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -2204,9 +2204,16 @@ fs_visitor::lower_constant_loads()
          if (pull_index == -1)
 	    continue;
 
+         const unsigned index = stage_prog_data->binding_table.pull_constants_start;
+         fs_reg dst;
+
+         if (type_sz(inst->src[i].type) <= 4)
+            dst = vgrf(glsl_type::float_type);
+         else
+            dst = vgrf(glsl_type::double_type);
+
          assert(inst->src[i].stride == 0);
 
-         fs_reg dst = vgrf(glsl_type::float_type);
          const fs_builder ubld = ibld.exec_all().group(8, 0);
          struct brw_reg offset = brw_imm_ud((unsigned)(pull_index * 4) & ~15);
          ubld.emit(FS_OPCODE_UNIFORM_PULL_CONSTANT_LOAD,
-- 
2.5.0



More information about the mesa-dev mailing list