bifrost: Set RTZ rounding mode for f2i conversion
authorChris Forbes <chrisforbes@google.com>
Sat, 4 Jul 2020 22:26:42 +0000 (15:26 -0700)
committerMarge Bot <eric+marge@anholt.net>
Mon, 6 Jul 2020 23:17:16 +0000 (23:17 +0000)
Fixes dEQP-GLES2.functional.shaders.conversions.scalar_to_scalar.float_to_int_fragment

Signed-off-by: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5779>

src/panfrost/bifrost/bifrost_compile.c

index adaf6fa3ea8e90e95b66434eefd60bb05122a8f1..bee11a440bb88c7841aa6cf2b9fa7be2a8d56b10 100644 (file)
@@ -843,6 +843,9 @@ emit_alu(bi_context *ctx, nir_alu_instr *instr)
         case nir_op_ixor:
                 alu.op.bitwise = BI_BITWISE_XOR;
                 break;
+        case nir_op_f2i32:
+                alu.roundmode = BIFROST_RTZ;
+                break;
 
         case nir_op_f2f16:
         case nir_op_i2i16: