26std::atomic<uint32_t> Manager::global_sync_counter_ = 1;
39 sync_counter_ = (global_sync_counter_ += 2);
45 matrix_buf.current().trim_to_next_power_of_2(resource_len_);
46 bounds_buf.current().trim_to_next_power_of_2(resource_len_);
47 infos_buf.current().trim_to_next_power_of_2(resource_len_);
62#if !defined(NDEBUG) && !defined(_M_ARM64)
78 this->object_active = object_active;
84void Manager::sync_layer_attributes()
95 std::sort(id_list.
begin(), id_list.
end());
100 for (uint32_t
id : id_list) {
118 sync_layer_attributes();
151 if (gpu_buf ==
nullptr) {
155#ifndef DISABLE_DEBUG_SHADER_PRINT_BARRIER
172 return sync_counter_ | (
uint64_t(resource_len_) << 32);
177 if (ref.sculpt_handle_.
is_valid()) {
178 return ref.sculpt_handle_;
186 ref,
nullptr, ¢er, &half_extent);
187 return ref.sculpt_handle_;
196 "Resources did not changed, no need to update");
198 view.manager_fingerprint_ = this->fingerprint_get();
201 view.compute_visibility(
207 if (
view.manager_fingerprint_ != this->fingerprint_get()) {
220 "Resources and view did not changed no need to update");
222 (
view.fingerprint_get() != 0),
223 "Resources or view changed, but compute_visibility was not called");
230 view.get_visibility_buffer(),
231 view.visibility_word_per_draw(),
253 "Resources did not changed since last generate_command, no need to update");
283 BLI_assert_msg(
view.manager_fingerprint_ != 0,
"compute_visibility was not called on this view");
285 "Resources changed since last compute_visibility");
288 "Resources changed since last generate_command");
292 "View have changed since last generate_commands or "
293 "submitting with a different view");
298 state.inverted_view =
view.is_inverted();
316 if (
view.manager_fingerprint_ != this->fingerprint_get()) {
353 state.inverted_view = inverted_view;
387 output.visibility = {(
uint *)
view.get_visibility_buffer().data(), 0};
398 view.get_visibility_buffer().read();
A BVH for high poly meshes.
#define BLI_assert_msg(a, msg)
MINLINE uint divide_ceil_u(uint a, uint b)
#define USER_DEVELOPER_TOOL_TEST(userdef, member)
@ V3D_DEBUG_FREEZE_CULLING
void DRW_submission_end()
void DRW_submission_start()
void GPU_compute_dispatch(blender::gpu::Shader *shader, uint groups_x_len, uint groups_y_len, uint groups_z_len, const blender::gpu::shader::SpecializationConstants *constants_state=nullptr)
void GPU_debug_group_end()
void GPU_debug_group_begin(const char *name)
void GPU_shader_bind(blender::gpu::Shader *shader, const blender::gpu::shader::SpecializationConstants *constants_state=nullptr)
int GPU_shader_get_ssbo_binding(blender::gpu::Shader *shader, const char *name)
void GPU_shader_uniform_1i(blender::gpu::Shader *sh, const char *name, int value)
@ GPU_BARRIER_SHADER_STORAGE
@ GPU_BARRIER_BUFFER_UPDATE
void GPU_memory_barrier(GPUBarrier barrier)
void GPU_storagebuf_bind(blender::gpu::StorageBuf *ssbo, int slot)
void GPU_texture_free(blender::gpu::Texture *texture)
unsigned long long int uint64_t
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
const Value & lookup(const Key &key) const
KeyIterator keys() const &
void append(const T &value)
void reserve(const int64_t min_capacity)
gpu::StorageBuf * gpu_draw_buf_get()
LayerAttributeBuf layer_attributes_buf
void begin_sync(Object *object_active=nullptr)
SwapChain< ObjectBoundsBuf, 2 > bounds_buf
SubmitDebugOutput submit_debug(PassSimple &pass, View &view)
ResourceHandleRange unique_handle_for_sculpt(const ObjectRef &ref)
void generate_commands(PassMain &pass, View &view)
SwapChain< ObjectInfosBuf, 2 > infos_buf
ObjectAttributeBuf attributes_buf
Map< uint32_t, GPULayerAttr > layer_attributes
void compute_visibility(View &view)
void warm_shader_specialization(PassMain &pass)
void submit_only(PassMain &pass, View &view)
void ensure_visibility(View &view)
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()
Vector< command::Header, 0 > headers_
uint64_t view_fingerprint_
uint64_t manager_fingerprint_
bool has_generated_commands() const
void warm_shader_specialization(command::RecordingState &state) const
SubPassVector< PassBase< DrawCommandBufType > > & sub_passes_
void submit(command::RecordingState &state) const
Vector< command::Undetermined, 0 > commands_
DrawCommandBufType & draw_commands_buf_
Simple API to draw debug shapes and log in the viewport.
#define DRW_FINALIZE_GROUP_SIZE
#define DRW_DEBUG_DRAW_SLOT
#define DRW_OBJ_INFOS_SLOT
#define DRW_OBJ_ATTR_SLOT
#define DRW_LAYER_ATTR_UBO_SLOT
blender::gpu::Shader * DRW_shader_draw_resource_finalize_get()
TEX_TEMPLATE DataVec texture(T, FltCoord, float=0.0f) RET
pbvh::Tree * pbvh_get(Object &object)
Bounds< float3 > bounds_get(const Tree &pbvh)
detail::Pass< command::DrawCommandBuf > PassSimple
detail::Pass< command::DrawMultiBuf > PassMain
T midpoint(const T &a, const T &b)
VecBase< float, 3 > float3
static MatBase identity()