summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIago Toral Quiroga <[email protected]>2016-10-06 10:25:13 +0200
committerSamuel Iglesias Gonsálvez <[email protected]>2017-01-03 11:26:51 +0100
commit5fe8d567d8dadeb2b77addd73762f6bde4acfac2 (patch)
tree1ee69cb49d4f9fe689fb47f1ab698db28281cd9f
parent6a01259d8a13aace16e4f1ce9e09e0e41bd52273 (diff)
i965/vec4: fix attribute setup for doubles
Reviewed-by: Matt Turner <[email protected]>
-rw-r--r--src/mesa/drivers/dri/i965/brw_vec4.cpp21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_vec4.cpp b/src/mesa/drivers/dri/i965/brw_vec4.cpp
index 1a14500b32b..6bc6f48d5b6 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4.cpp
@@ -1660,12 +1660,19 @@ vec4_visitor::dump_instruction(backend_instruction *be_inst, FILE *file)
static inline struct brw_reg
-attribute_to_hw_reg(int attr, bool interleaved)
+attribute_to_hw_reg(int attr, brw_reg_type type, bool interleaved)
{
- if (interleaved)
- return stride(brw_vec4_grf(attr / 2, (attr % 2) * 4), 0, 4, 1);
- else
- return brw_vec8_grf(attr, 0);
+ struct brw_reg reg;
+
+ unsigned width = REG_SIZE / 2 / MAX2(4, type_sz(type));
+ if (interleaved) {
+ reg = stride(brw_vecn_grf(width, attr / 2, (attr % 2) * 4), 0, width, 1);
+ } else {
+ reg = brw_vecn_grf(width, attr, 0);
+ }
+
+ reg.type = type;
+ return reg;
}
@@ -1699,9 +1706,9 @@ vec4_visitor::lower_attributes_to_hw_regs(const int *attribute_map,
*/
assert(grf != 0);
- struct brw_reg reg = attribute_to_hw_reg(grf, interleaved);
+ struct brw_reg reg =
+ attribute_to_hw_reg(grf, inst->src[i].type, interleaved);
reg.swizzle = inst->src[i].swizzle;
- reg.type = inst->src[i].type;
if (inst->src[i].abs)
reg = brw_abs(reg);
if (inst->src[i].negate)