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
2022-02-11File headers: SPDX License migrationCampbell Barton
Use a shorter/simpler license convention, stops the header taking so much space. Follow the SPDX license specification: https://spdx.org/licenses - C/C++/objc/objc++ - Python - Shell Scripts - CMake, GNUmakefile While most of the source tree has been included - `./extern/` was left out. - `./intern/cycles` & `./intern/atomic` are also excluded because they use different header conventions. doc/license/SPDX-license-identifiers.txt has been added to list SPDX all used identifiers. See P2788 for the script that automated these edits. Reviewed By: brecht, mont29, sergey Ref D14069
2021-12-14Cleanup: reorganize doxygen modulesCampbell Barton
- Nest compositor pages under the compositor module - Nest GUI, DNA/RNA & externformats modules under Blender. - Remove modules from intern which no longer exist. - Add intern modules (atomic, eigen, glew-mx, libc_compat, locale, numaapi, rigidbody, sky, utfconv). - Use 'intern_' prefix for intern modules since some of the modules use generic terms such as locale & atomic.
2021-11-30Cleanup: remove blank lines in comment blocksCampbell Barton
2021-08-26Add locking fallback atomics implementationSergey Sharybin
Is used for platforms for which we do not have native implementation, such as MIPS, for example. It is possible to test locking implementation on local computer by defining `ATOMIC_FORCE_USE_FALLBACK` in the atomic_ops_unix.h file. Run full regression suit with the locking implementation on amd64 Linux platform and all tests passed. Having non-optimal but working implementation for odd-ball platforms seems to be a better choice than failing the build entirely. Differential Revision: https://developer.blender.org/D12313
2021-07-15Add support for RISC-V architectureHeinrich Schuchardt
* On RISC-V GCC 10.3 does not define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_n. * Avoid a build error "Please add support for your platform in build_config.h" Cf: https://github.com/sergeyvfx/libNumaAPI/pull/3 Differential Revision: https://developer.blender.org/D11910
2020-12-04Atomics: Add 16 bit fetch + AND and fetch + OR signed integer operationsJulian Eisel
I could use a 16 bit atomic fetch + AND for D9719. The alternative would be to turn a `short` into a `int` in DNA, which isn't a nice workaround. Also adds tests for the new functions.
2020-11-25Atomics: Fix missing 64bit implementation for 32bit platformsSergey Sharybin
Blender uses 64bit atomics to manipulate SessionUUID, and these atomics were not defined on any of 32bit platforms. While official support is limited to 64bit platforms only, the code should not make assumptions about bitness or endianess, in terms that there should be codepaths and fallback (or provision of them) for 32bit platforms. This change makes 64bit atomic functions defined for all platforms. The atomic_test was compiled and successfully tested on i686 and armv7l platforms. The rest of compilation process of Blender will be very tedious, so that was not done. This change is essential, but not necessarily enough to make Blender compilable on i686 (ability to compile Blender on 32bit platforms was lost during the 2.91 development). This is a functional part of original fix done by Brecht in D9577.
2020-11-25Atomics: Cleanup, move defines closer to usageSergey Sharybin
There is a special defines block needed for ARM on Linux. Move it from public header to an implementation file. No functional changes. This is a non-functional part of original fix done by Brecht in D9577.
2020-11-19Atomic: Cover with unit testsSergey Sharybin
Cover all atomic functions with unit tests. The tests are quite simple, nothing special so far. The goal is to: - Make sure implementation exists. - Implementation behaves the same way on all platforms (We had issue when MSVC and GCC were behaving differently in the past). - Proper bitness is used for implementation and non-fixed-size function implementation. The tests can be extended further to make sure, for example, that CAS operations do not cast arguments to a more narrow type for comparison. Considering it a possible further improvement, as it is better be done being focused on that specific task. There is an annoying ifdef around 64bit implementation, which uses same internal ifdef as the header does. This check is aimed to be removed, so is easier to simply accept such duplication for now. The tests seems somewhat duplicate for signed/unsigned variants and things like this. The reason for that is to keep test code as simple as possible: attempting to do something smart/tricky in the test code often causes the test code to be a subject of being covered with its own unit tests. Differential Revision: https://developer.blender.org/D9590
2020-10-19Spelling: It's Versus ItsHarley Acheson
Corrects incorrect usage of contraction for 'it is', when possessive 'its' was required. Differential Revision: https://developer.blender.org/D9250 Reviewed by Campbell Barton
2020-03-19Cleanup: `make format` after SortedIncludes changeDalai Felinto
2019-05-01Cleanup: comments (long lines) in atomicCampbell Barton
2019-04-17Cleanup: line wrapping caused by commentsCampbell Barton
2019-04-17ClangFormat: apply to source, most of internCampbell Barton
Apply clang format as proposed in T53211. For details on usage and instructions for migrating branches without conflicts, see: https://wiki.blender.org/wiki/Tools/ClangFormat
2019-02-18doxygen: add newline after \fileCampbell Barton
While \file doesn't need an argument, it can't have another doxy command after it.
2019-02-06Cleanup: remove redundant doxygen \file argumentCampbell Barton
Move \ingroup onto same line to be more compact and make it clear the file is in the group.
2019-02-02Cleanup: remove author/date info from doxy headersCampbell Barton
2019-02-01Cleanup: remove redundant, invalid info from headersCampbell Barton
BF-admins agree to remove header information that isn't useful, to reduce noise. - BEGIN/END license blocks Developers should add non license comments as separate comment blocks. No need for separator text. - Contributors This is often invalid, outdated or misleading especially when splitting files. It's more useful to git-blame to find out who has developed the code. See P901 for script to perform these edits.
2018-11-29Atomic: Avoid conflicts with definitions in other areasSergey Sharybin
While atomics library was trying to use "user-space" defined LIKELY() and UNLIKELY(), this is not always true that user code was checking for those macro coming from an unrelated area.
2018-05-28Windows: Add support for building with clang.Ray Molenkamp
This commit contains the minimum to make clang build/work with blender, asan and ninja build support is forthcoming Things to note: 1) Builds and runs, and is able to pass all tests (except for the freestyle_stroke_material.blend test which was broken at that time for all platforms by the looks of it) 2) It's slightly faster than msvc when using cycles. (time in seconds, on an i7-3370) victor_cpu msvc:3099.51 clang:2796.43 pavillon_barcelona_cpu msvc:1872.05 clang:1827.72 koro_cpu msvc:1097.58 clang:1006.51 fishy_cat_cpu msvc:815.37 clang:722.2 classroom_cpu msvc:1705.39 clang:1575.43 bmw27_cpu msvc:552.38 clang:561.53 barbershop_interior_cpu msvc:2134.93 clang:1922.33 3) clang on windows uses a drop in replacement for the Microsoft cl.exe (takes some of the Microsoft parameters, but not all, and takes some of the clang parameters but not all) and uses ms headers + libraries + linker, so you still need visual studio installed and will use our existing vc14 svn libs. 4) X64 only currently, X86 builds but crashes on startup. 5) Tested with llvm/clang 6.0.0 6) Requires visual studio integration, available at https://github.com/LazyDodo/llvm-vs2017-integration 7) The Microsoft compiler spawns a few copies of cl in parallel to get faster build times, clang doesn't, so the build time is 3-4x slower than with msvc. 8) No openmp support yet. Have not looked at this much, the binary distribution of clang doesn't seem to include it on windows. 9) No ASAN support yet, some of the sanitizers can be made to work, but it was decided to leave support out of this commit. Reviewers: campbellbarton Differential Revision: https://developer.blender.org/D3304
2017-11-23atomic_ops: add `atomic_cas_float` helper.Bastien Montagne
2017-11-23atomic_ops: Copy/adapt static assert macro from BLI_utildefines, and use it.Bastien Montagne
Checking for type sizes is much nicer with a static assert!
2017-11-23Moar attempt to fix bloody MSVC intrinsic mess...Bastien Montagne
2017-11-23Attempt to fix bloody MSVC atomic intrinsic mess...Bastien Montagne
2017-11-23atomic_ops: add char versions of uint8_t atomic primitives.Bastien Montagne
2017-11-23atomic_ops: add signed versions of primitives.Bastien Montagne
Reason is motsly that dealing with type conversion in calling code is not great, makes it less readable, and can generate hidden bugs in case original type changes and atomic primitive calls are not updated accordingly...
2017-09-25Add an 'atomic cas' wrapper for pointers.Bastien Montagne
Avoids having to repeat obfuscating castings everywhere...
2017-08-28Atomics: Use system headers directly, without bad level dependency to BLISergey Sharybin
This will make it easier to re-use library as-is in other projects, such as Cycles standalone repo for example.
2017-08-23Fix implementation of atomic update max and move to a central locationMai Lavelle
While unlikely to have had any serious effects because of limited use, the previous implementation was not actually atomic due to a data race and incorrectly coded CAS loop. We also had duplicates of this code in a few places, it's now been moved to a single location with all other atomic operations.
2017-07-27Cleanup: remove check for old GCC&PPCCampbell Barton
2017-03-01Cleanup: Use explicit unsigned int in atomicsSergey Sharybin
2016-11-15Atomics: Add some extra utility functionsSergey Sharybin
Also fixed semantic of fetch-and-add in assembler implementation, it seemed to not match the naming.
2016-11-15Atomics: Make naming more obvious about which value is being returnedSergey Sharybin
2016-11-08Atomics: Add 32 bit version of fetch and AND/ORSergey Sharybin
2016-07-19Fix building on NetBSDCampbell Barton
2016-06-11Atomic ops: Fix atomic_add_uint32 and atomic_sub_uint32 in WindowsBenoit Bolsee
The assembler version in Windows used to return the previous value of the variable while all the other versions return the new value. This is now fixed for consistency. Note: this bug had no effect on blender because no part of the code use the return value of these functions, but the future BGE DeckLink module makes use of it to implement reference counter.
2016-05-16Atomic ops: add 'fetch_and_add_uint32' op.Bastien Montagne
Needed for next commit.
2016-05-09Cleanup: header, styleCampbell Barton
2016-05-09Cleanup and refactor our atomic library.Bastien Montagne
This commit: * Removes most of all dirty internal details from public atomi_ops.h file, and move them into /intern private subdir. * Removes unused 'architectures' (__apple__ and jemalloc). * Split each implementation into its own file. * Makes use of C99's limits.h system header to determine pointer and int size, instead of using fix hardcoded list of architectures. * Introduces new 'faked' atomics ops for floats. Note that we may add a lot more real and 'faked' atomic operations over integers and floats (multiplication, division, bitshift, bitwise booleans, etc.), as needs arise. Reviewers: sergey, campbellbarton Differential Revision: https://developer.blender.org/D1982
2016-05-09Atomics: Add atomic_fetch_and_or_uint8() functionSergey Sharybin
Hopefully it compiles on all platforms still..
2016-05-02Fix compilation error on Armel architectureSergey Sharybin
__GCC_HAVE_SYNC_COMPARE_AND_SWAP_n are not defined on this architecture for some reason, however those functions are available. Adding a workaround for newly used __sync_fetch_and_and() function.
2016-01-27Atomics: Use _InterlockedAnd8 direction for 342bit MSVCSergey Sharybin
That's what MSDN tells you to do and that's how to solve the compilation error problem with it.
2016-01-27atomic_ops: add atomic_fetch_and_and_uint8 wrapper.Bastien Montagne
Needed by incomming changes in pbvh.c. Note that we make it much simpler than for other primitives in this file - think we could revise its content to make it simpler one day...
2015-07-01atomic_ops: Fix MSVC versions of add/sub returning original value instead of ↵Bastien Montagne
result of operation. Thanks to Brecht for tip about how to fix this!
2015-07-01atomic_ops: fix typo in func names (uint32 instead of uint64).Bastien Montagne
2015-05-20Atomic operations: Add function declarations at the top of the headerSergey Sharybin
No functional changes, just helps grasping what operations are actually supported.
2014-12-02Fixes for atomic operations when building with MSVCSergey Sharybin
2014-09-26Fix build errors in atomic ops and warning in aligned malloc on OS X.Brecht Van Lommel
2014-09-25Atomics: Add CAS (compare-and-swap) functionsSergey Sharybin
2014-07-25Fix atomix operations on unofficial 64bit archsMatteo F. Vescovi