diff --git a/ispc_texcomp/kernel.ispc b/ispc_texcomp/kernel.ispc index 64e7422..6ecf038 100644 --- a/ispc_texcomp/kernel.ispc +++ b/ispc_texcomp/kernel.ispc @@ -13,7 +13,11 @@ // SOFTWARE. /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +<<<<<<< Updated upstream #ifndef ISPC_UINT_IS_DEFINED +======= +//these are defined in ISPC version 1.13.0 and later +>>>>>>> Stashed changes typedef unsigned int8 uint8; typedef unsigned int32 uint32; typedef unsigned int64 uint64; @@ -22,6 +26,20 @@ typedef unsigned int64 uint64; /////////////////////////// // generic helpers +inline float RCP(float x) +{ + return 1.0f/x; // uses rcp when compiled with --opt=fast-math + //return rcp(x); + //return rcp_fast(x); +} + +inline float RSQRT(float x) +{ + return 1.0f/sqrt(x); // uses rsqrt when compiled with --opt=fast-math + //return rsqrt(x); + //return rsqrt_fast(x); +} + inline void swap_ints(int u[], int v[], uniform int n) { for (uniform int i=0; i 0.9999) scale = 0.9999; - if (scale < 0) scale = 0; + scale = clamp(scale, 0.0f, 0.9999f); // note: clamp also takes care of possible NaNs float sum_zz = 0; float sum_zp[3] = { 0, 0, 0 };