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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2012-05-28 23:21:13 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2012-05-28 23:21:13 +0400
commit131de4352b9e8f3e4ce77d2d9dc145f5db461aed (patch)
treec796dc4d9697a1122383dea92aab31493e9c0e1a /intern/cycles/util
parentc2be2fd4083845a381c2462a65dc0856dc6efb8e (diff)
Cycles: fixes to make CUDA 4.2 work, compiling gave errors in shadows and
other places, was mainly due to instancing not working, but also found issues in procedural textures. The problem was with --use_fast_math, this seems to now have way lower precision for some operations. Disabled this flag and selectively use fast math functions. Did not find performance regression on GTX 460 after doing this.
Diffstat (limited to 'intern/cycles/util')
-rw-r--r--intern/cycles/util/util_transform.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/intern/cycles/util/util_transform.h b/intern/cycles/util/util_transform.h
index e4897ee6787..b460c4c87a2 100644
--- a/intern/cycles/util/util_transform.h
+++ b/intern/cycles/util/util_transform.h
@@ -61,16 +61,20 @@ __device_inline float3 transform_perspective(const Transform *t, const float3 a)
__device_inline float3 transform_point(const Transform *t, const float3 a)
{
- float4 b = make_float4(a.x, a.y, a.z, 1.0f);
- float3 c = make_float3(dot(t->x, b), dot(t->y, b), dot(t->z, b));
+ float3 c = make_float3(
+ a.x*t->x.x + a.y*t->x.y + a.z*t->x.z + t->x.w,
+ a.x*t->y.x + a.y*t->y.y + a.z*t->y.z + t->y.w,
+ a.x*t->z.x + a.y*t->z.y + a.z*t->z.z + t->z.w);
return c;
}
__device_inline float3 transform_direction(const Transform *t, const float3 a)
{
- float4 b = make_float4(a.x, a.y, a.z, 0.0f);
- float3 c = make_float3(dot(t->x, b), dot(t->y, b), dot(t->z, b));
+ float3 c = make_float3(
+ a.x*t->x.x + a.y*t->x.y + a.z*t->x.z,
+ a.x*t->y.x + a.y*t->y.y + a.z*t->y.z,
+ a.x*t->z.x + a.y*t->z.y + a.z*t->z.z);
return c;
}