Age | Commit message (Collapse) | Author |
|
To use function style cast '(unsigned char)x' can't be replaced by
'unsigned char(x)'.
|
|
|
|
This is already the case for most CMake usage.
Although some find modules are an exception to this, as they were
originally maintained externally they use some different conventions.
Also corrected bad indentation in: intern/cycles/CMakeLists.txt
|
|
Warning: P3204.
|
|
Switch to target_ functions to avoid this.
|
|
Returns a new range, that contains the intersection of the current one
with the given range.
This is helpful to select a portion of a range without having to deal with
all the asserts of other functions. The resulting range being always a
valid subrange, it can be used to iterate or copy a part of a vector.
|
|
Also note that leading slashes are kept in the doc-string.
|
|
This patch implements the pixelate node for the realtime compositor.
Differential Revision: https://developer.blender.org/D15662
Reviewed By: Clement Foucault
|
|
|
|
This adds a new `blender::BitVector` data structure that was requested
a couple of times. It also replaces usages of `BLI_bitmap` in C++ code.
See the comment in `BLI_bit_vector.hh` for more details about the
advantages and disadvantages of using a bit-vector and how the new
data structure compares to `std::vector<bool>` and `BLI_bitmap`.
Differential Revision: https://developer.blender.org/D14006
|
|
A `blender::Pool` can construct and destruct elements without reordering. Freed items memory
will be reused by next allocations.
Elements are allocated in chunks to reduce memory fragmentation and avoid reallocation.
Reviewed By: JacquesLucke
Differential Revision: https://developer.blender.org/D15894
|
|
|
|
Commit 310be2e37cfb did not update UI_MENU_ARROW_SEP used in tests.
|
|
This is a quite interesting case, where two arguments to a function are
evaluated in different order on Apple Clang than on GCC and I guess
MSVC. Left a comment on that.
|
|
|
|
When plotting equally distant points around a circle support an extra
axis of symmetry so twice as many exact values are repeated than
originally added in [0], see code-comments for a detailed explanation.
Tests to ensure accuracy and exact symmetry have been added too.
Follow up on fix for T87779.
[0]: 087f27a52f7857887e90754d87a7a73715ebc3fb
|
|
Also remove an unused include and add a comment,
const, use the math namespace.
|
|
|
|
This commit ports the fillet curves node to the new curves data-block,
and moves the fillet node implementation to the geometry module to help
separate the implementation from the node.
The changes are similar to the subdivide node or resample node. I've
resused common utilities where it makes sense, though some things like
the iteration over attributes can be generalized further. The node
is now multi-threaded per-curve and inside each curve, and some buffers
are reused per curve to avoid many allocations.
The code is more explicit now, and though there is more boilerplate to
pass around many spans, the more complex logic should be more readable.
Differential Revision: https://developer.blender.org/D15346
|
|
In preparation for a larger change (D14162), some BLI_bitmap
functionality that could be submitted separately:
- Ability to declare a fixed size bitmap by-value, without extra
memory allocation: BLI_BITMAP_DECLARE
- Function to find the index of lowest unset bit:
BLI_bitmap_find_first_unset
- Test coverage of the above.
Reviewed By: Campbell Barton, Bastien Montagne
Differential Revision: https://developer.blender.org/D15454
|
|
`GSpan` and spans based on virtual arrays were not default constructible
before, which made them hard to use sometimes. It's generally fine for
spans to be empty.
The main thing the keep in mind is that the type pointer in `GSpan` may
be null now. Generally, code receiving spans as input can assume that
the type is not-null, but sometimes that may be valid. The old #type() method
that returned a reference to the type still exists. It asserts when the
type is null.
|
|
This refactor had two main goals:
* Simplify the sampling code by using an algorithm with fewer special cases.
* Generalize the sampling to support non-sorted samples.
The `SampleSegmentHint` optimization was inspired by `ValueAccessor` from
OpenVDB and improves performance 2x in my test cases.
Differential Revision: https://developer.blender.org/D15348
|
|
* Make the class names more consistent.
* Implement missing move-constructors and assignment-operators.
|
|
This makes it possible to use this method with `std::unique_ptr`.
|
|
Mainly duplicate includes and else after return.
|
|
Differential Revision: https://developer.blender.org/D15220
|
|
srgb_to_linearrgb_v3_v3 is using an approximation of powf that is
SIMD. However, while the accuracy of it is ok, a larger issue is that
it produces different results on Intel compared to ARM architectures.
On ARM (e.g. AppleSilicon), the result of the SIMD code path is much
closer to the reference implementation. This seems to be because of
_mm_rsqrt_ps usage in _bli_math_fastpow512. The ARM/NEON code path
emulates inverse square root with a combination of vrsqrteq_f32
followed by two Newton-Raphson iterations, because blender uses the
SSE2NEON_PRECISE_SQRT define.
This commit adds similar NR iterations to the "actual SSE" code path
as well.
Max error of srgb->linear->srgb conversion roundtrip goes from
0.000211 down to about 0.000062.
Reviewed By: Sergey Sharybin
Differential Revision: https://developer.blender.org/D15193
|
|
The generic bounds utility used an incorrect initial value. The value
cannot be zero-initialized, because that breaks the case where all
values are greater than zero.
|
|
I took the decision to assert on unexpected value as the behavior of these
functions are not consistent across the whole integer domain.
|
|
Replace some `if/else if` chains by proper `switch` statement.
Replace some `BLI_assert(0)` calls by `BLI_assert_unreachable()` ones.
|
|
This is useful without any functionality specific to attribute domains,
rename to `BLI_str_format_decimal_unit` to follow naming of a similar
function `BLI_str_format_byte_unit`.
|
|
D14918 from @linux_dr with some other changes included.
|
|
GPU code used `sz` as an abbreviation for size, as well as a few other
places. Use size where this represents a size in bytes, see: T85728.
|
|
This patch adds a float3x3 class that represents a 3x3 matrix. The class
can be used to represent a 2D affine transformation stored in a 3x3
matrix in column major order. The class provides various constructors
and processing methods, which utilizes the existing mat3 utilities in
BLI. Corresponding tests were also added.
This is needed by the upcoming viewport compositor to represent domain
transformations.
Reviewed By: fclem
Differential Revision: https://developer.blender.org/D14687
|
|
Differential Revision: https://developer.blender.org/D14745
|
|
The ported normal calculation from ceed37fc5cbb466a0 neglected to
use the tilt attribute to rotate the normals around the tangents.
This commit adds that behavior back, adding a new math header file
to avoid duplicating the rotation function for normalized axes.
Differential Revision: https://developer.blender.org/D14655
|
|
lengths along a set of points. This can be used for the sample curves
node, or finding new points along a curve when extending
or shrinking it.
This commit uses it in the snake hook brush as an example.
The logic is similar to the uniform length sampling, but the next
sample length is retrieved from the input instead of multiplication.
For the sample node in the future, though this sort of sampling can be
potentially done more efficiently for specific curve types besides
poly curves, it's simpler, at least as a start, to work on a set of
evaluated points that can be treated like a poly curve.
Differential Revision: https://developer.blender.org/D14571
|
|
This does two things:
* Introduce new `materialize_compressed` methods. Those are used
when the dst array should not have any gaps.
* Add materialize methods in various classes where they were missing
(and therefore caused overhead, because slower fallbacks had to be used).
|
|
|
|
Also replace "num" with:
- "number" when it's not used to denote the number of items.
- "digits" when digits in a string are being manipulated.
|
|
This commit adds calculation of lengths along the curve for each
evaluated point. This is used for sampling, resampling, the "curve
parameter" node, and potentially more places in the future.
This commit also includes a utility for calculation of uniform samples
in blenlib. It can find evenlyspaced samples along a sequence of points
and use linear interpolation to move data from those points to the
samples. Making the utility more general aligns better with the more
functional approach of the new curves code and makes the behavior
available elsewhere.
A "color math" header is added to allow very basic interpolation
between two colors in the `blender::math` namespace.
Differential Revision: https://developer.blender.org/D14382
|
|
Value initialization differs from default-construction in that it
also zero-initializes trivial types.
|
|
In order to allow interpolation of integers with a float, add a separate
template parameter for the factor and multiplication types.
Also move some helper constexpr variables to the "base" header
(reversing the dependency to "base" -> "vector").
This also adds a distance function for scalar types, which is
helpful to allow sharing code between vectors and basic types.
Differential Revision: https://developer.blender.org/D14446
|
|
Follow conventions from T85728.
|
|
|
|
Previously, the conversion was done manually for a fixed set of types.
Now, there is a more general utility that can be used in other contexts
(outside of geometry nodes attribute processing) as well.
|
|
This is a follow up to rB2252bc6a5527cd7360d1ccfe7a2d1bc640a8dfa6.
|
|
For more detail about `CPPType`, see `BLI_cpp_type.hh` and D14367.
Differential Revision: https://developer.blender.org/D14367
|
|
Use <pre>..</pre> for pseudo-code.
|
|
Contributed by luzpaz.
Differential Revision: https://developer.blender.org/D14306
|