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;
138 const float3 *bounds_center,
139 const float3 *bounds_half_extent);
151 const float3 &bounds_center,
152 const float3 &bounds_half_extent);
164 float inflate_bounds = 0.0f);
167 const float3 &bounds_center,
168 const float3 &bounds_half_extent);
300 return resource_len_;
311 void sync_layer_attributes();
333 bounds_buf.current().get_or_resize(resource_len_).sync(*ref.
object, inflate_bounds);
334 infos_buf.current().get_or_resize(resource_len_).sync(ref, is_active_object, is_edit_mode);
340 const float3 *bounds_center,
341 const float3 *bounds_half_extent)
347 matrix_buf.current().get_or_resize(resource_len_).sync(*model_matrix);
352 if (bounds_center && bounds_half_extent) {
353 bounds_buf.current().get_or_resize(resource_len_).sync(*bounds_center, *bounds_half_extent);
358 infos_buf.current().get_or_resize(resource_len_).sync(ref, is_active_object, is_edit_mode);
364 matrix_buf.current().get_or_resize(resource_len_).sync(model_matrix);
365 bounds_buf.current().get_or_resize(resource_len_).sync();
366 infos_buf.current().get_or_resize(resource_len_).sync();
371 const float3 &bounds_center,
372 const float3 &bounds_half_extent)
374 matrix_buf.current().get_or_resize(resource_len_).sync(model_matrix);
375 bounds_buf.current().get_or_resize(resource_len_).sync(bounds_center, bounds_half_extent);
376 infos_buf.current().get_or_resize(resource_len_).sync();
384 bool matches_active_object_edit_mode = object_active &&
385 object_active->mode == eObjectMode::OB_MODE_EDIT &&
387 matrix_buf.current().get_or_resize(resource_len_).sync(model_matrix);
388 bounds_buf.current().get_or_resize(resource_len_).sync();
390 .get_or_resize(resource_len_)
391 .sync(ref, is_active_object, matches_active_object_edit_mode);
397 float inflate_bounds)
403 const float3 &bounds_center,
404 const float3 &bounds_half_extent)
417 if (attr_list ==
nullptr) {
422 if (
attributes_buf.get_or_resize(attribute_len_).sync(ref, *attr)) {
441 if (attr_list ==
nullptr) {
451 hash_cache.
append(attr->hash_code);
452 if (
attributes_buf.get_or_resize(attribute_len_).sync(ref, *attr)) {
464 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(GPUTexture *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 acquire_texture(GPUTexture *texture)
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 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
Vector< GPUTexture * > acquired_textures
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
ResourceHandleRange resource_handle_for_sculpt(const ObjectRef &ref)
void submit(PassSimple &pass, View &view)
ResourceHandleRange resource_handle(const ObjectRef &ref, float inflate_bounds=0.0f)
DataDebugOutput data_debug()
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
DupliObject * dupli_object
ResourceHandleRange handle
ResourceHandle handle_first
uint resource_index() const