diff options
author | Alyssa Rosenzweig <[email protected]> | 2019-07-01 17:41:20 -0700 |
---|---|---|
committer | Alyssa Rosenzweig <[email protected]> | 2019-07-10 06:12:04 -0700 |
commit | d8c084d2ca58710897df3e4cc9468177e791d1e8 (patch) | |
tree | abc30e979e8ddd09e4b4cf9b6b480dd1a58cbc27 | |
parent | 954c6afa3e21a91042d705415a1515f1088bdc96 (diff) |
panfrost/midgard: Implement f2u16 and friends
Signed-off-by: Alyssa Rosenzweig <[email protected]>
-rw-r--r-- | src/gallium/drivers/panfrost/midgard/midgard_compile.c | 5 | ||||
-rw-r--r-- | src/gallium/drivers/panfrost/midgard/nir_lower_framebuffer.c | 2 |
2 files changed, 6 insertions, 1 deletions
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; |