diff options
author | marha <marha@users.sourceforge.net> | 2014-04-13 14:24:56 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2014-04-13 14:24:56 +0200 |
commit | d2ad10d03be8e6d4b150bbdf2a28ea3d5a18a2ed (patch) | |
tree | 2a860c9d687826b3cb48facfa21c616e14e69347 /mesalib/src/mesa/program/prog_noise.c | |
parent | edb5b380994125bf33929ef7dc5a3c456dfbe93b (diff) | |
download | vcxsrv-d2ad10d03be8e6d4b150bbdf2a28ea3d5a18a2ed.tar.gz vcxsrv-d2ad10d03be8e6d4b150bbdf2a28ea3d5a18a2ed.tar.bz2 vcxsrv-d2ad10d03be8e6d4b150bbdf2a28ea3d5a18a2ed.zip |
fontconfig libxcb mesa xserver xcb-proto git update 13 Apr 2014
xserver commit 3028ae6c9aa37168e249e0d847b29f8e3efb05b2
libxcb commit 29e419c5840a1eeda3336a0802686ee723dcaab3
libxcb/xcb-proto commit 70fea02b7d90d86e9d3b0dc5b61406bf4c910999
pixman commit 4b76bbfda670f9ede67d0449f3640605e1fc4df0
fontconfig commit f44157c809d280e2a0ce87fb078fc4b278d24a67
mesa commit 936dda08ee6d7b2be2b016bc06780e401088ec13
Diffstat (limited to 'mesalib/src/mesa/program/prog_noise.c')
-rw-r--r-- | mesalib/src/mesa/program/prog_noise.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/mesalib/src/mesa/program/prog_noise.c b/mesalib/src/mesa/program/prog_noise.c index c258c5e2e..ac920c23f 100644 --- a/mesalib/src/mesa/program/prog_noise.c +++ b/mesalib/src/mesa/program/prog_noise.c @@ -257,12 +257,12 @@ _mesa_noise2(GLfloat x, GLfloat y) float y0 = y - Y0; float x1, y1, x2, y2; - int ii, jj; + unsigned int ii, jj; float t0, t1, t2; /* For the 2D case, the simplex shape is an equilateral triangle. */ /* Determine which simplex we are in. */ - int i1, j1; /* Offsets for second (middle) corner of simplex in (i,j) coords */ + unsigned int i1, j1; /* Offsets for second (middle) corner of simplex in (i,j) coords */ if (x0 > y0) { i1 = 1; j1 = 0; @@ -282,8 +282,8 @@ _mesa_noise2(GLfloat x, GLfloat y) y2 = y0 - 1.0f + 2.0f * G2; /* Wrap the integer indices at 256, to avoid indexing perm[] out of bounds */ - ii = i % 256; - jj = j % 256; + ii = i & 0xff; + jj = j & 0xff; /* Calculate the contribution from the three corners */ t0 = 0.5f - x0 * x0 - y0 * y0; @@ -344,13 +344,13 @@ _mesa_noise3(GLfloat x, GLfloat y, GLfloat z) float z0 = z - Z0; float x1, y1, z1, x2, y2, z2, x3, y3, z3; - int ii, jj, kk; + unsigned int ii, jj, kk; float t0, t1, t2, t3; /* For the 3D case, the simplex shape is a slightly irregular tetrahedron. */ /* Determine which simplex we are in. */ - int i1, j1, k1; /* Offsets for second corner of simplex in (i,j,k) coords */ - int i2, j2, k2; /* Offsets for third corner of simplex in (i,j,k) coords */ + unsigned int i1, j1, k1; /* Offsets for second corner of simplex in (i,j,k) coords */ + unsigned int i2, j2, k2; /* Offsets for third corner of simplex in (i,j,k) coords */ /* This code would benefit from a backport from the GLSL version! */ if (x0 >= y0) { @@ -423,9 +423,9 @@ _mesa_noise3(GLfloat x, GLfloat y, GLfloat z) z3 = z0 - 1.0f + 3.0f * G3; /* Wrap the integer indices at 256 to avoid indexing perm[] out of bounds */ - ii = i % 256; - jj = j % 256; - kk = k % 256; + ii = i & 0xff; + jj = j & 0xff; + kk = k & 0xff; /* Calculate the contribution from the four corners */ t0 = 0.6f - x0 * x0 - y0 * y0 - z0 * z0; @@ -522,12 +522,12 @@ _mesa_noise4(GLfloat x, GLfloat y, GLfloat z, GLfloat w) int c6 = (z0 > w0) ? 1 : 0; int c = c1 + c2 + c3 + c4 + c5 + c6; - int i1, j1, k1, l1; /* The integer offsets for the second simplex corner */ - int i2, j2, k2, l2; /* The integer offsets for the third simplex corner */ - int i3, j3, k3, l3; /* The integer offsets for the fourth simplex corner */ + unsigned int i1, j1, k1, l1; /* The integer offsets for the second simplex corner */ + unsigned int i2, j2, k2, l2; /* The integer offsets for the third simplex corner */ + unsigned int i3, j3, k3, l3; /* The integer offsets for the fourth simplex corner */ float x1, y1, z1, w1, x2, y2, z2, w2, x3, y3, z3, w3, x4, y4, z4, w4; - int ii, jj, kk, ll; + unsigned int ii, jj, kk, ll; float t0, t1, t2, t3, t4; /* @@ -573,10 +573,10 @@ _mesa_noise4(GLfloat x, GLfloat y, GLfloat z, GLfloat w) w4 = w0 - 1.0f + 4.0f * G4; /* Wrap the integer indices at 256, to avoid indexing perm[] out of bounds */ - ii = i % 256; - jj = j % 256; - kk = k % 256; - ll = l % 256; + ii = i & 0xff; + jj = j & 0xff; + kk = k & 0xff; + ll = l & 0xff; /* Calculate the contribution from the five corners */ t0 = 0.6f - x0 * x0 - y0 * y0 - z0 * z0 - w0 * w0; |