17#include "../intern/gpu_select_private.hh"
38 ID(
uint32_t value) : value(value) {};
118 if (sub_object_id ==
uint(-1)) {
131 printf(
"%s : %u | %u = %u -> %u\n",
135 object_id | sub_object_id,
283 hit_result.
depth = 0xFFFF;
284 hit_results.
append(hit_result);
299 float offset_depth = *
reinterpret_cast<float *
>(&hit_result.
depth) / 100.0f;
300 hit_result.
depth = *
reinterpret_cast<uint32_t *
>(&offset_depth);
302 hit_results.
append(hit_result);
317 const uint32_t depth_mask = 0x00FFFFFFu << 8u;
318 uint32_t offset_depth = ((hit_result.
depth & depth_mask) >> 8u) / 100;
319 hit_result.
depth &= ~depth_mask;
320 hit_result.
depth |= offset_depth << 8u;
322 if (hit_results.
is_empty() || hit_result.
depth < hit_results[0].depth) {
323 hit_results = {hit_result};
330 for (
auto &hit : hit_results) {
333 printf(
" hit: %u: depth %u\n", hit.id, hit.depth);
#define BLI_assert_unreachable()
constexpr IndexRange()=default
int64_t append_and_get_index(const T &value)
void append(const T &value)
void resize(int64_t new_size)
void append(const T &value)
void state_set(DRWState state, int clip_plane_count=0)
void bind_ubo(const char *name, gpu::UniformBuf *buffer)
void bind_ssbo(const char *name, gpu::StorageBuf *buffer)
detail::PassBase< command::DrawCommandBuf > Sub
void async_flush_to_host()
detail::Pass< command::DrawCommandBuf > PassSimple
detail::Pass< command::DrawMultiBuf > PassMain
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
@ GPU_SELECT_PICK_NEAREST
@ GPU_SELECT_NEAREST_SECOND_PASS
@ GPU_SELECT_NEAREST_FIRST_PASS
MINLINE uint max_uu(uint a, uint b)
void GPU_storagebuf_clear(gpu::StorageBuf *ssbo, uint32_t clear_value)
void GPU_memory_barrier(GPUBarrier barrier)
@ GPU_BARRIER_BUFFER_UPDATE
int gpu_select_next_get_radius()
void gpu_select_next_set_result(GPUSelectResult *hit_buf, uint hit_len)
int2 gpu_select_next_get_pick_area_center()
MINLINE uint ceil_to_multiple_u(uint a, uint b)
GPUSelectMode gpu_select_next_get_mode()
eObject_DrawExtraFlag dtx
bke::ObjectRuntime * runtime
void select_append(ID select_id)
StorageVectorBuffer< uint32_t > select_buf
void select_bind(PassSimple::Sub &pass)
SelectBuf(const SelectionType selection_type)
const SelectionType selection_type
void select_bind(PassMain &pass, PassMain::Sub &sub)
Vector< std::string > map_names
UniformBuffer< SelectInfoData > info_buf
void select_bind(PassSimple &pass)
void begin_sync(int clipping_plane_count)
static const ID select_invalid_id()
StorageArrayBuffer< uint > select_output_buf
StorageArrayBuffer< uint, 4, true > dummy_select_buf
void select_bind(PassMain &pass)
const ID select_id(const ObjectRef &ob_ref, uint sub_object_id=0)
SelectMap(const SelectionType selection_type)
Vector< uint > select_id_map
const SelectionType selection_type
Vector< bool > in_front_map