36template<
typename T>
class Pass;
114 uint resource_len_ = 0;
116 uint attribute_len_ = 0;
118 Object *object_active =
nullptr;
140 const float3 *bounds_center,
141 const float3 *bounds_half_extent);
153 const float3 &bounds_center,
154 const float3 &bounds_half_extent);
166 const float3 half_extent = bounds.
max - center;
173 float inflate_bounds = 0.0f);
176 const float3 &bounds_center,
177 const float3 &bounds_half_extent);
233 return resource_len_;
244 void sync_layer_attributes();
260 bounds_buf.current().get_or_resize(resource_len_).sync(*ref.
object, inflate_bounds);
261 infos_buf.current().get_or_resize(resource_len_).sync(ref, is_active_object);
267 const float3 *bounds_center,
268 const float3 *bounds_half_extent)
272 matrix_buf.current().get_or_resize(resource_len_).sync(*model_matrix);
277 if (bounds_center && bounds_half_extent) {
278 bounds_buf.current().get_or_resize(resource_len_).sync(*bounds_center, *bounds_half_extent);
283 infos_buf.current().get_or_resize(resource_len_).sync(ref, is_active_object);
289 matrix_buf.current().get_or_resize(resource_len_).sync(model_matrix);
290 bounds_buf.current().get_or_resize(resource_len_).sync();
291 infos_buf.current().get_or_resize(resource_len_).sync();
296 const float3 &bounds_center,
297 const float3 &bounds_half_extent)
299 matrix_buf.current().get_or_resize(resource_len_).sync(model_matrix);
300 bounds_buf.current().get_or_resize(resource_len_).sync(bounds_center, bounds_half_extent);
301 infos_buf.current().get_or_resize(resource_len_).sync();
309 matrix_buf.current().get_or_resize(resource_len_).sync(model_matrix);
310 bounds_buf.current().get_or_resize(resource_len_).sync();
311 infos_buf.current().get_or_resize(resource_len_).sync(ref, is_active_object);
317 float inflate_bounds)
319 bounds_buf.current()[handle.resource_index()].sync(*ref.
object, inflate_bounds);
323 const float3 &bounds_center,
324 const float3 &bounds_half_extent)
326 bounds_buf.current()[handle.resource_index()].sync(bounds_center, bounds_half_extent);
337 if (attr_list ==
nullptr) {
361 if (attr_list ==
nullptr) {
367 if ((mat != materials.first()) && (hash_cache.
first_index_of_try(attr->hash_code) != -1)) {
371 hash_cache.
append(attr->hash_code);
384 if (attr_list !=
nullptr) {
A BVH for high poly meshes.
#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)
bool add(const Key &key, const Value &value)
void append(const T &value)
int64_t first_index_of_try(const T &value) const
LayerAttributeBuf layer_attributes_buf
void acquire_texture(GPUTexture *texture)
ResourceHandle unique_handle(const ObjectRef &ref)
void register_layer_attributes(GPUMaterial *material)
SwapChain< ObjectBoundsBuf, 2 > bounds_buf
ResourceHandle resource_handle_for_sculpt(const ObjectRef &ref)
SubmitDebugOutput submit_debug(PassSimple &pass, View &view)
ResourceHandle resource_handle_for_psys(const ObjectRef &ref, const float4x4 &model_matrix)
void extract_object_attributes(ResourceHandle handle, const ObjectRef &ref, const GPUMaterial *material)
SwapChain< ObjectInfosBuf, 2 > infos_buf
ObjectAttributeBuf attributes_buf
Map< uint32_t, GPULayerAttr > layer_attributes
uint resource_handle_count() const
Vector< GPUTexture * > acquired_textures
void update_handle_bounds(ResourceHandle handle, const ObjectRef &ref, float inflate_bounds=0.0f)
SwapChain< ObjectMatricesBuf, 2 > matrix_buf
void submit(PassSimple &pass, View &view)
ResourceHandle resource_handle(const ObjectRef &ref, float inflate_bounds=0.0f)
ObjectAttributeLegacyBuf attributes_buf_legacy
DataDebugOutput data_debug()
T & get_or_resize(int64_t index)
blender::draw::Manager * DRW_manager_get()
blender::draw::ObjectRef DRW_object_ref_get(Object *object)
Bounds< float3 > bounds_get(const Tree &pbvh)
T midpoint(const T &a, const T &b)
struct SculptSession * sculpt
std::unique_ptr< blender::bke::pbvh::Tree > pbvh
Span< ObjectInfos > infos
Span< ObjectMatrices > matrices
Span< ObjectBounds > bounds
Span< uint32_t > resource_id
Span< uint32_t > visibility
DupliObject * dupli_object