summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorSamuel Iglesias Gonsálvez <[email protected]>2015-11-27 12:52:22 +0100
committerSamuel Iglesias Gonsálvez <[email protected]>2016-05-10 11:25:09 +0200
commit03687ab77fea7893f8786ce407d6f4d108b28012 (patch)
treeb05e0f56a74c775efc956174dbbc25bbf601527b /src/mesa
parentc3fab3d00095ed4a5693d5272073298f07dcb9b5 (diff)
i965/fs: demote_pull_constants() did not take into account double types
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 <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index f2bad0d185f..e105f4084fe 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -2231,9 +2231,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,