Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Dinges <blender@dingto.org>2014-06-13 23:13:18 +0400
committerThomas Dinges <blender@dingto.org>2014-06-13 23:59:12 +0400
commitcd5e1ff74e4f6443f3e4b836dd23fe46b56cb7ed (patch)
tree578ee132eab87d348147e49c91e1929660558c20 /intern/cycles/render
parentd0573ce9054e325c0ad2fbb943087e0f8b9e159a (diff)
Cycles Refactor: Add SSE Utility code from Embree for cleaner SSE code.
This makes the code a bit easier to understand, and might come in handy if we want to reuse more Embree code. Differential Revision: https://developer.blender.org/D482 Code by Brecht, with fixes by Lockal, Sergey and myself.
Diffstat (limited to 'intern/cycles/render')
-rw-r--r--intern/cycles/render/curves.cpp16
-rw-r--r--intern/cycles/render/tile.cpp2
2 files changed, 10 insertions, 8 deletions
diff --git a/intern/cycles/render/curves.cpp b/intern/cycles/render/curves.cpp
index 2c96ffa655e..dc7665fe144 100644
--- a/intern/cycles/render/curves.cpp
+++ b/intern/cycles/render/curves.cpp
@@ -46,8 +46,9 @@ void curvebounds(float *lower, float *upper, float3 *p, int dim)
float discroot = curve_coef[2] * curve_coef[2] - 3 * curve_coef[3] * curve_coef[1];
float ta = -1.0f;
float tb = -1.0f;
+
if(discroot >= 0) {
- discroot = sqrt(discroot);
+ discroot = sqrtf(discroot);
ta = (-curve_coef[2] - discroot) / (3 * curve_coef[3]);
tb = (-curve_coef[2] + discroot) / (3 * curve_coef[3]);
ta = (ta > 1.0f || ta < 0.0f) ? -1.0f : ta;
@@ -56,20 +57,21 @@ void curvebounds(float *lower, float *upper, float3 *p, int dim)
*upper = max(p1[dim],p2[dim]);
*lower = min(p1[dim],p2[dim]);
+
float exa = p1[dim];
float exb = p2[dim];
- float t2;
- float t3;
+
if(ta >= 0.0f) {
- t2 = ta * ta;
- t3 = t2 * ta;
+ float t2 = ta * ta;
+ float t3 = t2 * ta;
exa = curve_coef[3] * t3 + curve_coef[2] * t2 + curve_coef[1] * ta + curve_coef[0];
}
if(tb >= 0.0f) {
- t2 = tb * tb;
- t3 = t2 * tb;
+ float t2 = tb * tb;
+ float t3 = t2 * tb;
exb = curve_coef[3] * t3 + curve_coef[2] * t2 + curve_coef[1] * tb + curve_coef[0];
}
+
*upper = max(*upper, max(exa,exb));
*lower = min(*lower, min(exa,exb));
}
diff --git a/intern/cycles/render/tile.cpp b/intern/cycles/render/tile.cpp
index 72bcdf966b5..d6094a4fa0a 100644
--- a/intern/cycles/render/tile.cpp
+++ b/intern/cycles/render/tile.cpp
@@ -202,7 +202,7 @@ list<Tile>::iterator TileManager::next_background_tile(int device, TileOrder til
case TILE_CENTER:
distx = centx - (cur_tile.x + cur_tile.w);
disty = centy - (cur_tile.y + cur_tile.h);
- distx = (int64_t) sqrt((double)distx * distx + disty * disty);
+ distx = (int64_t)sqrt((double)(distx * distx + disty * disty));
break;
case TILE_RIGHT_TO_LEFT:
distx = cordx - cur_tile.x;