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
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2022-02-16 20:32:37 +0300
committerHans Goudey <h.goudey@me.com>2022-02-16 20:32:37 +0300
commitc324cf153924ae2ec5b7c59eabff71652847aeae (patch)
treef12f07ed61b018481e4bc45a7687567c48c952aa /source/blender/draw/intern/draw_cache_impl_curves.cc
parent5b73017ddb679bb050fe13e4d9e3e5b04ea559b9 (diff)
Curves: Further implementation of new curves data structure
The general idea here is to wrap the `CurvesGeometry` DNA struct with a C++ class that can do most of the heavy lifting for the curve geometry. Using a C++ class allows easier ways to group methods, easier const correctness, and code that's more readable and faster to write. This way, it works much more like a version of `CurveEval` that uses more efficient attribute storage. This commit adds the structure of some yet-to-be-implemented code, the largest thing being mutexes and vectors meant to hold lazily calculated evaluated positions, tangents, and normals. That part might change slightly, but it's helpful to be able to see the direction this commit is aiming in. In particular, the inherently single-threaded accumulated lengths and Bezier evaluated point offsets might be cached. Ref T95355 Differential Revision: https://developer.blender.org/D14054
Diffstat (limited to 'source/blender/draw/intern/draw_cache_impl_curves.cc')
-rw-r--r--source/blender/draw/intern/draw_cache_impl_curves.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/draw/intern/draw_cache_impl_curves.cc b/source/blender/draw/intern/draw_cache_impl_curves.cc
index a779c694cd2..2153b674463 100644
--- a/source/blender/draw/intern/draw_cache_impl_curves.cc
+++ b/source/blender/draw/intern/draw_cache_impl_curves.cc
@@ -22,7 +22,7 @@
#include "DNA_curves_types.h"
#include "DNA_object_types.h"
-#include "BKE_curves.h"
+#include "BKE_curves.hh"
#include "GPU_batch.h"
#include "GPU_material.h"
@@ -133,7 +133,7 @@ static void curves_batch_cache_fill_segments_proc_pos(Curves *curves,
{
/* TODO: use hair radius layer if available. */
const int curve_size = curves->geometry.curve_size;
- Span<int> offsets{curves->geometry.offsets, curves->geometry.curve_size + 1};
+ Span<int> offsets{curves->geometry.curve_offsets, curves->geometry.curve_size + 1};
Span<float3> positions{(float3 *)curves->geometry.position, curves->geometry.point_size};
@@ -216,7 +216,7 @@ static void curves_batch_cache_fill_strands_data(Curves *curves,
GPUVertBufRaw *seg_step)
{
const int curve_size = curves->geometry.curve_size;
- Span<int> offsets{curves->geometry.offsets, curves->geometry.curve_size + 1};
+ Span<int> offsets{curves->geometry.curve_offsets, curves->geometry.curve_size + 1};
for (const int i : IndexRange(curve_size)) {
const IndexRange curve_range(offsets[i], offsets[i + 1] - offsets[i]);