Blender V5.3
draw_cache_impl_gsplat.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2026 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
25
26#include <cstring>
27
28#include <fmt/format.h>
29
30#include "BLI_array_utils.hh"
31#include "BLI_bounds.hh"
32#include "BLI_color_types.hh"
33#include "BLI_math_vector.hh"
34#include "BLI_task.hh"
35
36#include "DNA_object_types.h"
38#include "DNA_userdef_types.h"
39
40#include "BKE_attribute.hh"
41#include "BKE_material.hh"
42#include "BKE_pointcloud.hh"
43
44#include "GPU_batch.hh"
45#include "GPU_material.hh"
46#include "GPU_uniform_buffer.hh"
47
48#include "DRW_render.hh"
49
50#include "draw_attributes.hh"
51#include "draw_cache_impl.hh"
52#include "draw_cache_inline.hh"
53#include "draw_gsplat_private.hh" /* own include */
54#include "draw_shader_shared.hh"
55
56namespace blender::draw {
57
58/* Draw module and real-time engines (EEVEE, Overlay, Workbench) use max
59 * 3 spherical harmonics degrees for performance and memory reasons. */
61
62/* Nr. of coefficients matching 3 degree spherical harmonics. */
64
65/* Sane defaults for missing but non-zero attribute data. */
66constexpr float value_scale_default = 1e-2f;
67constexpr float value_opacity_default = 0.5f;
68
69namespace detail {
70
75{
76 const int max_index = mask.min_array_size();
77 GPUIndexBufBuilder builder;
78 GPU_indexbuf_init(&builder, GPU_PRIM_POINTS, mask.size(), max_index);
80 mask.to_indices<int>(data.cast<int>());
81 GPU_indexbuf_build_in_place_ex(&builder, 0, max_index, false, &ibo);
82}
83
90{
91 float w = q.w;
92 float a = 1.0f - w * w;
93 float b = 1.0f / sqrt(a + 1.0e-8f);
94 float k = a * b;
95 float s = (2.0f / M_PI) * atan(k / w) * b;
96 return s * float3(q);
97}
98
115 const float3 &bounded_log_scale,
116 bool log_scale_is_zero,
117 const math::Quaternion &rotation,
118 float opacity)
119{
120 /* Quantize mean to `pu`: 3x22b. */
121 uint3 pu = static_cast<uint3>(math::round(bounded_mean * ((1 << 22) - 1u)));
122 /* Quantize scaling to `su`: 3x9b. Note that 0 is reserved. */
123 uint3 su = log_scale_is_zero ?
124 uint3(0u) :
125 (static_cast<uint3>(math::round(bounded_log_scale * 510.0f)) + 1u);
126 /* Quantize opacity to `au`, 1x8b. */
127 uint au = static_cast<uint>(math::round(clamp(opacity, 0.0f, 1.0f) * 255.0f));
128 /* Quantize rotation to `ru`: 3x9b.
129 * Note that we shuffle quaternion `wxyz` to `xyzw` for consistency inside draw shaders. */
130 float4 q = math::normalize(float4(rotation.x, rotation.y, rotation.z, rotation.w));
131 if (q.w < 0.0f) {
132 q = -q;
133 }
134 float3 vr = math::clamp((pack_quaternion_4_to_3(q) + 1.0f) * 0.5f, 0.0f, 1.0f);
135 uint3 ru = static_cast<uint3>(math::round(vr * 511.0f));
136
137 /* Now for the fun part: pack quantized data to 4 words. */
138 uint4 w;
139 w.x = /* 22b */ (pu.x & 0x3FFFFFu) |
140 /* 10b */ ((pu.y & 0x0003FFu) << 22);
141 w.y = /* 12b */ ((pu.y >> 10) & 0x000FFFu) |
142 /* 20b */ ((pu.z & 0x0FFFFFu) << 12);
143 w.z = /* 02b */ ((pu.z >> 20) & 0x000003u) |
144 /* 09b */ ((ru.x & 0x0001FFu) << 2) |
145 /* 09b */ ((ru.y & 0x0001FFu) << 11) |
146 /* 09b */ ((ru.z & 0x0001FFu) << 20) |
147 /* 03b */ ((su.x & 0x000007u) << 29);
148 w.w = /* 06b */ ((su.x >> 3) & 0x00003Fu) |
149 /* 09b */ ((su.y & 0x0001FFu) << 6) |
150 /* 09b */ ((su.z & 0x0001FFu) << 15) |
151 /* 08b */ ((au & 0x0000FFu) << 24);
152 return w;
153}
154
158static_assert(sizeof(RadiancePack) == 48ul);
159
176{
177 RadiancePack pack;
178 for (uint32_t i = 0u; i < radiance_coeffs_max; ++i) {
179 /* Quantize float3 coefficients to 3x8b. */
180 uchar3 shu = static_cast<uchar3>(
181 math::round(math::clamp(radiance_sh[i] * 255.0f, 0.0f, 255.0f)));
182 /* Coefficients are stored in packs with a padding byte every 15 bytes.
183 * This simplifies unpacking shader-side, until we find more data to pack in. */
184 uchar3 *shu_data = reinterpret_cast<uchar3 *>(pack.radiance_sh + (3 * i));
185 *shu_data = shu;
186 }
187 return pack;
188}
189
195 const bke::AttributeAccessor &attributes)
196{
198 for (uint i = 0; i < (radiance_coeffs_max - 1); ++i) {
199 VArraySpan<float3> array_i = *attributes.lookup<float3>(fmt::format("radiance:sh_{}", i));
200 if (array_i.is_empty()) {
201 /* If a coefficient does not exist, we can stop reading. */
202 break;
203 }
204 arrays.append(std::move(array_i));
205 }
206 return arrays;
207}
208
209} // namespace detail
210
211/* -------------------------------------------------------------------- */
214
216{
217 /* Accessors over attributes. Arrays are default-initialized to values s.t. missing or invalid
218 * scale/rotation/radiance do not cause rendering to fail, instead falling back to defaults.*/
219 const bke::AttributeAccessor attributes = pointcloud.attributes();
220 const Span<float3> mean = pointcloud.positions();
221 const VArray<float3> exp_scale = *attributes.lookup_or_default<float3>(
223 const VArray<math::Quaternion> quaternion = *attributes.lookup_or_default<math::Quaternion>(
225 const VArray<float4> radiance_base = *attributes.lookup_or_default<float4>(
226 "radiance:base", bke::AttrDomain::Point, float4(0.0f, 0.0f, 0.0f, value_opacity_default));
227 const Vector<VArraySpan<float3>> radiance_sh = detail::read_radiance_sh_attributes(attributes);
228
229 /* An activation function `exp(x)` is typically applied to scaling coefficients before rendering,
230 * as the scale data comes directly from the fitting process. We strip this function for packing
231 * and re-apply it when unpacking shader-side. Note that 0 is a valid input through attributes,
232 * but as ln(0) is undefined we instead pack an epsilon. */
233 static constexpr float zero_log_scale = -1e6f;
234 Array<float3> scale(exp_scale.size());
235 threading::parallel_for(exp_scale.index_range(), 4096, [&](IndexRange range) {
236 for (const int i : range) {
237 scale[i] = math::is_any_zero(exp_scale[i]) ? float3(zero_log_scale) :
238 math::log(math::abs(exp_scale[i]));
239 }
240 });
241 /* Determine scale data boundaries; exclude zero scales as their packed epsilon would stretch
242 * quantization to an extreme. */
243 std::optional<Bounds<float3>> splat_scale_bounds_opt;
244 for (const float3 &value : scale) {
245 if (value.x == zero_log_scale) {
246 continue;
247 }
248 splat_scale_bounds_opt = splat_scale_bounds_opt ?
249 bounds::merge(*splat_scale_bounds_opt, Bounds<float3>(value)) :
250 Bounds<float3>(value);
251 }
252
253 /* Obtain data boundaries; we quantize uploaded data such that it lies within [0, 1]. */
254 Bounds<float3> splat_mean_bounds = pointcloud.bounds_min_max(false).value_or(Bounds<float3>());
255 Bounds<float3> splat_scale_bounds = splat_scale_bounds_opt.value_or(Bounds<float3>());
256 auto radiance_rgba_bounds = bounds::min_max(radiance_base).value_or(Bounds<float4>());
257 /* Omit opacity, which is packed with Gaussian data and clamped to lie in [0, 1]. */
258 Bounds<float3> radiance_base_bounds = Bounds(radiance_rgba_bounds.min.xyz(),
259 radiance_rgba_bounds.max.xyz());
260 Bounds<float3> radiance_sh_bounds = Bounds<float3>(float3(0.0f));
261 for (const VArraySpan<float3> &radiance_sh_i : radiance_sh) {
262 if (auto bounds = bounds::min_max(radiance_sh_i); bounds.has_value()) {
263 /* Accumulate sh degrees 1-3 into bounds. */
264 radiance_sh_bounds = bounds::merge(radiance_sh_bounds, *bounds);
265 }
266 }
267
268 /* Scaling range helpers to quantize values inside the data boundaries to [0, 1]. */
269 ScalingRange splat_mean_range = {.range_add = splat_mean_bounds.min,
270 .range_mul = splat_mean_bounds.size()};
271 ScalingRange splat_scale_range = {.range_add = splat_scale_bounds.min,
272 .range_mul = splat_scale_bounds.size()};
273 ScalingRange radiance_base_range = {.range_add = radiance_base_bounds.min,
274 .range_mul = radiance_base_bounds.size()};
275 ScalingRange radiance_sh_range = {.range_add = radiance_sh_bounds.min,
276 .range_mul = radiance_sh_bounds.size()};
277
278 /* Place range helpers in a UBO for unpacking quantized data shader-side. */
279 GSplatInfos ubo_data = {.splat_mean_range = splat_mean_range,
280 .splat_scale_range = splat_scale_range,
281 .radiance_base_range = radiance_base_range,
282 .radiance_sh_range = radiance_sh_range};
283 GPU_uniformbuf_update(infos_buf, &ubo_data);
284
285 /* Gaussian shape and radiance data is packed into uint4 and uint4x3 buffers respectively. */
287 shape_data_buf->init(gpu::GenericVertexFormat<uint4>::format(), usage_flag);
288 shape_data_buf->allocate(mean.size());
289 radiance_data_buf->init(gpu::GenericVertexFormat<uint4>::format(), usage_flag);
290 radiance_data_buf->allocate(mean.size() * 3);
291
292 /* Pack Gaussian shape data to a uint4 span. */
293 MutableSpan shape_span = shape_data_buf->data<uint4>();
294 threading::parallel_for(shape_span.index_range(), 4096, [&](IndexRange range) {
295 for (const int i : range) {
296 const float3 value_mean = splat_mean_range.scale_to_unit(mean[i]);
297 const float3 value_scale = splat_scale_range.scale_to_unit(scale[i]);
298 const bool log_scale_is_zero = math::is_equal(scale[i], float3(zero_log_scale));
299
300 shape_span[i] = detail::pack_gaussian(
301 value_mean, value_scale, log_scale_is_zero, quaternion[i], radiance_base[i].w);
302 }
303 });
304
305 /* Pack SH coefficients to 3x uint4 span. Missing coefficients are default-initialized. */
306 MutableSpan radiance_span = radiance_data_buf->data<detail::RadiancePack>();
307 const float3 radiance_sh_default = radiance_sh_range.scale_to_unit(float3(0.0f));
308 threading::parallel_for(radiance_span.index_range(), 4096, [&](IndexRange range) {
309 for (const int i : range) {
310 Array<float3, radiance_coeffs_max> value_radiance(radiance_coeffs_max, radiance_sh_default);
311 value_radiance[0] = radiance_base_range.scale_to_unit(radiance_base[i].xyz());
312 for (uint j = 0; j < radiance_sh.size(); ++j) {
313 value_radiance[j + 1] = radiance_sh_range.scale_to_unit(radiance_sh[j][i]);
314 }
315 radiance_span[i] = detail::pack_radiance(value_radiance);
316 }
317 });
318}
319
321{
322 const bke::AttributeAccessor attributes = pointcloud.attributes();
323 const VArray selection = *attributes.lookup_or_default<bool>(
324 ".selection", bke::AttrDomain::Point, true);
325
326 IndexMaskMemory memory;
327 const IndexMask mask = IndexMask::from_bools(selection, memory);
328 if (mask.is_empty()) {
329 return;
330 }
332}
333
334void GSplatEvalCache::ensure_attribute(PointCloud &pointcloud, int attrib_i)
335{
336 gpu::VertBuf &attr_buf = *attributes_buf[attrib_i];
337 const StringRef attr_name = attr_used[attrib_i];
338
339 /* TODO(@kevindietrich): float4 is used for scalar attributes as the conversion done
340 * by OpenGL to float4 for a scalar `s` will produce a `float4(s, 0, 0, 1)`. However,
341 * following the Blender convention, it should be `float4(s, s, s, 1)`. This could be
342 * resolved using a similar texture state swizzle to map the attribute correctly as
343 * for volume attributes, so we can control the conversion ourselves. */
344 const bke::AttributeAccessor attributes = pointcloud.attributes();
346 attr_name, bke::AttrDomain::Point, {0.0f, 0.0f, 0.0f, 1.0f});
347
348 static const GPUVertFormat format = [&]() {
349 GPUVertFormat format{};
350 GPU_vertformat_attr_add(&format, "attr", gpu::VertAttrType::SFLOAT_32_32_32_32);
351 return format;
352 }();
354 GPU_vertbuf_init_with_format_ex(attr_buf, format, usage_flag);
355 GPU_vertbuf_data_alloc(attr_buf, pointcloud.totpoint);
356
357 array_utils::copy(attribute.varray, attr_buf.data<ColorGeometry4f>());
358}
359
361{
362 static const GPUVertFormat ellipse_format = gpu::GenericVertexFormat<uint2>::format();
363 static const GPUVertFormat radiance_format = [&]() {
364 GPUVertFormat format{};
365 GPU_vertformat_attr_add(&format, "radiance_comp_tx", gpu::VertAttrType::SFLOAT_16_16_16_16);
366 return format;
367 }();
368 static const GPUUsageType buffer_usage_flag = GPU_USAGE_STATIC | GPU_USAGE_DEVICE_ONLY |
370
371 ellipses_comp_buf->init(ellipse_format, buffer_usage_flag);
373 radiance_comp_buf->init(radiance_format, buffer_usage_flag);
375}
376
402
427
429{
430 for (const int j : IndexRange(GPU_MAX_ATTR)) {
432 }
434}
435
437{
438 return &attributes_buf[request_i];
439}
440
446
452
458
464
466{
467 if (infos_buf == nullptr) {
468 infos_buf = GPU_uniformbuf_create_ex(sizeof(GSplatInfos), nullptr, "GSplatInfos");
469 }
470 return infos_buf;
471}
472
474{
475 return DRW_batch_request(&dots);
476}
477
479{
481}
482
483gpu::Batch *GSplatEvalCache::surface_get(const PointCloud &pointcloud)
484{
485 if (surface == nullptr) {
488
491
492 if (!infos_buf) {
493 infos_buf = GPU_uniformbuf_create_ex(sizeof(GSplatInfos), nullptr, "GSplatInfos");
494 }
495 }
496 return surface;
497}
498
500
501/* -------------------------------------------------------------------- */
504
509 /* Underlying cache of batches, buffers, etc. */
511 /* Determines if cache is invalid */
513
514 public:
516 {
517 return pointcloud.gsplat_batch_cache;
518 }
519
520 static bool is_valid(PointCloud &pointcloud)
521 {
523 if (!ptr) {
524 return false;
525 }
527 return false;
528 }
529 return !ptr->is_dirty;
530 }
531
532 static void init(PointCloud &pointcloud)
533 {
535 if (!ptr) {
536 ptr = MEM_new<GSplatBatchCache>(__func__);
537 pointcloud.gsplat_batch_cache = ptr;
538 }
539 else {
540 ptr->eval_cache = {};
541 ptr->eval_cache.edit_dots = nullptr;
542 ptr->eval_cache.edit_dots_indices = nullptr;
543 }
544
547 __func__);
548 ptr->is_dirty = false;
549 }
550
551 static void clear(PointCloud &pointcloud)
552 {
554 if (!ptr) {
555 return;
556 }
558 }
559};
560
565
567
568/* -------------------------------------------------------------------- */
571
573{
574 if (pointcloud->type != PointCloudType::GSplat) {
575 return nullptr;
576 }
577
578 const bke::AttributeAccessor attributes = pointcloud->attributes();
579 GSplatEvalCache &cache = GSplatEvalCache::get(*pointcloud);
580
581 if (!attributes.contains(name)) {
582 return nullptr;
583 }
584 {
585 VectorSet<std::string> requests;
586 drw_attributes_add_request(&requests, name);
587 drw_attributes_merge(&cache.attr_used, &requests);
588 }
589
590 for (const int i : IndexRange(cache.attr_used.index_range())) {
591 if (cache.attr_used[i] == name) {
592 return cache.attributes_get(i);
593 }
594 }
595 return nullptr;
596}
597
599{
601 return pointcloud.type == PointCloudType::GSplat ? GSplatEvalCache::get(pointcloud).dots_get() :
602 nullptr;
603}
604
606{
608 return pointcloud.type == PointCloudType::GSplat ?
609 GSplatEvalCache::get(pointcloud).edit_dots_get() :
610 nullptr;
611}
612
614{
616 if (pointcloud.type != PointCloudType::GSplat) {
617 return;
618 }
619 GSplatEvalCache::get(pointcloud).ensure_requested(pointcloud);
620}
621
623{
625 if (ptr == nullptr) {
626 return;
627 }
628
629 switch (mode) {
631 ptr->is_dirty = true;
632 break;
633 default:
634 BLI_assert(0);
635 }
636}
637
639{
640 if (pointcloud->type != PointCloudType::GSplat) {
641 return;
642 }
643
644 if (!GSplatBatchCache::is_valid(*pointcloud)) {
645 GSplatBatchCache::clear(*pointcloud);
646 GSplatBatchCache::init(*pointcloud);
647 }
648}
649
651{
652 GSplatBatchCache::clear(*pointcloud);
653 MEM_delete(pointcloud->gsplat_batch_cache);
654 pointcloud->gsplat_batch_cache = nullptr;
655}
656
657void DRW_gsplat_batch_cache_free_old(PointCloud *pointcloud, int ctime)
658{
659 if (!GSplatBatchCache::get_ptr(*pointcloud)) {
660 return;
661 }
662 GSplatEvalCache &cache = GSplatEvalCache::get(*pointcloud);
663
664 bool do_discard = false;
665
667 cache.last_attr_matching_time = ctime;
668 }
669
670 if (ctime - cache.last_attr_matching_time > U.vbotimeout) {
671 do_discard = true;
672 }
673
675 if (do_discard) {
676 cache.discard_attributes();
677 }
678}
679
681
682} // namespace blender::draw
General operations, lookup, etc. for materials.
General operations for point clouds.
#define M_PI
Object is a sort of wrapper for general info.
#define GPU_BATCH_DISCARD_SAFE(batch)
Definition GPU_batch.hh:199
#define GPU_INDEXBUF_DISCARD_SAFE(elem)
#define GPU_UBO_FREE_SAFE(ubo)
#define GPU_VERTBUF_DISCARD_SAFE(verts)
#define BLI_INLINE
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
Definition btQuadWord.h:119
static IndexMask from_bools(Span< bool > bools, LinearAllocator<> &memory)
constexpr IndexRange()=default
constexpr T * data() const
Definition BLI_span.hh:545
IndexRange index_range() const
IndexRange index_range() const
void append(const T &value)
GAttributeReader lookup_or_default(StringRef name, AttrDomain domain, AttrType data_type, const void *default_value=nullptr) const
bool contains(StringRef name) const
GAttributeReader lookup(const StringRef name) const
constexpr bool is_empty() const
void init(const GPUVertFormat &format, GPUUsageType usage)
void allocate(uint vert_len)
MutableSpan< T > data()
Utilities for rendering attributes.
#define DRW_GSPLAT_STRIP_TILE_SIZE
#define attribute(slot)
#define atan
constexpr T clamp(T, U, U) RET
float3x3 scale(float3x3 mat, float2 scale)
void copy(const GVArray &src, GMutableSpan dst, exec_mode::Mode mode=exec_mode::parallel)
Bounds< T > merge(const Bounds< T > &a, const Bounds< T > &b)
Definition BLI_bounds.hh:27
std::optional< Bounds< T > > min_max(const std::optional< Bounds< T > > &a, const T &b)
Definition BLI_bounds.hh:56
BLI_INLINE float3 pack_quaternion_4_to_3(const float4 &q)
static Vector< VArraySpan< float3 > > read_radiance_sh_attributes(const bke::AttributeAccessor &attributes)
BLI_INLINE RadiancePack pack_radiance(const Array< float3, radiance_coeffs_max > &radiance_sh)
static void index_mask_to_ibo(const IndexMask &mask, gpu::IndexBuf &ibo)
BLI_INLINE uint4 pack_gaussian(const float3 &bounded_mean, const float3 &bounded_log_scale, bool log_scale_is_zero, const math::Quaternion &rotation, float opacity)
void drw_attributes_add_request(VectorSet< std::string > *attrs, const StringRef name)
gpu::Batch * DRW_gsplat_batch_cache_get_dots(Object *ob)
constexpr uint32_t radiance_coeffs_max
void DRW_gsplat_batch_cache_create_requested(Object *ob)
void DRW_gsplat_batch_cache_validate(PointCloud *pointcloud)
bool drw_attributes_overlap(const VectorSet< std::string > *a, const VectorSet< std::string > *b)
gpu::VertBuf ** DRW_gsplat_evaluated_attribute(PointCloud *pointcloud, StringRef name)
constexpr float value_scale_default
void DRW_gsplat_batch_cache_free(PointCloud *pointcloud)
void drw_attributes_merge(VectorSet< std::string > *dst, const VectorSet< std::string > *src)
gpu::Batch * DRW_gsplat_batch_cache_get_edit_dots(Object *ob)
constexpr uint32_t radiance_degs_max
void DRW_gsplat_batch_cache_free_old(PointCloud *pointcloud, int ctime)
void DRW_gsplat_batch_cache_dirty_tag(PointCloud *pointcloud, int mode)
constexpr float value_opacity_default
QuaternionBase< float > Quaternion
T clamp(const T &a, const T &min, const T &max)
MatBase< T, NumCol, NumRow > normalize(const MatBase< T, NumCol, NumRow > &a)
T round(const T &a)
void parallel_for(const IndexRange range, const int64_t grain_size, const Function &function, const TaskSizeHints &size_hints=detail::TaskSizeHints_Static(1))
Definition BLI_task.hh:69
UserDef U
Definition blender.cc:58
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
@ BKE_POINTCLOUD_BATCH_DIRTY_ALL
bool DRW_vbo_requested(gpu::VertBuf *vbo)
gpu::Batch * GPU_batch_create_procedural(GPUPrimType primitive_type, int32_t vertex_count)
Definition gpu_batch.cc:85
void GPU_indexbuf_init(GPUIndexBufBuilder *, GPUPrimType, uint prim_len, uint vertex_len)
void GPU_vertbuf_init_with_format_ex(gpu::VertBuf &verts, const GPUVertFormat &format, GPUUsageType)
unsigned int uint
Definition BKE_text.h:55
bool DRW_batch_requested(gpu::Batch *batch, GPUPrimType prim_type)
VecBase< uint32_t, 4 > uint4
@ GPU_PRIM_TRI_STRIP
VecBase< uint32_t, 3 > uint3
VecBase< float, 4 > float4
int BKE_id_material_used_with_fallback_eval(const ID &id)
unsigned int uint32_t
Definition BKE_text.h:81
void DRW_ibo_request(gpu::Batch *batch, gpu::IndexBuf **ibo)
void GPU_indexbuf_build_in_place_ex(GPUIndexBufBuilder *builder, uint index_min, uint index_max, bool uses_restart_indices, gpu::IndexBuf *elem)
T & DRW_object_get_data_for_drawing(const Object &object)
BMesh const char void * data
unsigned char uint8_t
Definition BKE_text.h:79
MutableSpan< uint32_t > GPU_indexbuf_get_data(GPUIndexBufBuilder *)
sqrt(x)+1/max(0
gpu::UniformBuf * GPU_uniformbuf_create_ex(size_t size, const void *data, const char *name)
uint GPU_vertformat_attr_add(GPUVertFormat *format, StringRef name, gpu::VertAttrType type)
void GPU_uniformbuf_update(gpu::UniformBuf *ubo, const void *data)
gpu::Batch * DRW_batch_request(gpu::Batch **batch)
void GPU_vertbuf_data_alloc(gpu::VertBuf &verts, uint v_len)
VecBase< uint8_t, 3 > uchar3
ColorSceneLinear4f< eAlpha::Premultiplied > ColorGeometry4f
VecBase< float, 3 > float3
void DRW_vbo_request(gpu::Batch *batch, gpu::VertBuf **vbo)
@ GPU_USAGE_FLAG_BUFFER_TEXTURE_ONLY
void * MEM_new_array_zeroed(size_t len, size_t size, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1
bool DRW_ibo_requested(gpu::IndexBuf *ibo)
float3 scale_to_unit(float3 value) const
Bounds()=default
draw::GSplatBatchCache * gsplat_batch_cache
static bool is_valid(PointCloud &pointcloud)
static void clear(PointCloud &pointcloud)
static GSplatBatchCache * get_ptr(PointCloud &pointcloud)
static void init(PointCloud &pointcloud)
VectorSet< std::string > attr_used
void ensure_compute_buffers(PointCloud &pointcloud)
void ensure_builtin_buffers(PointCloud &pointcloud)
VectorSet< std::string > attr_used_over_time
void ensure_requested(PointCloud &pointcloud)
void ensure_attribute(PointCloud &pointcloud, int attrib_i)
gpu::Batch * surface_get(const PointCloud &pointcloud)
gpu::VertBuf ** attributes_get(uint request_i)
void ensure_edit_dots_indices(PointCloud &pointcloud)
static GSplatEvalCache & get(PointCloud &pointcloud)
gpu::VertBuf * attributes_buf[GPU_MAX_ATTR]