summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Iglesias Gonsálvez <[email protected]>2016-05-26 07:56:38 +0200
committerEmil Velikov <[email protected]>2016-06-14 15:48:38 +0100
commit4daa331e25e551d214e0ab20e1987001f5dce1d1 (patch)
tree80d4e9ca1066c719181d405c1cb637c9a02e3f28
parentfc0a469e4cd8b3775b69ec557602013301b7ae59 (diff)
i965/fs: fix FS_OPCODE_CINTERP for unpacked double input varyings
Data starts at suboffet 3 in 32-bit units (12 bytes), so it is not 64-bit aligned and the current implementation fails to read the data properly. Instead, when there is is a double input varying, read it as vector of floats with twice the number of components. Signed-off-by: Samuel Iglesias Gonsálvez <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Cc: "12.0" <[email protected]> (cherry picked from commit cb30727648fea301cfff1647d947bfab540c3bf6)
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index 366d9ffbffb..4b29ee52883 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -1189,7 +1189,18 @@ fs_visitor::emit_general_interpolation(fs_reg *attr, const char *name,
* handed us defined values in only the constant offset
* field of the setup reg.
*/
- for (unsigned int i = 0; i < type->vector_elements; i++) {
+ unsigned vector_elements = type->vector_elements;
+
+ /* Data starts at suboffet 3 in 32-bit units (12 bytes), so it is not
+ * 64-bit aligned and the current implementation fails to read the
+ * data properly. Instead, when there is is a double input varying,
+ * read it as vector of floats with twice the number of components.
+ */
+ if (attr->type == BRW_REGISTER_TYPE_DF) {
+ vector_elements *= 2;
+ attr->type = BRW_REGISTER_TYPE_F;
+ }
+ for (unsigned int i = 0; i < vector_elements; i++) {
struct brw_reg interp = interp_reg(*location, i);
interp = suboffset(interp, 3);
interp.type = attr->type;