Age | Commit message (Collapse) | Author |
|
Using the `MEM_*` API from C++ code was a bit annoying:
* When converting C to C++ code, one often has to add a type cast on
returned `void *`. That leads to having the same type name three times
in the same line. This patch reduces the amount to two and removes the
`sizeof(...)` from the line.
* The existing alternative of using `OBJECT_GUARDED_NEW` looks a out
of place compared to other allocation methods. Sometimes
`MEM_CXX_CLASS_ALLOC_FUNCS` can be used when structs are defined
in C++ code. It doesn't look great but it's definitely better. The downside
is that it makes the name of the allocation less useful. That's because
the same name is used for all allocations of a type, independend of
where it is allocated.
This patch introduces three new functions: `MEM_new`, `MEM_cnew` and
`MEM_delete`. These cover the majority of use cases (array allocation is
not covered).
The `OBJECT_GUARDED_*` macros are removed because they are not
needed anymore.
Differential Revision: https://developer.blender.org/D13502
|
|
|
|
|
|
No functional changes.
|
|
This change transitions libmv/osd tests to our
blender_add_test_executable macro that explicitly
takes the include directories as a parameter.
This is in preparation for future clean-up of
global include directories.
Differential Revision: https://developer.blender.org/D12012
Reviewed By: sergey
|
|
|
|
Corrects incorrect usage of contraction for 'it is', when possessive 'its' was required.
Differential Revision: https://developer.blender.org/D9250
Reviewed by Campbell Barton
|
|
This makes subdivision surfaces compatible with the old subdivision
surface modifier and other applications that do not use the limit surface.
This option is available on the Subdivision Surface modifier.
Differential Revision: https://developer.blender.org/D8413
|
|
|
|
Ref {D8855}
Unix and Apple platform files use find_package(OpenSubdiv) which sets
`OPENSUBDIV_INCLUDE_DIR` as an advanced variable, as well as
`OPENSUBDIV_INCLUDE_DIRS` which should be used usually.
Windows sets `OPENSUBDIV_INCLUDE_DIR` which is used by the rest
of the code.
This patch renames it to `_DIRS` everywhere, for it to be like other
similar variables.
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D8917
|
|
This change makes it so vertices of edge are only stored when edge
has non-zero crease. This allows to lower memory footprint of 1.5M
faces from 78 MiB to 54 MiB in the case all creases are zero.
Meshes with crease are more hard to predict due to array-based
storage, so it all depends on index of edge with crease. Worst case
(all edges are creased) still stays at 78 MiB.
|
|
Makes it possible to set adjacent vertices after edge sharpness.
Initially it seemed like useful sanity check, but with time it
became rather a burden.
|
|
Avoid per-face pointer and allocation: store everything as continuous
arrays.
Memory footprint for 1.5M faces:
- Theoretical worst case (all vertices and edges have crease) memory
goes down from 114 MiB to 96 MiB (15% improvement).
This case is not currently achievable since Blender does not expose
vertex crease yet.
- Current real life worst case (all edges have crease) memory goes
down from 108 MiB to 90 MiB (17% improvement).
- Best case (no creases at all) memory goes down from 96 MiB to 78 MiB
(19% improvement).
|
|
While this looks trivial it already allowed to catch issues in one
of previous attempt to optimize memory usage. It will totally be
useful for an upcoming refactor of face topology storage.
|
|
Move all API to happen via MeshTopology.
This is a preparation for an upcoming memory optimization.
|
|
There is no need in edge map anymore.
|
|
|
|
|
|
Allows to perform comparison by doing linear comparison of indices.
Before cyclic match was used to deal with possibly changed winding from
OpenSubdiv side.
Speeds up comparison (and hence improves FPS), makes code more reliable
nut uses more memory.
|
|
This change makes it so topology refiner comparison will check vertices
of all existing/provided edges.
The initial claim that due to manifold nature of mesh there is no need
in "deep" edges check was wrong: some areas might only provide edges
with non-zero creases. So if crease of one edge goes changes from 1.0
to 0.0 and crease of other edge goes from 0.0 to 1.0 the old comparison
code would not have caught it.
|
|
Makes it easier to follow and extend.
|
|
Similar to previous change in vertex sharpness, explicitly store value
provided by the converter.
Allows to avoid rather fragile check for boundary edges.
Also allows to avoid need in constructing edge map. This lowers memory
footprint of the comparison process and avoids memory allocations
during the comparison (which is an extra benefit from the performance
point of view).
|
|
|
|
|
|
This change starts the transition of topology refiner comparison
to compare actual values given by the converter, which will not be
affected by the refinement or face winding synchronization steps.
Currently is only implemented for vertex sharpness, but will be
extended further as followup development.
Fixes T71908: Subdiv: Incorrect topology comparison, leading to poor performance
|
|
The idea is to use this explicit storage for topology comparison rather
than using base level. While this will have memory overhead it allows
to simplify comparison of such things as:
- Vertex sharpness (where base level from topology refiner will have it
refined, meaning it will be different from what application requested
for non-manifold and corner vertices).
- It will allow to simplify face-vertices comparison, where currently
O(N^2) algorithm is used due to possible difference in face winding.
- It will also allow to avoid comparison-time allocation of edge map.
Currently no functional changes, just preparing for development which
will happen next.
|
|
|
|
|
|
Also split them across utilities and types.
|
|
|
|
Avoid indirection via define.
|
|
|
|
|
|
|
|
Previously it was enabled for debug builds, now it is to be enabled
explicitly.
The reason for this is to reduce overhead when debugging other areas
which might involve subdivision surface. When conversion is to be
debugged set this manually in the code.
|
|
|
|
Consolidate it inside of the topology refiner implementation class,
which would allow to store extra data acquired during construction
of the OpenSubdiv's object.
|
|
Only use OBJECT_GUARDED_{NEW. DELETE} for structures which are part of
public C-API (and hence can not have new/delete operators overloaded).
Could try being brave and override new/delete from under C++ ifdef.
|
|
|
|
In the future factory will also be moved there.
|
|
Also, move all device files to own folder.
Makes it so checks for device availability are done in a localized
place.
|
|
This code was accidentally reintroduced in e73d7d27dc66.
|
|
|
|
Reviewers: sergey, brecht
Differential Revision: https://developer.blender.org/D7787
|
|
The code is not only part of C-API, but also implements Blender-specific
glue level implementation.
|
|
All parts of drawing (shaders, GL mesh descriptor, material partitioner
and so on) needs to be redone for the draw manager and new OpenSubdiv
library.
Removing untested code which is doomed to be replaced to make localized
refactoring easier.
|
|
The code was trying to make winding consistent and manifold, same as
OpenSubdiv expects it to.
Unfortunately, the code was having some issues in corner cases so the
winding wasn't really correct.
Fortunately, the latter (compared to when this code was originally
written) supports orientation on OpenSubdiv side.
Removing code which is currently unused in Blender and which had
known issues. Is simple enough to bring the code from Git history
if the functionality is needed in the future.
|
|
Was happening when only partial subset of callbacks was specified.
The reason was that there was a callback to specify edges sharpness
but no callback to specify vertex sharpness, so the special case for
non-manifold edges was not run.
Fixes T75697: Multires in simple mode doesn't work correct on a plane
|
|
|
|
Allow to mark individual vertices as infinitely sharp even if there is
no full topology and no access to edges: infinite sharp vertices do not
need connectivity information.
|