diff options
author | Matt Turner <[email protected]> | 2015-11-02 00:25:04 +0000 |
---|---|---|
committer | Matt Turner <[email protected]> | 2015-11-13 11:27:51 -0800 |
commit | 4b0fbebf024e564c195f3ce94e1ce43a3d6442ea (patch) | |
tree | 1a769ea36756bdb78fbd9419d1cc3fd2fa2a5166 /src/mesa/drivers/dri/i965 | |
parent | b99e1fd547035be9a6da5ee1b78b8a853c2ef3e0 (diff) |
i965/fs: Set stride correctly for immediates in fs_reg(brw_reg).
The fs_reg() constructors for immediates set stride to 0, except for
vector-immediates, which set stride to 1. This patch makes the fs_reg
constructor that takes a brw_reg do likewise, so that stride is set
correctly for cases such as fs_reg(brw_imm_v(...)).
The generator asserts that this is true (and presumably it's useful in
some optimization passes?) and the VF fs_reg constructors did this (by
virtue of the fact that it doesn't override what init() does).
In the next commit, calling this constructor with brw_imm_* will generate
an IMM file register rather than a HW_REG, making this change necessary
to avoid breakage with existing uses of brw_imm_v().
Reviewed-by: Emil Velikov <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_fs.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index e8ac1c2eda3..ba42d717914 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -428,6 +428,12 @@ fs_reg::fs_reg(struct brw_reg reg) : this->subreg_offset = 0; this->reladdr = NULL; this->stride = 1; + if (this->file == IMM && + (this->type != BRW_REGISTER_TYPE_V && + this->type != BRW_REGISTER_TYPE_UV && + this->type != BRW_REGISTER_TYPE_VF)) { + this->stride = 0; + } } bool |