Fix T53365: OpenCL has wrong shading of brick texture

Looks like some weird compiler difference with signed vs unsigned ints.
This commit is contained in:
Mai Lavelle 2017-11-21 00:38:02 -05:00
parent 175e8fdc1e
commit 9325b9bf15
Notes: blender-bot 2024-03-22 15:57:27 +01:00
Referenced by issue #53365, GPU/CPU opencl mixed rendering makes tile artifacts with brick texture.
2 changed files with 4 additions and 4 deletions

View File

@ -19,9 +19,9 @@
/* Brick */
float brick_noise(int n) /* fast integer noise */
float brick_noise(uint n) /* fast integer noise */
{
int nn;
uint nn;
n = (n + 1013) & 2147483647;
n = (n >> 13) ^ n;
nn = (n * (n * n * 60493 + 19990303) + 1376312589) & 2147483647;

View File

@ -18,9 +18,9 @@ CCL_NAMESPACE_BEGIN
/* Brick */
ccl_device_noinline float brick_noise(int n) /* fast integer noise */
ccl_device_noinline float brick_noise(uint n) /* fast integer noise */
{
int nn;
uint nn;
n = (n + 1013) & 0x7fffffff;
n = (n >> 13) ^ n;
nn = (n * (n * n * 60493 + 19990303) + 1376312589) & 0x7fffffff;