summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorAlejandro Piñeiro <[email protected]>2016-04-21 14:16:18 +0200
committerJuan A. Suarez Romero <[email protected]>2017-01-12 12:56:56 +0100
commit58fdb85f0f413d1a144d4beb6519da59bc52c974 (patch)
tree810b35e9f63d16aa8e2004661f644f0955523fa6 /src/mesa/drivers
parent57bab6708f2bbc1ab8a3d202e9a467963596d462 (diff)
i965/vec4: take into account doubles when creating attribute mapping
Doubles needs more that one slot per attribute. So when filling the attribute_map we check if it is a double in order to allocate one extra register. Signed-off-by: Alejandro Piñeiro <[email protected]> Signed-off-by: Juan A. Suarez Romero <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/i965/brw_vec4.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_vec4.cpp b/src/mesa/drivers/dri/i965/brw_vec4.cpp
index f80162d8203..748a068b142 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4.cpp
@@ -1733,10 +1733,15 @@ vec4_vs_visitor::setup_attributes(int payload_reg)
memset(attribute_map, 0, sizeof(attribute_map));
nr_attributes = 0;
- for (int i = 0; i < VERT_ATTRIB_MAX; i++) {
- if (vs_prog_data->inputs_read & BITFIELD64_BIT(i)) {
- attribute_map[i] = payload_reg + nr_attributes;
- nr_attributes++;
+ GLbitfield64 vs_inputs = vs_prog_data->inputs_read;
+ while (vs_inputs) {
+ GLuint first = ffsll(vs_inputs) - 1;
+ int needed_slots =
+ (vs_prog_data->double_inputs_read & BITFIELD64_BIT(first)) ? 2 : 1;
+ for (int c = 0; c < needed_slots; c++) {
+ attribute_map[nr_attributes] = payload_reg + nr_attributes;
+ nr_attributes++;
+ vs_inputs &= ~BITFIELD64_BIT(first + c);
}
}