forked from bartvdbraak/blender
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:
parent
175e8fdc1e
commit
9325b9bf15
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user