From the BDW PRM, Workarounds chapter:

   "DF->f format conversion for Align16 has wrong emask calculation when
    source is immediate."

So detect the case and move the immediate source to a VGRF before we attempt
the conversion.

Notice that Broadwell and later are strictly scalar at the moment though, so
this is not really necessary.
---
 src/mesa/drivers/dri/i965/brw_vec4_nir.cpp | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp 
b/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp
index 94d0161..0170d21 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp
@@ -1077,6 +1077,17 @@ void
 vec4_visitor::emit_double_to_single(dst_reg dst, src_reg src, bool saturate,
                                     brw_reg_type single_type)
 {
+   /* BDW PRM vol 15 - workarounds:
+    * DF->f format conversion for Align16 has wrong emask calculation when
+    * source is immediate.
+    */
+   if (devinfo->gen == 8 && single_type == BRW_REGISTER_TYPE_F &&
+       src.file == BRW_IMMEDIATE_VALUE) {
+      dst_reg fixed_src = dst_reg(this, glsl_type::dvec4_type);
+      emit(MOV(fixed_src, src));
+      src = src_reg(fixed_src);
+   }
+
    dst_reg temp = dst_reg(this, glsl_type::dvec4_type);
    emit(MOV(temp, src));
 
-- 
2.7.4

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to