* Use float_to_int() functions in a few more places.
This commit is contained in:
Thomas Dinges 2013-06-09 15:09:15 +00:00
parent b2c81664ae
commit 49115b4dd3
4 changed files with 4 additions and 4 deletions

@ -40,7 +40,7 @@ __device float3 bsdf_diffuse_ramp_get_color(const ShaderClosure *sc, const float
int MAXCOLORS = 8;
float npos = pos * (float)(MAXCOLORS - 1);
int ipos = (int)npos;
int ipos = float_to_int(npos);
if (ipos >= (MAXCOLORS - 1))
return colors[MAXCOLORS - 1];
float offset = npos - (float)ipos;

@ -40,7 +40,7 @@ __device float3 bsdf_phong_ramp_get_color(const ShaderClosure *sc, const float3
int MAXCOLORS = 8;
float npos = pos * (float)(MAXCOLORS - 1);
int ipos = (int)npos;
int ipos = float_to_int(npos);
if (ipos >= (MAXCOLORS - 1))
return colors[MAXCOLORS - 1];
float offset = npos - (float)ipos;

@ -25,7 +25,7 @@ __device void svm_node_convert(ShaderData *sd, float *stack, uint type, uint fro
switch(type) {
case NODE_CONVERT_FI: {
float f = stack_load_float(stack, from);
stack_store_int(stack, to, (int)f);
stack_store_int(stack, to, float_to_int(f));
break;
}
case NODE_CONVERT_FV: {

@ -45,7 +45,7 @@ __device_inline int svm_image_texture_wrap_clamp(int x, int width)
__device_inline float svm_image_texture_frac(float x, int *ix)
{
int i = (int)x - ((x < 0.0f)? 1: 0);
int i = float_to_int(x) - ((x < 0.0f)? 1: 0);
*ix = i;
return x - (float)i;
}