From e6cd0c0e1c7bd9575c723165bce393fd66c0266d Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Tue, 29 Dec 2015 16:21:09 -0800 Subject: [PATCH] nir/spirv: Implement IsInf and IsNan built-ins. --- src/glsl/nir/spirv/spirv_to_nir.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/glsl/nir/spirv/spirv_to_nir.c b/src/glsl/nir/spirv/spirv_to_nir.c index b6e38704887..b6f5dd761bb 100644 --- a/src/glsl/nir/spirv/spirv_to_nir.c +++ b/src/glsl/nir/spirv/spirv_to_nir.c @@ -2706,7 +2706,14 @@ vtn_handle_alu(struct vtn_builder *b, SpvOp opcode, unreachable("No NIR equivalent"); case SpvOpIsNan: + val->ssa->def = nir_fne(&b->nb, src[0], src[0]); + return; + case SpvOpIsInf: + val->ssa->def = nir_feq(&b->nb, nir_fabs(&b->nb, src[0]), + nir_imm_float(&b->nb, INFINITY)); + return; + case SpvOpIsFinite: case SpvOpIsNormal: case SpvOpSignBitSet: -- 2.30.2