Cycles: amd opencl compatibility fixes.

This commit is contained in:
Brecht Van Lommel
2011-08-10 14:26:51 +00:00
parent abc601d10e
commit b98ccf6998
5 changed files with 16 additions and 10 deletions

View File

@@ -194,15 +194,15 @@ __device float noise_wave(NodeWaveType wave, float a)
return 0.5f + 0.5f*sin(a);
}
else if(wave == NODE_WAVE_SAW) {
float b = 2*M_PI;
float b = 2.0f*M_PI_F;
int n = (int)(a / b);
a -= n*b;
if(a < 0) a += b;
if(a < 0.0f) a += b;
return a / b;
}
else if(wave == NODE_WAVE_TRI) {
float b = 2*M_PI;
float b = 2.0f*M_PI_F;
float rmax = 1.0f;
return rmax - 2.0f*fabsf(floorf((a*(1.0f/b))+0.5f) - (a*(1.0f/b)));