diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-05-05 00:57:33 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-05-05 00:58:39 +0400 |
commit | ff34c2de64df696317a2dc88fdcce3eb991065b4 (patch) | |
tree | c27c80096caff30f15135ff4aa0e24a7c57104e4 /intern/cycles/kernel/kernel.cpp | |
parent | f7aac45488c40b047235a7fe3f8807409aa5989c (diff) |
Cycles: avoid int->float conversions for pixel lookups
Gives ~3% speedup for image.blend test, and 6% for image heavy file.
Overall speedup in real-world use is likely much less.
Diffstat (limited to 'intern/cycles/kernel/kernel.cpp')
-rw-r--r-- | intern/cycles/kernel/kernel.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/intern/cycles/kernel/kernel.cpp b/intern/cycles/kernel/kernel.cpp index 41cf7a6b66c..173028d50c8 100644 --- a/intern/cycles/kernel/kernel.cpp +++ b/intern/cycles/kernel/kernel.cpp @@ -61,9 +61,7 @@ void kernel_tex_copy(KernelGlobals *kg, const char *name, device_ptr mem, size_t if(tex) { tex->data = (float4*)mem; - tex->width = width; - tex->height = height; - tex->depth = depth; + tex->dimensions_set(width, height, depth); tex->interpolation = interpolation; } } @@ -78,9 +76,7 @@ void kernel_tex_copy(KernelGlobals *kg, const char *name, device_ptr mem, size_t if(tex) { tex->data = (uchar4*)mem; - tex->width = width; - tex->height = height; - tex->depth = depth; + tex->dimensions_set(width, height, depth); tex->interpolation = interpolation; } } |