[Mesa-dev] [PATCH 06/11] nir/constant_folding: support 16-bit constants

Iago Toral Quiroga itoral at igalia.com
Wed Apr 11 07:20:29 UTC 2018


From: Jose Maria Casanova Crespo <jmcasanova at igalia.com>

---
 src/compiler/nir/nir_opt_constant_folding.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/compiler/nir/nir_opt_constant_folding.c b/src/compiler/nir/nir_opt_constant_folding.c
index d6be807b3dc..b63660ea4da 100644
--- a/src/compiler/nir/nir_opt_constant_folding.c
+++ b/src/compiler/nir/nir_opt_constant_folding.c
@@ -78,6 +78,8 @@ constant_fold_alu_instr(nir_alu_instr *instr, void *mem_ctx)
            j++) {
          if (load_const->def.bit_size == 64)
             src[i].u64[j] = load_const->value.u64[instr->src[i].swizzle[j]];
+         else if (load_const->def.bit_size == 16)
+            src[i].u16[j] = load_const->value.u16[instr->src[i].swizzle[j]];
          else
             src[i].u32[j] = load_const->value.u32[instr->src[i].swizzle[j]];
       }
-- 
2.14.1



More information about the mesa-dev mailing list