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
2016-05-17Code refactor: add some array utility methods, fix leak in assignment operator.Brecht Van Lommel
2016-05-12Cycles: Add support for single channel byte textures.Thomas Dinges
This way, we also save 3/4th of memory for single channel byte textures (e.g. Bump Maps). Note: In order for this to work, the texture *must* have 1 channel only. In Gimp you can e.g. do that via the menu: Image -> Mode -> Grayscale
2016-05-12Fix array bounds compile warning.Thomas Dinges
2016-05-12Cleanup: Fix typo.Thomas Dinges
2016-05-11Cycles: Add support for single channel float textures on CPU.Thomas Dinges
Until now, single channel textures were packed into a float4, wasting 3 floats per pixel. Memory usage of such textures is now reduced by 3/4. Voxel Attributes such as density, flame and heat benefit from this, but also Bumpmaps with one channel. This commit also includes some cleanup and code deduplication for image loading. Example Smoke render from Cosmos Laundromat: http://www.pasteall.org/pic/show.php?id=102972 Memory here went down from ~600MB to ~300MB. Reviewers: #cycles, brecht Differential Revision: https://developer.blender.org/D1981
2016-05-11Cycles: Use explicit qualifier for single-argument constructorsSergey Sharybin
Almost in all cases we want such constructors to be explicit, there are exceptions but only in few places.
2016-05-10Cycles: Add support for float4 textures on OpenCL.Thomas Dinges
Title says it all, this adds OpenCL float4 texture support. There is a bug in the code still, I get a "Out of ressources error" on nvidia hardware here, not sure whats wrong yet. Will investigate further, but maybe someone else has an idea. :) Reviewers: #cycles, brecht Subscribers: brecht, candreacchio Differential Revision: https://developer.blender.org/D1983
2016-05-09Cleanup: More byte -> byte4 renaming for consistency.Thomas Dinges
2016-05-07Cycles: Make CUDA adaptive feature compile a Debug flag.Thomas Dinges
If the CUDA Toolkit is installed and the user is on Linux, adaptive, feature based CUDA runtime compile is now possible to enable via: * Environment flag CYCLES_CUDA_ADAPTIVE_COMPILE or * Debug menu (Debug value 256) in the Cycles UI.
2016-05-06Cleanup: Rename texture slots to float4 and byte, to distinguish from future ↵Thomas Dinges
float (single channel) and half_float slots. Should be no functional changes, tested CPU and CUDA.
2016-04-25Cycles: Fix issues with stack allocator in MSVCSergey Sharybin
Couple of issues here: - Was a bug in heap memory allocation when run out of allowed stack memory. - Debug MSVC was failing because it uses separate allocator for some sort of internal proxy thing, which seems to be unable to be using stack memory because allocator is being created in non-persistent stack location.
2016-04-20Cycles: Stop rendering when bad_alloc happensSergey Sharybin
This is an attempt to gracefully handle out-of-memory events and stop rendering with an error message instead of a crash. It uses bad_alloc exception, and usually i'm not really fond of exceptions, but for such limited use for errors from which we can't recover it should be fine. Ideally we'll need to stop full Cycles Session, so viewport render and persistent images frees all the memory, but that we can support later, since it'll mainly related on telling Blender what to do. General rules are: - Use as less exception handles as possible, try to find a most geenric pace where to handle those. For example, ccl::Session. - Threads needs own handling, exception trap from one thread will not catch exceptions from other threads. That's why BVH build needs own thing. Reviewers: brecht, juicyfruit, dingto, lukasstockner97 Differential Revision: https://developer.blender.org/D1898
2016-04-20Cycles: Throw bad_alloc exception when custom allocators failed to allocate ↵Sergey Sharybin
memory This mimics behavior of default allocators in STL and allows all the routines to catch out-of-memory exceptions and hopefully recover from that situation/
2016-04-16Cycles: Refactor Image Texture limits.Thomas Dinges
Instead of treating Fermi GPU limits as default, and overriding them for other devices, we now nicely set them for each platform. * Due to setting values for all platforms, we don't have to offset the slot id for OpenCL anymore, as the image manager wont add float images for OpenCL now. * Bugfix: TEX_NUM_FLOAT_IMAGES was always 5, even for CPU, so the code in svm_image.h clamped float textures with alpha on CPU after the 5th slot. Reviewers: #cycles, brecht Reviewed By: #cycles, brecht Subscribers: brecht Differential Revision: https://developer.blender.org/D1925
2016-04-16Cleanup: Move texture definitions to util, to avoid bad level include.Thomas Dinges
2016-04-15Fix T48139: Checker texture strange behavior in cyclesSergey Sharybin
Seems particular CUDA implementations has some precision issues, which made integer coordinate (which was expected to always be positive) to go negative.
2016-04-13Cleanup string includes after versioning commitsThomas Dinges
2016-04-13Show version number in UI as wellThomas Dinges
2016-04-13Tweaks to the version string formationSergey Sharybin
Couple of things: - No need to use string streams to format the version string, we can do it at compile time and don't bother with anything at runtime. - Function declaration was wring and would have caused linking conflicts in cases when util_version.h was included from multiple places. We should have an utility function to get Cycles version so applications which are linked to Cycles dynamically can query the version, but that can't be done as an inlined function in header and would need to be a function properly exported to a global symbol table (aka, be implemented in a .cpp file).
2016-04-13Add a version number to Cycles standaloneThomas Dinges
Now Cycles has its own versioning, that is mainly interesting for external projects, which integrate the engine. We start with version 1.7.0. Reasons for that: * The engine is too mature for a 1.0 release. * We assume that Cycles inside of Blender 2.61 was version 0.1. We count upwards in 0.1 steps, therefore Cycles inside of Blender 2.77 would be 1.7. We use a common versioning scheme here, with 3 decimals for the major, minor and patch level. At the moment cycles --version can be used to display the version, easy to parse for external projects. The info will be added to the UI later aswell.
2016-04-13Cycles: Minor cleanup, whitespace around keyword and preprocessor indentSergey Sharybin
2016-04-10Cycles: Fix rare dead-locks on TaskScheduler::exit()Sergey Sharybin
When the Moon is full it was possible to have a dead-lock in task scheduler's exit() method. Similar problem was fixed in Blender's task scheduler 3 years ago in bae2a2c.
2016-04-04Cycles: Solve possible issues with running out of stack memory allocatorSergey Sharybin
Policy here is a bit more complicated, if tree becomes too deep we're forced to create a leaf node and size of that leaf wouldn't be so well predicted, which means it's quite tricky to use single stack array for that. Made it more official feature that StackAllocator will fall-back to heap when running out of stack memory. It's still much better than always using heap allocator.
2016-04-04Cycles: Log overall time spent on building object's BVHSergey Sharybin
We had per-tree statistics already, but it's a bit tricky to see overall time because trees could be building in parallel. In fact, we can now print statistics for any TaskPool.
2016-04-01Fix T47505: Cycles OpenCL rendering crash on Windows.Brecht Van Lommel
Restore the boost bug workaround, but without changing the locale.
2016-04-01Cycles: Report thread ID from worker thread to callbacksSergey Sharybin
Main use case of this ID will be to emulate TLS which otherwise would require having some platform-specific implementations which is not always really optimal. See notes about the argument in util_task.h.
2016-04-01Cycles: Fix for missing pthread's spin on OSXSergey Sharybin
2016-03-31Cycles: Add easy to use spin lock primitiveSergey Sharybin
Currently unused, but will be handy for an upcoming changes. It'll also be nice to be able to do scoped_lock() for both Mutex and Spin, but currently it's not really easy to do, need some changes in typedefs and such, will happen as a separate commit.
2016-03-31Cycles: Expose array's capacity via getter functionSergey Sharybin
This way it's possible to query capacity of an array, which then could be used for some smart re-allocation and reserve policies.
2016-03-31Cycles: Add STL allocator which uses stack memorySergey Sharybin
At this point we might want to rename allocator files to util_allocator_foo.c so the stay nicely grouped in the folder.
2016-03-31Cycles: Move non-vectorized bitscan() to utilSergey Sharybin
This way we can use bitscan() from both vectorized and non-vectorized code, which applies to both kernel and host code.
2016-03-31Cycles: Aligned vector was not covered by guarded statSergey Sharybin
This was making stats printed by the logging being wrong: they did not include such memory as BVH storage.
2016-03-25Cycles: Add an option to build single kernel only which fits current CPUSergey Sharybin
This seems quite useful for the development, so you don't need to wait all the kernels to be re-compiled when working on a new feature, which speeds up re-iteration. Marked as an advanced option, so if it doesn't work so well in practice it's safe to revert anyway.
2016-03-25Cycles: Cleanup, indent nested preprocessor directivesSergey Sharybin
Quite straightforward, main trick is happening in path_source_replace_includes(). Reviewers: brecht, dingto, lukasstockner97, juicyfruit Differential Revision: https://developer.blender.org/D1794
2016-03-23Fix T47856: Cycles problem when running from multi-byte pathSergey Sharybin
This is a mix of regression and old unsupported configuration. Regression was caused by some checks added on Blender side which was checking whether python function returned error or not. This made it impossible to enable Cycles when running from a file path which can't be encoded with MBCS codepage. Non-regression issue was that it wasn't possible to use pre-compiled CUDA kernels when running from a path with non-ascii multi-byte characters. This commit fixes regression and CUDA parts, but OSL still can't be used from a non-ascii location because it uses non-widechar API to work with file paths by the looks of it. Not sure we can solve this just from our side by using some codepage trick (UTF-16?) since even oslc fails to compile shader when there are non-ascii characters in the path.
2016-02-27Cleanup: Update Cycles standalone copyright info.Thomas Dinges
2016-02-20Cycles: Avoid re-definition of math cnstants with MSVCSergey Sharybin
2016-02-17Cycles: Don't silence unused macro, remove the macro insteadSergey Sharybin
It's not really handy to silence something unused hoping for it'll be used in the future. We can end up with quite some silencing then. Also made this flag which i find rather useless to NOT cause -Werror in Cycles code.
2016-02-17Cleanup: unused define warningCampbell Barton
2016-02-16Cycles: Some cleanup, should be no functional changesSergey Sharybin
Addressing meaningful feedback from coverity.
2016-02-16Fix T47427: Crash caused by OSLSergey Sharybin
2016-02-15Cycles: Make guarded allocator compatible with MSVC2015Sergey Sharybin
2016-02-15Cycles: Fix guarded allocator issues on WindowsSergey Sharybin
The issue was caused by static vectors allocating some internal data using rebound element allocator for them, which was causing access to a non-initialized statistics objects and was failing a lot when switching Blender to a fully guarded allocation. Additionally, we were not able to free that internal memory before Blender exits, which was causing false-positive memory leak prints. Now we're not using GuardedAllocator for those proxy containers. Ideally this should be done as a GuardedAllocator::rebind, but it didn't work for vector<bool> because it seems some internal parts are converting bool to char32_t, which either makes it so we can't use GuardedAllocator for those vectors or the compiler get's confused when we're trying explicitly allow GuardedAllocator for rebind<char32_t>. This with current approach we should be fine for the release.
2016-02-14Cycles: Fix infinite recursion of md5 calculation on WindowsSergey Sharybin
Was caused by some safety things of making sure we've for NULL terminator for the buffer when doing mbs<->wcs conversion, but it turns out this simply confuses str::string and it can no longer have proper .size(). Let's assume behavior of string allocation is same all over the std, and we can avoid having that extra null-terminator allocated.
2016-02-13Cleanup: Move Cycles sky model data to util.Thomas Dinges
2016-02-13Cycles: Fix compilation error on WindowsSergey Sharybin
2016-02-13Cycles: Fix crash caused by the guarded allocation commitSergey Sharybin
C++ requires specific alignment of the allocations which was not an issue when using GCC but uncovered issue when using Clang on OSX. Perhaps some versions of Clang might show errors on other platforms as well.
2016-02-12Cycles: Fix compilation error with MinGWSergey Sharybin
Was using some C++0 which we don't officially enabled yet.
2016-02-12Cycles: Always use guarded allocator of vectorsSergey Sharybin
We don't have vectors re-allocation happening multiple times from inside a loop anymore, so we can safely switch to a memory guarded allocator for vectors and keep track on the memory usage at various stages of rendering. Additionally, when building from inside Blender repository, Cycles will use Blender's guarded allocator, so actual memory usage will be displayed in the Space Info header. There are couple of tricky aspects of the patch: - TaskScheduler::exit() now explicitly frees memory used by `threads`. This is needed because `threads` is a static member which destructor isn't getting called on Blender's exit which caused memory leak print to happen. This shouldn't give any measurable speed issues, reallocation of that vector is only one of fewzillion other allocations happening during synchronization. - Use regular guarded malloc (not aligned one). No idea why it was made to be aligned in the first place. Perhaps some corner case tests or so. Vector was never expected to be aligned anyway. Let's see if we'll have actual bugs with this. Reviewers: dingto, lukasstockner97, juicyfruit, brecht Reviewed By: brecht Differential Revision: https://developer.blender.org/D1774
2016-02-12Cycles: Make Blender importer more forward compatibleSergey Sharybin
Basically the idea is to make code robust against extending enum options in the future by falling back to a known safe default setting when RNA is set to something unknown. While this approach solves the issues similar to T47377, but it wouldn't really help when/if any of the RNA values gets ever deprecated and removed. There'll be no simple solution to that apart from defining explicit mapping from RNA value to Cycles one. Another part which isn't so great actually is that we now have to have some enum guards and give some explicit values to the enum items, but we can live with that perhaps. Reviewers: dingto, juicyfruit, lukasstockner97, brecht Reviewed By: brecht Differential Revision: https://developer.blender.org/D1785