Commit Graph

3492 Commits

Author SHA1 Message Date
Sergey Sharybin
02eda9189b Attempt to fix compilation error on OSX and Windows 2013-08-16 10:29:56 +00:00
Sergey Sharybin
27e558e683 Code cleanup: remove some ifdef code from guardedalloc
Didn't notice all needed functions are in atomic already.
2013-08-16 05:21:40 +00:00
Sergey Sharybin
acebdf02cb Atomic ops are only used in guarded allocator, so move include into ifdef 2013-08-15 12:28:30 +00:00
Sergey Sharybin
7497101277 Code cleanup
And checking whether mail indeed works now.
2013-08-15 12:15:42 +00:00
Sergey Sharybin
1a81197819 Speedup for guarded allocator
- Re-arrange locks, so no actual memory allocation
  (which is relatively slow) happens from inside
  the lock. operation system will take care of locks
  which might be needed there on it's own.

- Use spin lock instead of mutex, since it's just
  list operations happens from inside lock, no need
  in mutex here.

- Use atomic operations for memory in use and total
  used blocks counters.

This makes guarded allocator almost the same speed
as non-guarded one in files from Tube project.

There're still MemHead/MemTail overhead which might
be bad for CPU cache utilization.

TODO: We need smarter 32/64bit compile-time check,
      currently i'm afraid only x86 CPU family is
      detecting reliably.
2013-08-15 12:13:01 +00:00
Sergey Sharybin
5eac3db278 Merging r59136 through r59152 from trunk into soc-2013-depsgraph_mt 2013-08-15 08:23:16 +00:00
Sergey Sharybin
58d7ae891d Blender might be compiled without guardedalloc again
This is useful for benchmark tests, to make CPU cache
utilization as good as we could with current design.
2013-08-15 07:36:56 +00:00
Joerg Mueller
c8f75fb5b1 Adding a new state for sound handles in audaspace: stopped.
Now sounds that stopped playing but are still kept in the device can be differentiated from paused sounds with this state.
This should also fix the performance issues mentioned in [#36466] End of SequencerEntrys not set correctly.
Please test if sound pausing, resuming and stopping works fine in the BGE and sequencer, my tests all worked fine, but there might be a use case that needs some fixing.
2013-08-14 21:21:00 +00:00
Thomas Dinges
2c2206a272 Cycles:
* Remove an unneeded return in shader_bsdf_eval(), function is void. 
* if / else if tweak in shader_bsdf_ao().
2013-08-14 19:38:14 +00:00
Sergey Sharybin
932df91cbd Merging r59113 through r59129 from trunk into soc-2013-depsgraph_mt 2013-08-14 07:08:59 +00:00
Campbell Barton
2f5e10f7b8 include order change for osl, fixes gcc compile error - undefined uintptr_t 2013-08-14 06:51:18 +00:00
Sergey Sharybin
b521d2ada7 Merging r59104 through r59112 from trunk into soc-2013-depsgraph_mt 2013-08-13 15:09:19 +00:00
Thomas Dinges
8cda3264bd Code cleanup:
* Some typo fixes.
2013-08-13 08:43:31 +00:00
Sergey Sharybin
033d395bed Use atomic operations instead of spin lock for threaded update
This replaces code (pseudo-code):

  spin_lock();
  update_child_dag_nodes();
  schedule_new_nodes();
  spin_unlock();

with:

  update_child_dag_nodes_with_atomic_ops();
  schedule_new_nodes();

The reason for this is that scheduling new nodes implies
mutex lock, and having spin around it is a bad idea.

Alternatives could have been to use spinlock around
child nodes update only, but that would either imply having
either per-node spin-lock or using array to put nodes
ready for update to an array.

Didn't like an alternatives, using atomic operations makes
code much easier to follow, keeps data-flow on cpu nice.

Same atomic ops might be used in other performance-critical
areas later.

Using atomic ops implementation from jemalloc project.
2013-08-12 14:37:15 +00:00
Sergey Sharybin
3c9c5b42cb Merging r58778 through r59080 from trunk into soc-2013-depsgraph_mt 2013-08-12 09:35:16 +00:00
Lukas Toenne
795fa1f199 Fix #36437 Cycles no longer rendering Emitter object (Particle Systems). The change r58999 was ignoring the "show_emitter" setting by particles (the result would be the same as long as hair was not
used). If particle emitters are forced to show all other of the usual duplicator hiding should be disabled.
2013-08-12 06:53:17 +00:00
Thomas Dinges
9dfd2823c4 Code cleanup / Cycles:
* Remove unused "PathThroughput" variable.
* Don't compile unused voronoi code, we only use Distance Squared atm. 
* Various typo and comment fixes.
2013-08-11 16:55:24 +00:00
Thomas Dinges
48ae40ccdf Code cleanup / Cycles:
* Rename "curve_kernel_data" to just "curve", to avoid redundant naming.
2013-08-11 15:27:04 +00:00
Thomas Dinges
30f279be26 Code cleanup / Cycles:
* Remove code for the unused Wave texture variations. 

We have quite some unused code in the texture area, I guess it doesn't harm to clean a bit up here. 
We can always get the code back from SVN if we need something.
2013-08-10 00:52:57 +00:00
Thomas Dinges
743a7a4a4b Cycles:
* GPU kernel can now be compiled without __NON_PROGRESSIVE__ again, was broken after my last commit. Also add a check for have_error(), in case the GPU kernel comes without Non-Progressive, to avoid a crash.

* Don't compile progressive kernel twice on CPU, if __NON_PROGRESSIVE__ would be disabled there.
2013-08-09 20:03:49 +00:00
Brecht Van Lommel
be7b4e26b1 Fix cycles not rendering with 1x1 resolution anymore, not so common for users
but nice for debugging.
2013-08-09 19:55:46 +00:00
Brecht Van Lommel
fd263bf725 Fix cycles passes UI panel to line up better. 2013-08-09 19:55:45 +00:00
Thomas Dinges
a18112249d Cycles / Non-Progressive integrator:
* Non-Progressive integrator is now available on the GPU (CUDA, sm_20 and above). 

Implementation details:
* kernel_path_trace() has been split up into two functions:
kernel_path_trace_non_progressive() and kernel_path_trace_progressive().

* We compile two CUDA kernel entry functions (in kernel.cu) for the two integrators, they are still inside one .cubin file but due to the kernel separation there should be no performance problem. I tested with the BMW file on my Geforce 540M and the render times were the same for 100 samples (1.57 min in my case).

This is part of my GSoC project, SVN merge of r59032 + manual merge of UI changes for this from my branch.
2013-08-09 18:47:25 +00:00
Brecht Van Lommel
9d9c64582b Fix #36355: cycles render of objects with both duplis and hair would not render
the hair in some cases.
2013-08-07 19:02:15 +00:00
Campbell Barton
4f29aeeff2 code cleanup: some structs were declaring data when only typedef's were intended, make local vars and functions static. 2013-08-07 03:44:05 +00:00
Thomas Dinges
da4679f6d8 * Make MSVC happy. 2013-08-06 23:47:47 +00:00
Campbell Barton
d58a385084 minor edits to float/double conversion suggested by DingTo 2013-08-06 23:34:47 +00:00
Campbell Barton
81acaf5f15 quiet double-promotion warnings, change octree.cpp to use a float (vector accumulated into a float anyway) 2013-08-06 06:38:52 +00:00
Campbell Barton
34c64b8ea3 cycles builds with -Wdouble-promotion again. 2013-08-06 06:36:34 +00:00
Campbell Barton
ce2e2b141e use gcc malloc attribute for low level allocation functions, prevents gcc from checking if resulting pointers alias existing pointers, also use sentinel attribute for uiButGetStrInfo so incorrect usage gives a warning. 2013-08-05 20:57:13 +00:00
Brecht Van Lommel
d01fbce3bb Fix #36380: cycles render error with sun lamp that has object scale 0,0,0. 2013-08-05 14:22:07 +00:00
Brecht Van Lommel
3bf175f270 Cycles OSL: image texture lookup optimization, acquire the per thread handle
for texture system in advance. Patch by Martijn Berger, with some tweaks.

There was about a 10% performance improvement on OS X in my tests with the
images.blend test file. This may be less on other platforms because OS X has
particularly slow mutex locks.
2013-08-05 12:49:15 +00:00
Brecht Van Lommel
28f893f23a Fix wrong cycles cmake + msvc build flags with relwithdebinfo and minsizerel.
Patch by Karsten Schwenk.
2013-08-05 12:02:43 +00:00
Thomas Dinges
d06fa3ba2b Code cleanup / Cycles:
* Various string and comment fixes.
2013-08-05 01:24:41 +00:00
Campbell Barton
41721e11fb fix for 2 memory leaks in dualcon library, quite bad since they leaked on every evaluation. 2013-08-04 18:05:29 +00:00
Campbell Barton
35db9c5e70 Support WITH_CXX_GUARDEDALLOC for dualcon library 2013-08-04 17:58:17 +00:00
Thomas Dinges
c26754fe9d Cycles / OpenCL:
* Was broken after Blackbody merge, forgot to rename a struct...
2013-08-04 12:40:46 +00:00
Campbell Barton
a270481239 add missing NULL check in RB_dworld_export if fopen fails. 2013-08-04 04:30:14 +00:00
Campbell Barton
bd89bd9e1c avoid using MEM_reallocN_id directly, add utility macro for freeing. 2013-08-04 03:00:04 +00:00
Thomas Dinges
02ec0b9431 Cycles:
* Forgot to rename some SSS pass strings.
* Some typo fixes.
2013-08-03 21:45:57 +00:00
Campbell Barton
2a8d76d734 add versions of MEM_reallocN, MEM_recallocN which take a string arg so new allocs have an ID, changing existing functions signatures would be too disruptive at the moment. 2013-08-03 17:53:41 +00:00
Thomas Dinges
5fc6f04fc8 Cycles / SSS:
* Render Passes are now available for Subsurface Scattering (Direct, Indirect and Color pass). 

This is part of my GSoC project, SVN merge of r58587, r58828 and r58835.
2013-08-03 13:12:09 +00:00
Thomas Dinges
702bf77b34 Cycles / Squared Samples:
* After some feedback decided to remove this option from the Progressive integrator, it only makes sense for Non-Progressive where we have different values for the sample types.
2013-07-31 22:51:48 +00:00
Antony Riakiotakis
ac8e379a87 Fix linking issue, we use bundled static glew so we should define static glew in ghost as well. 2013-07-31 22:39:17 +00:00
Sergey Sharybin
c756a4466c Added check for whether thread lock is being removed while thread is using guarded alloc. 2013-07-31 21:55:41 +00:00
Thomas Dinges
e48acb7dec Code cleanup, use bools here. Forgot to change that. 2013-07-31 21:40:52 +00:00
Thomas Dinges
2a2f0319bc Cycles / HSV Separator and Combine node:
* Added nodes to separate and combine hsv colors.

Part of my GSoC 2013 project, SVN merge of r57981.
2013-07-31 21:27:48 +00:00
Thomas Dinges
34009da32e Cycles / Vector Transform node:
* Add a note to convert a Vector, Point or Normal between World <=> Camera <=> Object coordinate space. 

Documentation: http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/More#Vector_Transform

Part of my GSoC 2013 project, SVN merge of r57599, r57670, r57918, r57919, r58245 and r58775.
2013-07-31 21:18:23 +00:00
Thomas Dinges
6d9720ef63 Cycles / Blackbody to RGB node:
* Added a node to convert a temperature in Kelvin to an RGB color. This can be used e.g. for lights, to easily find the right color temperature. 
= Some common temperatures =
Candle light: 1500 Kelvin
Sunset/Sunrise: 1850 Kelvin
Studio lamps: 3200 Kelvin
Horizon daylight: 5000 Kelvin

Documentation: http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/More#Blackbody

Thanks to Philipp Oeser (lichtwerk), who essentially contributed to this with a patch! :)

This is part of my GSoC 2013 project. SVN merge of r57424, r57487, r57507, r57525, r58253 and r58774
2013-07-31 20:56:32 +00:00
Thomas Dinges
3840e0b234 Cycles / Ray Depth:
* Added a Ray Depth output to the Light Path node, which gives the user access to the current bounce.
This can be used to limit the maximum ray bounce on a per shader basis. Another use case is to restrict light influence with this, to have a lamp only contribute to the direct lighting. 

http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/More#Light_Path

This is part of my GSoC 2013 project. SVN merge of r58091 and r58772 from soc-2013-dingto.
2013-07-31 20:30:37 +00:00