summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_fs_combine_constants.cpp
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2016-02-01 11:14:01 -0800
committerMatt Turner <mattst88@gmail.com>2016-02-04 09:30:58 -0800
commit8c7a42b3e880804e201ee9582a0a73763cdd2a01 (patch)
treebb4a2b5ce8a598df28d9ad84123e3b7ab2d8d771 /src/mesa/drivers/dri/i965/brw_fs_combine_constants.cpp
parent8ec24678ac0f459af4acb4b40a70d7802906e41a (diff)
downloadexternal_mesa3d-8c7a42b3e880804e201ee9582a0a73763cdd2a01.zip
external_mesa3d-8c7a42b3e880804e201ee9582a0a73763cdd2a01.tar.gz
external_mesa3d-8c7a42b3e880804e201ee9582a0a73763cdd2a01.tar.bz2
i965/fs: Allocate single register at a time for constants.
No instruction counts changed, but: total cycles in shared programs: 64834502 -> 64781530 (-0.08%) cycles in affected programs: 16331544 -> 16278572 (-0.32%) helped: 4757 HURT: 4288 GAINED: 66 LOST: 20 I remember trying this when I first wrote the pass, but it wasn't helpful at the time. Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_fs_combine_constants.cpp')
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs_combine_constants.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs_combine_constants.cpp b/src/mesa/drivers/dri/i965/brw_fs_combine_constants.cpp
index 994c699..d7a1456 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_combine_constants.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_combine_constants.cpp
@@ -268,7 +268,7 @@ fs_visitor::opt_combine_constants()
qsort(table.imm, table.len, sizeof(struct imm), compare);
/* Insert MOVs to load the constant values into GRFs. */
- fs_reg reg(VGRF, alloc.allocate(dispatch_width / 8));
+ fs_reg reg(VGRF, alloc.allocate(1));
reg.stride = 0;
for (int i = 0; i < table.len; i++) {
struct imm *imm = &table.imm[i];
@@ -284,8 +284,8 @@ fs_visitor::opt_combine_constants()
imm->subreg_offset = reg.subreg_offset;
reg.subreg_offset += sizeof(float);
- if ((unsigned)reg.subreg_offset == dispatch_width * sizeof(float)) {
- reg.nr = alloc.allocate(dispatch_width / 8);
+ if ((unsigned)reg.subreg_offset == 8 * sizeof(float)) {
+ reg.nr = alloc.allocate(1);
reg.subreg_offset = 0;
}
}