44template<
typename T>
class Pass;
130 static std::atomic<uint32_t> global_sync_counter_;
136 uint resource_len_ = 0;
138 uint attribute_len_ = 0;
140 Object *object_active =
nullptr;
165 const float3 *bounds_center,
166 const float3 *bounds_half_extent);
178 const float3 &bounds_center,
179 const float3 &bounds_half_extent);
189 float inflate_bounds = 0.0f);
324 const bool use_tile_mapping)
326 deferred_textures_.append(std::make_unique<DeferredTexture>());
339 return !deferred_textures_.is_empty();
347 return resource_len_;
360 void sync_layer_attributes();
378 bool is_active_object = ref.
is_active(object_active);
379 bool is_active_edit_mode = object_active &&
384 uint start = resource_len_;
387 proto_bounds.
sync(*ref.
object, inflate_bounds);
390 proto_info.
sync(ref, is_active_object, is_active_edit_mode);
394 matrix_buf.current().get_or_resize(resource_len_).sync(dupli_mat);
395 bounds_buf.current().get_or_resize(resource_len_) = proto_bounds;
407 resource_len_ - start);
411 bounds_buf.current().get_or_resize(resource_len_).sync(*ref.
object, inflate_bounds);
413 .get_or_resize(resource_len_)
414 .sync(ref, is_active_object, is_active_edit_mode);
421 const float3 *bounds_center,
422 const float3 *bounds_half_extent)
425 bool is_active_object = ref.
is_active(object_active);
426 bool is_active_edit_mode = object_active &&
431 matrix_buf.current().get_or_resize(resource_len_).sync(*model_matrix);
436 if (bounds_center && bounds_half_extent) {
437 bounds_buf.current().get_or_resize(resource_len_).sync(*bounds_center, *bounds_half_extent);
443 .get_or_resize(resource_len_)
444 .sync(ref, is_active_object, is_active_edit_mode);
450 matrix_buf.current().get_or_resize(resource_len_).sync(model_matrix);
451 bounds_buf.current().get_or_resize(resource_len_).sync();
452 infos_buf.current().get_or_resize(resource_len_).sync();
457 const float3 &bounds_center,
458 const float3 &bounds_half_extent)
460 matrix_buf.current().get_or_resize(resource_len_).sync(model_matrix);
461 bounds_buf.current().get_or_resize(resource_len_).sync(bounds_center, bounds_half_extent);
462 infos_buf.current().get_or_resize(resource_len_).sync();
470 bool is_active_object = ref.
is_active(object_active);
471 bool is_active_edit_mode = object_active &&
475 matrix_buf.current().get_or_resize(resource_len_).sync(model_matrix);
476 bounds_buf.current().get_or_resize(resource_len_).sync();
478 .get_or_resize(resource_len_)
479 .sync(ref, is_active_object, is_active_edit_mode);
485 float inflate_bounds)
495 if (attr_list ==
nullptr || attr_list->
count == 0) {
521 if (attr_list ==
nullptr) {
568 for (
const char *name : attrs) {
582 if (attr_list !=
nullptr) {
ValueIterator values() const &
bool add(const Key &key, const Value &value)
void append(const T &value)
LayerAttributeBuf layer_attributes_buf
void hold_texture(gpu::Texture *texture)
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)
ResourceHandleRange unique_handle_for_sculpt(const ObjectRef &ref)
void generate_commands(PassMain &pass, View &view)
SwapChain< ObjectInfosBuf, 2 > infos_buf
bool has_deferred_textures() const
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 extract_object_attributes(ResourceHandleRange handle, const ObjectRef &ref, const GPUMaterial *material)
void ensure_visibility(View &view)
void extract_all_object_attributes(ResourceHandleRange handle, const ObjectRef &ref)
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)
void load_deferred_textures()
DeferredTexture & add_texture_deferred(blender::Image *image, blender::ImageUser *image_user, const bool use_tile_mapping)
DataDebugOutput data_debug()
bool is_active(const Object *active_object) const
ResourceHandleRange()=default
IndexRange id_range() const
T & get_or_resize(int64_t index)
TEX_TEMPLATE DataVec texture(T, FltCoord, float=0.0f) RET
detail::Pass< command::DrawCommandBuf > PassSimple
detail::Pass< command::DrawMultiBuf > PassMain
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
unsigned __int64 uint64_t
PointerRNA RNA_id_pointer_create(ID *id)
MatBase< float, 4, 4 > float4x4
float shadow_terminator_normal_offset_get(const Object &object, const float4x4 &object_to_world)
IDProperty * RNA_struct_idprops(PointerRNA *ptr, bool create)
draw::Manager * DRW_manager_get()
const GPUUniformAttrList * GPU_material_uniform_attributes(const GPUMaterial *material)
VecBase< float, 3 > float3
const ListBaseT< GPULayerAttr > * GPU_material_layer_attributes(const GPUMaterial *material)
bool DRW_object_is_in_edit_mode(const Object *ob)
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float
bool sync(const draw::ObjectRef &ref, const GPUUniformAttr &attr, int instance_index)
float shadow_terminator_normal_offset
ListBaseT< struct IDProperty > group
eObject_TransFlag transflag
Span< ObjectInfos > infos
Span< ObjectMatrices > matrices
Span< ObjectBounds > bounds
blender::ImageUser * image_user
gpu::Texture * tile_mapping
Span< uint32_t > resource_id
Span< uint32_t > visibility