From: Kenneth Graunke Date: Wed, 30 Dec 2015 00:21:09 +0000 (-0800) Subject: nir/spirv: Implement IsInf and IsNan built-ins. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e6cd0c0e1c7bd9575c723165bce393fd66c0266d;p=mesa.git nir/spirv: Implement IsInf and IsNan built-ins. --- 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: