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
AgeCommit message (Collapse)Author
2018-02-15Cleanup: rename BLI_thread.h APICampbell Barton
- Use BLI_threadpool_ prefix for (deprecated) thread/listbase API. - Use BLI_thread as prefix for other functions. See P614 to apply instead of manually resolving conflicts.
2018-02-15Cleanup: use '_len' instead of '_size' w/ BLI APICampbell Barton
- When returning the number of items in a collection use BLI_*_len() - Keep _size() for size in bytes. - Keep _count() for data structures that don't store length (hint this isn't a simple getter). See P611 to apply instead of manually resolving conflicts.
2017-11-14Fix missing SpinLock typedef on macOSArto Kitula
2017-11-14Fix T53068: AMD Threadripper not working well with BlenderSergey Sharybin
The issue was caused by SpinLock implementation in old pthreads we ar eusing on Windows. Using newer one (2.10-rc) demonstrates same exact behavior. But likely using own atomics and memory barrier based implementation solves the issue. A bit annoying that we need to change such a core part of Blender just to make specific CPU happy, but it's better to have artists happy on all computers. There is no expected downsides of this change, but it is so called "works for me" category. Let's see how it all goes.
2016-07-15Bump maximum threads number to 1024Sergey Sharybin
This commit contains all the changes required for most optimal maximum threads number bump. This is needed to avoid possibly unneeded initialization or data allocation on systems with lower threads count. TODO: Still need to review arrays in render data structures from render_types.h, P.S. We might remove actual bump of max threads from this patch, so when we'll be applying the patch we can do all the preparation work and then do actual bump of max threads. Reviewers: mont29, campbellbarton Reviewed By: mont29, campbellbarton Maniphest Tasks: T43306 Differential Revision: https://developer.blender.org/D1343
2016-03-03Add utility macro to work with thread local storageSergey Sharybin
2015-08-10BLI_threads: add an helper to wait on a condition using a global mutex.Bastien Montagne
Also, factorized internal code to get global mutex from its ID.
2015-06-19BLI_threads Queue: add `BLI_thread_queue_is_empty()`.Bastien Montagne
Avoids counting the whole queue when we only want to check whether it is empty or not!
2015-04-06Multi-View and Stereo 3DDalai Felinto
Official Documentation: http://www.blender.org/manual/render/workflows/multiview.html Implemented Features ==================== Builtin Stereo Camera * Convergence Mode * Interocular Distance * Convergence Distance * Pivot Mode Viewport * Cameras * Plane * Volume Compositor * View Switch Node * Image Node Multi-View OpenEXR support Sequencer * Image/Movie Strips 'Use Multiview' UV/Image Editor * Option to see Multi-View images in Stereo-3D or its individual images * Save/Open Multi-View (OpenEXR, Stereo3D, individual views) images I/O * Save/Open Multi-View (OpenEXR, Stereo3D, individual views) images Scene Render Views * Ability to have an arbitrary number of views in the scene Missing Bits ============ First rule of Multi-View bug report: If something is not working as it should *when Views is off* this is a severe bug, do mention this in the report. Second rule is, if something works *when Views is off* but doesn't (or crashes) when *Views is on*, this is a important bug. Do mention this in the report. Everything else is likely small todos, and may wait until we are sure none of the above is happening. Apart from that there are those known issues: * Compositor Image Node poorly working for Multi-View OpenEXR (this was working prefectly before the 'Use Multi-View' functionality) * Selecting camera from Multi-View when looking from camera is problematic * Animation Playback (ctrl+F11) doesn't support stereo formats * Wrong filepath when trying to play back animated scene * Viewport Rendering doesn't support Multi-View * Overscan Rendering * Fullscreen display modes need to warn the user * Object copy should be aware of views suffix Acknowledgments =============== * Francesco Siddi for the help with the original feature specs and design * Brecht Van Lommel for the original review of the code and design early on * Blender Foundation for the Development Fund to support the project wrap up Final patch reviewers: * Antony Riakiotakis (psy-fi) * Campbell Barton (ideasman42) * Julian Eisel (Severin) * Sergey Sharybin (nazgul) * Thomas Dinged (dingto) Code contributors of the original branch in github: * Alexey Akishin * Gabriel Caraballo
2014-06-08Fix T40510, revert openmp thread count to how it was inAntony Riakiotakis
2.70 for non Apple systems. Also refactored the code that restores the previous openmp thread count. The logic here was weird, mostly due to all the commit madness with Apple openmp support. The restored thread count though should not depend on the on/off state of threaded sculpting (since it has to do with systems other than sculpting only). For OSX threads are restored to the system thread count but Jens should recheck here.
2014-04-17Code cleanup: use boolsCampbell Barton
also rename BLI_omp_thread_count -> BLI_system_thread_count_omp
2014-03-31Sculpt/dyntopo: Make the omp threads configurable to overcome performance issuesJens Verwiebe
- autodetect optimal default, which typically avoids HT threads - can store setting in .blend per scene - this does not touch general omp max threads, due i found other areas where the calculations are fitting for huge corecount - Intel notes, some of the older generation processors with HyperThreading would not provide significant performance boost for FPU intensive applications. On those systems you might want to set OMP_NUM_THREADS = total number of cores (not total number of hardware theads).
2014-03-02Fix T38873: Crashing on undo of ocean modifier.Bastien Montagne
Issue of this bug is that most part of fftw is not thread safe, only compute-intensive fftw_execute & co are. Since smoke was affected by this issue as well, a global fftw mutex was added to BLI_threads. Audaspace also uses fftw in one of its readers (AUD_BandPassReader.cpp), but this is not an issue currently since this code is disabled in CMake/scons files. There was another threading issue with smoke, we need to copy dm used by emit_from_derivedmesh(), as it is modified by this func. Reviewers: sergey, brecht Reviewed By: brecht CC: brecht Differential Revision: https://developer.blender.org/D374
2013-12-29Fix T37980: Multiple font objects sharing an external font gives problemsSergey Sharybin
Solved by adding RW lock to BKE_vfont_to_curve. So now all the threads are allowed to read chars from ghash, but they'll be locked as soon as one thread would need to load more chars from font to the ghash.
2013-10-12Task scheduler ported form CYcles to CSergey Sharybin
Replaces ThreadedWorker and is gonna to be used for threaded object update in the future and some more upcoming changes. But in general, it's to be used for any task based subsystem in Blender. Originally written by Brecht, with some fixes and tweaks by self.
2013-08-19Speedup for guarded allocatorSergey Sharybin
- 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
2013-07-09Partial revert of rev58110Sergey Sharybin
There's one thing we didn't foresee from the beginning, which is apparently TLS is only available in OSX starting from version 10.7, and we still do support of 10.6. After recent Brecht's changes about locked viewport while initializing BI render this TLS is not needed in trunk anymore. So reverting this chunk of base iteration to use static variable. But leaving all the other static variables warped into context still, it should help a bit in the future refactor. Real fix would be to have some kind of graph context evaluation structure which would be passing to update routines (which will solve threaded mballs update) and making depsgraph responsible for getting a motherball. But this is all for GSoC project.
2013-07-09Fixed more threading issues with metaballsSergey Sharybin
This time issue was caused by static variables used in BKE_scene_base_iter_next function. Change is not so much ultimate actually, but didn't find more clear solution for now. So the changes are: - Wrap almost all the static variables into own context- like structure, which is owned by the callee function and getting passed to the iteration function. - Recursion detection wasn't possible with such approach, so recursion detection still uses static in_next_object variable, but which is now stored in thread local storage (TLS, or thread variable if this names are more clear for you). This makes code thread-safe, but for sure final solution shall be completely different. Ideally, dependency graph shall be possible to answer on question "which object is a motherball for this metaball". This will avoid iterating via all the bases, objects and duplis just to get needed motherball. Further, metaball evaluation ideally will use the same kind of depsgraph filtering, which will get result for question like "which objects belongs to this group of metaballs". But this ideal things are to be solved in Joshua's and mind GSoC projects. Tested on linux (gcc and clang) and windows (msvc2008), hopefully no compilation error will happen. Thanks to Brecht for reviewing the change and getting feedback for other possible ways we've dicussed!
2013-07-08Fix #35960, #36044: blender internal viewport rendering crash while editing ↵Brecht Van Lommel
data. Now the viewport rendering thread will lock the main thread while it is exporting objects to render data. This is not ideal if you have big scenes that might block the UI, but Cycles does the same, and it's fairly quick because the same evaluated mesh can be used as for viewport drawing. It's the only way to get things stable until the thread safe dependency graph is here. This adds a mechanism to the job system for jobs to lock the main thread, using a new 'ticket mutex lock' which is a mutex lock that gives priority to the first thread that tries to lock the mutex. Still to solve: undo/redo crashes.
2013-05-08Fix #35240: command line -t number of threads option did not work for cycles.Brecht Van Lommel
Now it works for blender internal, cycles and other multithreading code in Blender in both background and UI mode.
2013-04-24Fix #34783: smoke simulation crash when changing frame while preview rendering.Brecht Van Lommel
Added a mutex lock for smoke data access. The render was already working with a copy of the volume data, so it's just a short lock to copy things and should not block the UI much.
2012-11-15Image thread safe improvementsSergey Sharybin
This commit makes BKE_image_acquire_ibuf referencing result, which means once some area requested for image buffer, it'll be guaranteed this buffer wouldn't be freed by image signal. To de-reference buffer BKE_image_release_ibuf should now always be used. To make referencing working correct we can not rely on result of image_get_ibuf_threadsafe called outside from thread lock. This is so because we need to guarantee getting image buffer from list of loaded buffers and it's referencing happens atomic. Without lock here it is possible that between call of image_get_ibuf_threadsafe and referencing the buffer IMA_SIGNAL_FREE would be called. Image signal handling too is blocking now to prevent such a situation. Threads are locking by spinlock, which are faster than mutexes. There were some slowdown reports in the past about render slowdown when using OSX on Xeon CPU. It shouldn't happen with spin locks, but more tests on different hardware would be really welcome. So far can not see speed regressions on own computers. This commit also removes BKE_image_get_ibuf, because it was not so intuitive when get_ibuf and acquire_ibuf should be used. Thanks to Ton and Brecht for discussion/review :)
2012-09-15Color Management, Stage 2: Switch color pipeline to use OpenColorIOSergey Sharybin
Replace old color pipeline which was supporting linear/sRGB color spaces only with OpenColorIO-based pipeline. This introduces two configurable color spaces: - Input color space for images and movie clips. This space is used to convert images/movies from color space in which file is saved to Blender's linear space (for float images, byte images are not internally converted, only input space is stored for such images and used later). This setting could be found in image/clip data block settings. - Display color space which defines space in which particular display is working. This settings could be found in scene's Color Management panel. When render result is being displayed on the screen, apart from converting image to display space, some additional conversions could happen. This conversions are: - View, which defines tone curve applying before display transformation. These are different ways to view the image on the same display device. For example it could be used to emulate film view on sRGB display. - Exposure affects on image exposure before tone map is applied. - Gamma is post-display gamma correction, could be used to match particular display gamma. - RGB curves are user-defined curves which are applying before display transformation, could be used for different purposes. All this settings by default are only applying on render result and does not affect on other images. If some particular image needs to be affected by this transformation, "View as Render" setting of image data block should be set to truth. Movie clips are always affected by all display transformations. This commit also introduces configurable color space in which sequencer is working. This setting could be found in scene's Color Management panel and it should be used if such stuff as grading needs to be done in color space different from sRGB (i.e. when Film view on sRGB display is use, using VD16 space as sequencer's internal space would make grading working in space which is close to the space using for display). Some technical notes: - Image buffer's float buffer is now always in linear space, even if it was created from 16bit byte images. - Space of byte buffer is stored in image buffer's rect_colorspace property. - Profile of image buffer was removed since it's not longer meaningful. - OpenGL and GLSL is supposed to always work in sRGB space. It is possible to support other spaces, but it's quite large project which isn't so much important. - Legacy Color Management option disabled is emulated by using None display. It could have some regressions, but there's no clear way to avoid them. - If OpenColorIO is disabled on build time, it should make blender behaving in the same way as previous release with color management enabled. More details could be found at this page (more details would be added soon): http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Color_Management -- Thanks to Xavier Thomas, Lukas Toene for initial work on OpenColorIO integration and to Brecht van Lommel for some further development and code/ usecase review!
2012-07-13Fix #32087: Crash while changing values in comp editor (bt and blender included)Sergey Sharybin
Issue was caused by threading conflict between compositor output node which is freeing buffers used by render result image and image draw code which could use buffers at the same time as compositor frees this buffers. Solved by adding adding lock around viewer image invalidation and image drawing. Use renamed LOCK_PREVIEW mutex for this, which si not called LOCK_DRAW_IMAGE. With new compositor locking for preview is not needed so it could be removed. Added the same lock around viewer operation which also frees buffers used by viewer image. It's actually quite difficult to check whether this is indeed needed. This code seems to be using acquire/release technique, but somehow acquiring ImBuf before invalidating it in compositor operation doesn't resolve the issue, so probably it's not actually locking acquire and things should be checked deeper.
2012-07-10Inline the read Memory Buffer functions for speed optimizations.Jeroen Bakker
2012-06-10Applied and completed a compositor patch by Brecht to use signalling and ↵Lukas Toenne
waiting in scheduling and worker threads instead of continuous loops with sleep times. This should help reduce unnecessary wait times in Tile.
2012-05-13code cleanup: header cleanup and remove some duplicate defines.Campbell Barton
2012-04-30code cleanup: header cleanupCampbell Barton
2012-04-16make scanfill threadsafe (wasnt threadsafe before BMesh merge but before the ↵Campbell Barton
merge it didn't need to be) - now rendering uses its better if its threadsafe.
2012-02-19Change texface draw to always use glShadeModel(GL_SMOOTH), with texface draw.Campbell Barton
without this each face would get a solid color, this is the same method used in object mode. also copy BLI_array.h fix from bmesh branch.
2012-02-17unify include guard defines, __$FILENAME__Campbell Barton
without the underscores these clogged up the namespace for autocompleation which was annoying.
2011-11-07Merge with trunk r41625Miika Hamalainen
2011-11-07Camera tracking integrationSergey Sharybin
=========================== Commiting camera tracking integration gsoc project into trunk. This commit includes: - Bundled version of libmv library (with some changes against official repo, re-sync with libmv repo a bit later) - New datatype ID called MovieClip which is optimized to work with movie clips (both of movie files and image sequences) and doing camera/motion tracking operations. - New editor called Clip Editor which is currently used for motion/tracking stuff only, but which can be easily extended to work with masks too. This editor supports: * Loading movie files/image sequences * Build proxies with different size for loaded movie clip, also supports building undistorted proxies to increase speed of playback in undistorted mode. * Manual lens distortion mode calibration using grid and grease pencil * Supervised 2D tracking using two different algorithms KLT and SAD. * Basic algorithm for feature detection * Camera motion solving. scene orientation - New constraints to "link" scene objects with solved motions from clip: * Follow Track (make object follow 2D motion of track with given name or parent object to reconstructed 3D position of track) * Camera Solver to make camera moving in the same way as reconstructed camera This commit NOT includes changes from tomato branch: - New nodes (they'll be commited as separated patch) - Automatic image offset guessing for image input node and image editor (need to do more tests and gather more feedback) - Code cleanup in libmv-capi. It's not so critical cleanup, just increasing readability and understanadability of code. Better to make this chaneg when Keir will finish his current patch. More details about this project can be found on this page: http://wiki.blender.org/index.php/User:Nazg-gul/GSoC-2011 Further development of small features would be done in trunk, bigger/experimental features would first be implemented in tomato branch.
2011-11-05Merge with trunk r41545Miika Hamalainen
2011-10-31Fix #29084: material/texture nodes crash introduced in 2.60, execdata is beingBrecht Van Lommel
lazely created but this wasn't done in a thread safe way.
2011-10-28Merge with trunk r41342Miika Hamalainen
2011-10-23remove $Id: tags after discussion on the mailign list: ↵Campbell Barton
http://markmail.org/message/fp7ozcywxum3ar7n
2011-10-22Dynamic Paint:Miika Hamalainen
* Some changes and cleanup pointed on the codereview.
2011-02-18doxygen: add blenlib under core as module.Nathan Letwory
2010-12-03- added GCC warning -Wstrict-prototypesCampbell Barton
- fixed bug in paste material, exposed by stricter warnings. - removed/renamed various shadowed vars. - removed BGE lamp.colour, only allow lamp.color attribute.
2010-04-25Fix #22123 and #22124: some problems with mutex locks, also tweak toBrecht Van Lommel
how removing opengl textures from outside main thread is done so it happens as part of the main loop.
2010-04-15Merge various small changes from render branch:Brecht Van Lommel
* 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-14used private mutexes to avoid deadlocksJoseph Eagar
2010-04-13prevent images from freeing gpu buffers if not run within the main thread, ↵Joseph Eagar
instead they are queued to be freed the next time GPU_image_free() is run from the main thread.
2010-03-21Fix syntax for ID keyword.Guillermo S. Romero
2010-03-16Fixes for thread related render / compositing crashes:Brecht Van Lommel
* 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-02-12correct fsf addressCampbell Barton
2010-01-28- change max threads from 8 to 64, need to keep an eye on stack memory use here.Campbell Barton
- reload fix didnt work last commit.
2010-01-22Threads: added queue for passing data between threads. Includes a functionBrecht Van Lommel
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.
2009-09-30Render & Compositing Thread FixesBrecht Van Lommel
* 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.