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
2021-04-01BLI: rename resource collector to resource scopeJacques Lucke
Differential Revision: https://developer.blender.org/D10857
2021-03-28Cleanup: use parentheses in macroJacques Lucke
2021-03-25BLI: simplify using DefaultHashJacques Lucke
2021-03-22Functions: devirtualize virtual arrays in simple functionsJacques Lucke
In some multi-functions (such as a simple add function), the virtual method call overhead to access array elements adds significant overhead. For these simple functions it makes sense to generate optimized versions for different types of virtual arrays. This is done by giving the compiler all the information it needs to devirtualize virtual arrays. In my benchmark this speeds up processing a lot of data with small function 2-3x. This devirtualization should not be done for larger functions, because it increases compile time and binary size, while providing a negilible performance benefit.
2021-03-22Fix build error on macOS/clangBrecht Van Lommel
2021-03-22Functions: make multi functions smaller and cheaper to construct in many casesJacques Lucke
Previously, the signature of a `MultiFunction` was always embedded into the function. There are two issues with that. First, `MFSignature` is relatively large, because it contains multiple strings and vectors. Secondly, constructing it can add overhead that should not be necessary, because often the same signature can be reused. The solution is to only keep a pointer to a signature in `MultiFunction` that is set during construction. Child classes are responsible for making sure that the signature lives long enough. In most cases, the signature is either embedded into the child class or it is allocated statically (and is only created once).
2021-03-21Cleanup: compile errors on macosJacques Lucke
2021-03-21Functions: refactor virtual array data structuresJacques Lucke
When a function is executed for many elements (e.g. per point) it is often the case that some parameters are different for every element and other parameters are the same (there are some more less common cases). To simplify writing such functions one can use a "virtual array". This is a data structure that has a value for every index, but might not be stored as an actual array internally. Instead, it might be just a single value or is computed on the fly. There are various tradeoffs involved when using this data structure which are mentioned in `BLI_virtual_array.hh`. It is called "virtual", because it uses inheritance and virtual methods. Furthermore, there is a new virtual vector array data structure, which is an array of vectors. Both these types have corresponding generic variants, which can be used when the data type is not known at compile time. This is typically the case when building a somewhat generic execution system. The function system used these virtual data structures before, but now they are more versatile. I've done this refactor in preparation for the attribute processor and other features of geometry nodes. I moved the typed virtual arrays to blenlib, so that they can be used independent of the function system. One open question for me is whether all the generic data structures (and `CPPType`) should be moved to blenlib as well. They are well isolated and don't really contain any business logic. That can be done later if necessary.
2021-03-21Functions: move CPPType creation related code to separate headerJacques Lucke
This does not need to be included everywhere, because it is only needed in very few translation units that actually define CPPType's.
2021-03-21Cleanup: use static local variablesCampbell Barton
2021-03-08Geometry Nodes: support Vector Rotate nodeLeon Leno
Differential Revision: https://developer.blender.org/D10410
2021-03-07Geometry Nodes: simplify allocating dynamically sized buffer on stackJacques Lucke
2021-03-07Cleanup: remove dead codeJacques Lucke
2021-03-07Cleanup: compiler warningsJacques Lucke
2021-03-07BLI: make it harder to forget to destruct a valueJacques Lucke
Instead of returning a raw pointer, `LinearAllocator.construct(...)` now returns a `destruct_ptr`, which is similar to `unique_ptr`, but does not deallocate the memory and only calls the destructor instead.
2021-02-20Cleanup: doxygen sectionsCampbell Barton
2021-02-18Cleanup: return const reference instead of copyJacques Lucke
There isn't really a reason for why this has to return a copy of the data instead of a reference.
2021-02-04Geometry Nodes: new Is Viewport nodeJacques Lucke
This node outputs true when geometry nodes is currently evaluated for the viewport and false for final renders. Ref T85277. Differential Revision: https://developer.blender.org/D10302
2021-01-14Geometry Nodes: don't delete existing attribute before new attribute is computedJacques Lucke
This fixes the behavior of some nodes when the same attribute name is used for input and output. If both attributes have a different type, they can't exist at the same time. Therefore, the input attribute has to be removed in order to create the output attribute. Previously, the input attribute was remove before it was used in any computations. Now, the output is written to a temporary buffer and only later saved in the geometry component. This allows both attributes to coexist within the node. The temporary attribute is only create when necessary. The normal case without name collisions still works the same as before. Differential Revision: https://developer.blender.org/D10109 Ref T83793.
2020-12-18Functions: add generic pointer class for const pointersJacques Lucke
This adds a GPointer class, which is mostly the same as GMutablePointer. The main difference is that GPointer references const data, while GMutablePointer references non-const data.
2020-12-02Geometry Nodes: initial scattering and geometry nodesJacques Lucke
This is the initial merge from the geometry-nodes branch. Nodes: * Attribute Math * Boolean * Edge Split * Float Compare * Object Info * Point Distribute * Point Instance * Random Attribute * Random Float * Subdivision Surface * Transform * Triangulate It includes the initial evaluation of geometry node groups in the Geometry Nodes modifier. Notes on the Generic attribute access API The API adds an indirection for attribute access. That has the following benefits: * Most code does not have to care about how an attribute is stored internally. This is mainly necessary, because we have to deal with "legacy" attributes such as vertex weights and attributes that are embedded into other structs such as vertex positions. * When reading from an attribute, we generally don't care what domain the attribute is stored on. So we want to abstract away the interpolation that that adapts attributes from one domain to another domain (this is not actually implemented yet). Other possible improvements for later iterations include: * Actually implement interpolation between domains. * Don't use inheritance for the different attribute types. A single class for read access and one for write access might be enough, because we know all the ways in which attributes are stored internally. We don't want more different internal structures in the future. On the contrary, ideally we can consolidate the different storage formats in the future to reduce the need for this indirection. * Remove the need for heap allocations when creating attribute accessors. It includes commits from: * Dalai Felinto * Hans Goudey * Jacques Lucke * Léo Depoix
2020-12-02Functions: add float2 cpp typeJacques Lucke
This also adds a hash function for `float2`, because `CPPType` expects that currently.
2020-12-02Functions: add generic pointer classJacques Lucke
This class represents a pointer whose type is only known at runtime.
2020-12-02Functions: add move operations to CPPTypeJacques Lucke
Those are sometimes needed when dealing with c++ types in a generic way.
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-09-15Cleanup: add missing headers to CMake, formattingCampbell Barton
2020-08-19Fix warning from narrowing conversionJacques Lucke
2020-08-07Cleanup: use C++ style casts in various placesJacques Lucke
2020-08-07Cleanup: Clang-Tidy else-after-return fixesSybren A. Stüvel
This addresses warnings from Clang-Tidy's `readability-else-after-return` rule. This should be the final commit of the series of commits that addresses this particular rule. No functional changes.
2020-08-07Merge branch 'blender-v2.90-release' into masterJacques Lucke
2020-08-07Code Style: use "#pragma once" in source directoryJacques Lucke
This replaces header include guards with `#pragma once`. A couple of include guards are not removed yet (e.g. `__RNA_TYPES_H__`), because they are used in other places. This patch has been generated by P1561 followed by `make format`. Differential Revision: https://developer.blender.org/D8466
2020-08-05Functions: fix multi function testJacques Lucke
There were two issues. First, I made a mistake when I switched from unsigned to signed integers. Second, two classes with the same name were defined in separate files. Those classes are in an anonymus namespace now, so that they don't leak into other files.
2020-08-02Particles: new Age Reached Event, Kill Particle and Random Float nodeJacques Lucke
The hardcoded age limit is now gone. The behavior can be implemented with an Age Reached Event and Kill Particle node. Other utility nodes to handle age limits of particles can be added later. Adding an Age Limit attribute to particles on birth will be useful for some effects, e.g. when you want to control the color or size of a particle over its life time. The Random Float node takes a seed currently. Different nodes will produce different values even with the same seed. However, the same node will generate the same random number for the same seed every time. The "Hash" of a particle can be used as seed. Later, we'd want to have more modes in the node to make it more user friendly. Modes could be: Per Particle, Per Time, Per Particle Per Time, Per Node Instance, ... Also a Random Vector node will be useful, as it currently has to be build using three Random Float nodes.
2020-07-27Functions: add some tests for virtual spansJacques Lucke
2020-07-27Particles: initial support for events and actionsJacques Lucke
The following nodes work now (although things can still be improved of course): Particle Birth Event, Praticle Time Step Event, Set Particle Attribute and Execute Condition. Multiple Set Particle Attribute nodes can be chained using the "Execute" sockets. They will be executed from left to right.
2020-07-26Functions: move tests closer to codeJacques Lucke
2020-07-24Cleanup: can use guarded instead of raw allocator nowJacques Lucke
2020-07-24BLI: add MultiValueMapJacques Lucke
This is a convenience wrapper for `Map<Key, Vector<Value>>`. It does not provide any performance benefits (yet). I need this kind of map in a couple of places and before I was duplicating the lookup logic in many places.
2020-07-23Cleanup: unify naming between different spansJacques Lucke
2020-07-23Particles: improve mesh emitterJacques Lucke
Particles are now emitted from vertices of the mesh.
2020-07-22Cleanup: spellingCampbell Barton
2020-07-21Particles: initial object socket and emitter node supportJacques Lucke
Object sockets work now, but only the new Object Transforms and the Particle Mesh Emitter node use it. The emitter does not actually use the mesh surface yet. Instead, new particles are just emitted around the origin of the object. Internally, handles to object data blocks are passed around in the network, instead of raw object pointers. Using handles has a couple of benefits: * The caller of the function has control over which handles can be resolved and therefore limit access to specific data. The set of data blocks that is accessed by a node tree should be known statically. This is necessary for a proper integration with the dependency graph. * When the pointer to an object changes (e.g. after restarting Blender), all handles are still valid. * When an object is deleted, the handle is invalidated without causing crashes. * The handle is just an integer that can be stored per particle and can be cached easily. The mapping between handles and their corresponding data blocks is stored in the Simulation data block.
2020-07-20BLI: add typedefs for containers that use raw allocatorsJacques Lucke
Those are useful when you have to create containers with static storage duration. If those would use Blender's guarded allocator, it would report memory leaks, that are not actually leaks.
2020-07-20Particles: support removing particles during the simulationJacques Lucke
This still cannot be controlled by the user. Currently, all particles are killed after two seconds
2020-07-20Refactor: Update integer type usageJacques Lucke
This updates the usage of integer types in code I wrote according to our new style guides. Major changes: * Use signed instead of unsigned integers in many places. * C++ containers in blenlib use `int64_t` for size and indices now (instead of `uint`). * Hash values for C++ containers are 64 bit wide now (instead of 32 bit). I do hope that I broke no builds, but it is quite likely that some compiler reports slightly different errors. Please let me know when there are any errors. If the fix is small, feel free to commit it yourself. I compiled successfully on linux with gcc and on windows.
2020-07-18Simulation: cleanup deduplicating attribute input nodesJacques Lucke
2020-07-17Cleanup: avoid static initialization order issues when accessing CPPTypesJacques Lucke
Instead of depending on static initialization order of globals use static variables within functions. Those are initialized on first use. This is every so slighly less efficient, but avoids a full class of problems.
2020-07-16Nodes: support default function for partially implemented nodesJacques Lucke
2020-07-16Cleanup: missing CMake headers from source listsCampbell Barton
2020-07-13Cleanup: fix clang tidy warningJacques Lucke
The code was actually correct, but clang tidy complaint about using the Vector after it was moved from.