Commit Graph

109 Commits

Author SHA1 Message Date
4a04f72069 remove $Id: tags after discussion on the mailign list: http://markmail.org/message/fp7ozcywxum3ar7n 2011-10-23 17:52:20 +00:00
30cba27987 Dynamic Paint:
* Some changes and cleanup pointed on the codereview.
2011-10-22 16:16:14 +00:00
4a157de23d svn merge ^/trunk/blender -r40587:40643 2011-09-28 07:34:48 +00:00
018fa1540e whitespace edits, make formatting for functions consustent at least within the file. 2011-09-28 05:53:40 +00:00
5bd83eede0 svn merge ^/trunk/blender -r40405:40431 2011-09-23 11:30:55 +00:00
4b449aefea remove support for irix 2011-09-21 08:40:30 +00:00
489eaaa46d =bmesh= build modifier works now, also made scanfill thread-safe 2011-04-16 23:58:49 +00:00
Nathan Letwory
7900b5949f doxygen: blender/blenlib tagged. 2011-02-27 20:37:56 +00:00
Nathan Letwory
5b607701a7 doxygen: prevent GPL license block from being parsed as doxygen comment. 2011-02-23 10:52:22 +00:00
59f1640ae5 warning cleanup.
- fix mistake with grease pencil UI (&& was intended but & used).
- use (void) rather then () across _all_ blenders code.
- a few minor edits, don't shadow stack variables in roll calculation & avoid running memset() for VBO vertex map.
2011-02-13 15:02:21 +00:00
8268a4be71 most unused arg warnings corrected.
- removed deprecated bitmap arg from IMB_allocImBuf (plugins will need updating).
- mostly tagged UNUSED() since some of these functions look like they may need to have the arguments used later.
2010-10-16 14:32:17 +00:00
ed28a0296f BLI_init_threads/BLI_end_threads with NULL listbase now raises thread level
and enables mutex protection on MEM_* functions, useful when you want to call
these functions from an OpenMP thread.

(merge from render25 branch)
2010-06-22 15:17:12 +00:00
d8106205db Fix #22401: BLI_thread_is_main function does not work properly on
64-bit Windows, fix provided by Tamito Kajiyama.
2010-05-27 12:40:12 +00:00
a547e91d41 Two bugfixes from the render branch:
* Fix for FSA update while rendering fix, should set float rect to NULL.
* Fix for irradiance cache mutex unlock that got lost in code changes.
2010-04-26 12:50:48 +00:00
3f12beb4d0 Fix #22123 and #22124: some problems with mutex locks, also tweak to
how removing opengl textures from outside main thread is done so it
happens as part of the main loop.
2010-04-25 10:49:13 +00:00
392e1da179 bugfix and cleanup
- BGE Shader.setSampler(name, index): index range check was wrong.
- Compositor check for an invalid channel was incorrect.
- getting the center of selected verts used an uninitalized z axis.
- do_init_render_material() used && rather then & when testing for MA_TRANSP.
- weight paint activate flipped bone used && rather then & for flag checking.
2010-04-17 15:47:00 +00:00
9a85013692 Merge various small changes from render branch:
* Division by zero fix for TNT SVD code.
* Sound fix, in case ffmpeg decode fails, don't use the samples.
* Fix for incorrect bounds of transformed objects in new raytracing code.
* Gave memory arena's a name used for allocations for easier memory
  usage debugging.
* Dupligroup no_draw option was using layers but not restrict view/render
  setting. (not a bugfix exactly but would do display list context switching
  while drawing for no reason).
* Fix objects instanced on hair particles not giving consistent results
  when the object is transformed.
* New math functions: madd_v4_v4fl, len_squared_v3v3, interp_v4_v4v4v4,
  mul_v4_m4v4, SH and form factor functions, box_minmax_bounds_m4.
* mul_m4_m4m4 and mul_m3_m3m3 now accept the same pointers for multiple
  arguments.
* endjob callback for WM jobs system.
* Geometry node uv/color layer now has search list/autocomplete.
* Various small buildsystem tweaks, not strictly needed yet in trunk.
2010-04-15 10:28:32 +00:00
86aa4e5c3d prevent images from freeing gpu buffers if not run within the main thread, instead they are queued to be freed the next time GPU_image_free() is run from the main thread. 2010-04-13 12:51:03 +00:00
07b547980d remove unused includes for blenlib, left ifdef's for non linux os's alone. 2010-03-20 18:52:03 +00:00
f17dcf58c8 Fixes for thread related render / compositing crashes:
* Viewer node could free image while it is being redrawn, viewer image
  buffers now need acquire/release to be accessed as was already the
  case for render results.
* The Composite node could free the image buffers outside of a lock,
  also causing simultaneous redraw to crash.
* Especially on Windows, re-rendering could crash when drawing an image
  that was freed. When RE_RenderInProgress was true it would access the
  image buffer and simply return it while it could still contain a pointer
  to a render result buffer that was already freed. I don't understand
  why this case was there in the first place, so I've removed it.

Possibly fixes bugs #20174, #21418, #21391, #21394.
2010-03-16 16:58:45 +00:00
4dbf499be3 Fix crash in compositing nodes, due to threading problem. 2010-03-12 13:07:25 +00:00
1b28081102 Mac + OpenMP + pthreads workaround: recent commit broke compile, just
moved it into threads.c now instead of having it duplicated in various
places.
2010-03-09 16:54:25 +00:00
081c1205a3 correct fsf address 2010-02-12 13:34:04 +00:00
cd2c4a5834 - change max threads from 8 to 64, need to keep an eye on stack memory use here.
- reload fix didnt work last commit.
2010-01-28 19:18:35 +00:00
1bb6ba0605 Thread queue: use _ftime to get current time on windows, same as
pthreads-win32 test suite.
2010-01-23 14:29:56 +00:00
c71ace02c2 accidentally commited a patch that modifies wait_timeout, which I've not thourougly tested, but I'm not reverting it since it's needed to make msvc compile. it's only used if compiling with windows anyway. patch by mitchel stokes. 2010-01-23 11:32:21 +00:00
7ef85aa41f Initial results of my profiling of the animation system.
Basically two simple changes, changes, I pulled in the faster 
ghash in bmesh (which uses mempools for allocation, providing 
a substanstial speedup in some cases, and also I inlined some
of the functions), and I changed __inline to __forceinline for inlining
of math functions.

I also removed the timer in the view3d zoom op (ctrl-middlemouse)
that was making it nonfunctional.  Why was that there?
2010-01-23 11:25:20 +00:00
5badcca867 bugfix [#20767] Particle edit mode crashes
& missing include added
2010-01-22 21:40:31 +00:00
2d2339a709 Threads: added queue for passing data between threads. Includes a function
to wait for an item to be put in the queue and then pop immediately without,
this makes it possible to avoid sleep() while waiting for the results of a
thread.
2010-01-22 11:06:57 +00:00
b466286c3e Render & Compositing Thread Fixes
* Rendering twice or more could crash layer/pass buttons.
* Compositing would crash while drawing the image.
* Rendering animations could also crash drawing the image.
* Compositing could crash 
* Starting to rendering while preview render / compo was
  still running could crash.
* Exiting while rendering an animation would not abort the
  renderer properly, making Blender seemingly freeze.
* Fixes theoretically possible issue with setting malloc
  lock with nested threads.
* Drawing previews inside nodes could crash when those nodes
  were being rendered at the same time.

There's more crashes, manipulating the scene data or undo can
still crash, this commit only focuses on making sure the image
buffer and render result access is thread safe.


Implementation:
* Rather than assuming the render result does not get freed
  during render, which seems to be quite difficult to do given
  that e.g. the compositor is allowed to change the size of
  the buffer or output different passes, the render result is
  now protected with a read/write mutex.
* The read/write mutex allows multiple readers (and pixel
  writers) at the same time, but only allows one writer to
  manipulate the data structure.
* Added BKE_image_acquire_ibuf/BKE_image_release_ibuf to access
  images being rendered, cases where this is not needed (most
  code) can still use BKE_image_get_ibuf.
* The job manager now allows only one rendering job at the same
  time, rather than the G.rendering check which was not reliable.
2009-09-30 18:18:32 +00:00
ba5df38d66 use static functions where possible for some local functions. 2009-09-14 16:52:06 +00:00
9004dc665c Fix thread hanging problem (mostly seen with material preview, but that sneaky f*er could strike any time).
Story time: Once upon a time, in the green valley of fileselect, BLI_end_threads would get called on an empty threadbase, depending on the result of a previous call to readdir(). The function would then gladly decrement thread_level to -1 which would cause all kinds of fun havoc. THE END.

Made sure thread_level is only incremented and decremented when needed. The caller should never have to make sure of that, especially since it already lets you call with a null threadbase.

Please report any further hang (and how to reproduce, if possible).
2009-09-02 20:57:18 +00:00
fd1f1c5736 2.5
Quick test commit to check on crashing previews; ignore warning about
implicit declaration...  here in OSX i can't get this crash!
2009-06-07 12:12:55 +00:00
ebb6628a01 2.5 BLI_blenlib cleanup
DONE:
* moved almost all declarations from BLI_blenlib.h into their own proper header files.
* BLI_blenlib.h still includes all the declarations for convenience and to avoid changes in existing code
* split util.c into several files, where it wasn't done already
*    DynamicList -> dynamiclist, 
*    ListBase    -> listbase, 
*    String utility functions -> string.c
* removed a few unused macros and functions, if they're needed back, they're still in svn ;)
TODO:
* btempdir global
* further cleanup in the code of the different modules (especially util.c)
2008-12-20 10:02:00 +00:00
ec00764dd2 2.50: svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r17434:HEAD 2008-12-14 17:32:24 +00:00
39e66e4d6f Bug fixing
It helps if the fonction to wait on all threads actual does that.

Use user parameter for number of threads (this is really looking like it should be in the userprefs and not render params).
2008-10-01 18:00:13 +00:00
ec9295db3a Keep persistent results for retargeting. Easier weight adjustement.
Will have to do a second pass tomorrow to fix some leftovers.
2008-09-25 20:29:15 +00:00
e0722e0923 ThreadedWorker
New functions to easily dispatch work to a limited number of thread, transparently.

NOTE: Could be merged in trunk, if needed.
2008-08-16 22:47:33 +00:00
feb5e3a688 Add a function to join thread by index in the thread list.
This can be safely merged in trunk, in case anyone needs something like that.
2008-08-14 23:48:52 +00:00
8c704ec5a6 test commit: fix autothreads on irix 2008-03-19 22:58:16 +00:00
7c7a931fed made auto threads default (noob's get faster renders in their dual core CPU's)
changed env variable check order $TMP, $TMPDIR - aparently $TMP is more common.
2008-02-21 08:43:13 +00:00
1892df0e68 making auto detection of threads working on Os X
sysconf exist but dont provide the needed flag
using sysctl instead
2008-02-20 16:07:42 +00:00
53590faba1 * Added include for auto-threads to compile on Windows 2008-02-20 01:12:21 +00:00
0c4d1036d6 added win32 check for number of processors, but cant test.
could somebody running win32 see if headers need to be added to threads.c?
2008-02-19 22:59:52 +00:00
82d769c79f automatic threads, next to the Threads button, so you can set threads to use whatever the system has, useful in the studio with 2,4,8 core systems when sharing files. 2008-02-19 22:23:21 +00:00
4018dfd28f == Sequencer ==
Added malloc mutex handling. (Sorry, had to patch threads.c a bit,
since otherwise scene tracks will completely screw things up...)
2007-11-25 16:35:33 +00:00
6f3fb5525e Patch #3126
Option to draw object name in 3d window corner, now also displays for
meshes the (pinned) shape key name.

Threads: warning fix, added (void) for function declaration.
2007-03-19 15:48:24 +00:00
af60771eca Fix for threads usage. This solves the hanging 'render baking', cauused
by yesterdays commit.

Now a designater LOCK_IMAGE is used for all image write/read.
2006-12-21 15:44:46 +00:00
c1258980a4 Render Baking upgrade:
- Now baking itself is threaded too (like for render, max 2 cpus. Moving
  this to 4 cpus is on todo. Goes twice as fast!

- fix: ESC from bake was broken...

- other fix: toolbox menus didn't treat sublevel string lengths OK,
  truncating items like for Group library names.
2006-11-28 10:16:24 +00:00
e7d6537f1c Added support for threadsafe MEM_mallocN/MEM_freeN in the guardedalloc
module itself, replacing the special MEM_mallocT/MEM_freeT functions.
Mutex locking is only enabled when threads are running.

There was no good reason to have these separate, it just led to ugly
hacks when calling functions with non-threadsafe malloc from threads.
2006-09-06 19:13:23 +00:00