From: Alyssa Rosenzweig Date: Tue, 2 Jul 2019 00:41:20 +0000 (-0700) Subject: panfrost/midgard: Implement f2u16 and friends X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d8c084d2ca58710897df3e4cc9468177e791d1e8;p=mesa.git panfrost/midgard: Implement f2u16 and friends Signed-off-by: Alyssa Rosenzweig --- diff --git a/src/gallium/drivers/panfrost/midgard/midgard_compile.c b/src/gallium/drivers/panfrost/midgard/midgard_compile.c index fc17ad2b051..21197efa499 100644 --- a/src/gallium/drivers/panfrost/midgard/midgard_compile.c +++ b/src/gallium/drivers/panfrost/midgard/midgard_compile.c @@ -841,6 +841,11 @@ emit_alu(compiler_context *ctx, nir_alu_instr *instr) ALU_CASE(i2f32, i2f_rtz); ALU_CASE(u2f32, u2f_rtz); + ALU_CASE(f2i16, f2i_rtz); + ALU_CASE(f2u16, f2u_rtz); + ALU_CASE(i2f16, i2f_rtz); + ALU_CASE(u2f16, u2f_rtz); + ALU_CASE(fsin, fsin); ALU_CASE(fcos, fcos); diff --git a/src/gallium/drivers/panfrost/midgard/nir_lower_framebuffer.c b/src/gallium/drivers/panfrost/midgard/nir_lower_framebuffer.c index 5233fbc9280..9a08a4c43bf 100644 --- a/src/gallium/drivers/panfrost/midgard/nir_lower_framebuffer.c +++ b/src/gallium/drivers/panfrost/midgard/nir_lower_framebuffer.c @@ -51,7 +51,7 @@ nir_float_to_native(nir_builder *b, nir_ssa_def *c_float) nir_ssa_def *scaled = nir_fmul_imm(b, nir_fsat(b, degraded), 255.0); /* Next, we type convert */ - nir_ssa_def *converted = nir_u2u8(b, nir_f2u32(b, + nir_ssa_def *converted = nir_u2u8(b, nir_f2u16(b, nir_fround_even(b, scaled))); return converted;