33template<
typename T>
class Pass;
106 static std::atomic<uint32_t> global_sync_counter_;
109 uint32_t sync_counter_ = 1;
112 uint resource_len_ = 0;
114 uint attribute_len_ = 0;
116 Object *object_active =
nullptr;
141 const float3 *bounds_center,
142 const float3 *bounds_half_extent);
154 const float3 &bounds_center,
155 const float3 &bounds_half_extent);
165 float inflate_bounds = 0.0f);
297 return resource_len_;
308 void sync_layer_attributes();
326 bool is_active_object = ref.
is_active(object_active);
327 bool is_active_edit_mode = object_active &&
332 uint start = resource_len_;
335 proto_bounds.
sync(*ref.
object, inflate_bounds);
338 proto_info.
sync(ref, is_active_object, is_active_edit_mode);
342 bounds_buf.current().get_or_resize(resource_len_) = proto_bounds;
351 resource_len_ - start);
355 bounds_buf.current().get_or_resize(resource_len_).sync(*ref.
object, inflate_bounds);
357 .get_or_resize(resource_len_)
358 .sync(ref, is_active_object, is_active_edit_mode);
365 const float3 *bounds_center,
366 const float3 *bounds_half_extent)
369 bool is_active_object = ref.
is_active(object_active);
370 bool is_active_edit_mode = object_active &&
375 matrix_buf.current().get_or_resize(resource_len_).sync(*model_matrix);
380 if (bounds_center && bounds_half_extent) {
381 bounds_buf.current().get_or_resize(resource_len_).sync(*bounds_center, *bounds_half_extent);
387 .get_or_resize(resource_len_)
388 .sync(ref, is_active_object, is_active_edit_mode);
394 matrix_buf.current().get_or_resize(resource_len_).sync(model_matrix);
395 bounds_buf.current().get_or_resize(resource_len_).sync();
396 infos_buf.current().get_or_resize(resource_len_).sync();
401 const float3 &bounds_center,
402 const float3 &bounds_half_extent)
404 matrix_buf.current().get_or_resize(resource_len_).sync(model_matrix);
405 bounds_buf.current().get_or_resize(resource_len_).sync(bounds_center, bounds_half_extent);
406 infos_buf.current().get_or_resize(resource_len_).sync();
414 bool is_active_object = ref.
is_active(object_active);
415 bool is_active_edit_mode = object_active &&
419 matrix_buf.current().get_or_resize(resource_len_).sync(model_matrix);
420 bounds_buf.current().get_or_resize(resource_len_).sync();
422 .get_or_resize(resource_len_)
423 .sync(ref, is_active_object, is_active_edit_mode);
429 float inflate_bounds)
442 if (attr_list ==
nullptr) {
447 if (
attributes_buf.get_or_resize(attribute_len_).sync(ref, *attr)) {
466 if (attr_list ==
nullptr) {
476 hash_cache.
append(attr->hash_code);
477 if (
attributes_buf.get_or_resize(attribute_len_).sync(ref, *attr)) {
489 if (attr_list !=
nullptr) {
#define LISTBASE_FOREACH(type, var, list)
const ListBase * GPU_material_layer_attributes(const GPUMaterial *material)
const GPUUniformAttrList * GPU_material_uniform_attributes(const GPUMaterial *material)
void GPU_texture_ref(blender::gpu::Texture *texture)
unsigned long long int uint64_t
constexpr const T & first() const
void append(const T &value)
int64_t first_index_of_try(const T &value) const
LayerAttributeBuf layer_attributes_buf
void begin_sync(Object *object_active=nullptr)
void register_layer_attributes(GPUMaterial *material)
SwapChain< ObjectBoundsBuf, 2 > bounds_buf
SubmitDebugOutput submit_debug(PassSimple &pass, View &view)
ResourceHandle resource_handle_for_psys(const ObjectRef &ref, const float4x4 &model_matrix)
void acquire_texture(gpu::Texture *texture)
ResourceHandleRange unique_handle_for_sculpt(const ObjectRef &ref)
void generate_commands(PassMain &pass, View &view)
void extract_object_attributes(ResourceHandle handle, const ObjectRef &ref, const GPUMaterial *material)
SwapChain< ObjectInfosBuf, 2 > infos_buf
ResourceHandleRange unique_handle(const ObjectRef &ref)
ObjectAttributeBuf attributes_buf
Map< uint32_t, GPULayerAttr > layer_attributes
void compute_visibility(View &view)
uint resource_handle_count() const
void warm_shader_specialization(PassMain &pass)
void submit_only(PassMain &pass, View &view)
void ensure_visibility(View &view)
void update_handle_bounds(ResourceHandle handle, const ObjectRef &ref, float inflate_bounds=0.0f)
SwapChain< ObjectMatricesBuf, 2 > matrix_buf
Vector< gpu::Texture * > acquired_textures
void submit(PassSimple &pass, View &view)
ResourceHandleRange resource_handle(const ObjectRef &ref, float inflate_bounds=0.0f)
DataDebugOutput data_debug()
bool is_active(const Object *active_object) const
uint resource_index() const
bool DRW_object_is_in_edit_mode(const Object *ob)
blender::draw::Manager * DRW_manager_get()
TEX_TEMPLATE DataVec texture(T, FltCoord, float=0.0f) RET
detail::Pass< command::DrawCommandBuf > PassSimple
detail::Pass< command::DrawMultiBuf > PassMain
MatBase< float, 4, 4 > float4x4
VecBase< float, 3 > float3
Span< ObjectInfos > infos
Span< ObjectMatrices > matrices
Span< ObjectBounds > bounds
Span< uint32_t > resource_id
Span< uint32_t > visibility