23template<
typename GetIndex>
29 for (const int face_index : range) {
30 const BMFace &face = *BM_face_at_index(&const_cast<BMesh &>(bm), face_index);
31 const BMLoop *loop = BM_FACE_FIRST_LOOP(&face);
32 for ([[maybe_unused]] const int i : IndexRange(face.len)) {
33 data[BM_elem_index_get(loop)] = get_index(*loop);
49 *mr.
bm, [](
const BMLoop &loop) { return BM_elem_index_get(loop.v); });
63 *mr.
bm, [](
const BMLoop &loop) { return BM_elem_index_get(loop.e); });
82 for (const int face_index : range) {
83 const BMFace &face = *BM_face_at_index(&const_cast<BMesh &>(bm), face_index);
84 data[face_index] = BM_elem_index_get(BM_FACE_FIRST_LOOP(&face));
88 return *cache.face_offsets;
96 while (start < size) {
97 const int batch_size = std::min(
int64_t(size - start), max_batch_size);
#define UNUSED_VARS_NDEBUG(...)
constexpr IndexRange()=default
static VertBufPtr from_size(const int size, GPUUsageType usage=GPU_USAGE_STATIC)
static VertBufPtr from_span(const Span< T > data)
#define DRW_MESH_TO_CORNER_GROUP_SIZE
void scatter_face_to_corner_gpu(const MeshRenderData &mr, MeshBufferCache &cache, gpu::VertBuf &src, gpu::VertBuf &dst)
static gpu::VertBuf & face_offsets_ensure(const MeshRenderData &mr, MeshBufferCache &cache)
static int element_size(const gpu::VertBuf &src, const gpu::VertBuf &dst)
static gpu::VertBuf & corner_edges_ensure(const MeshRenderData &mr, MeshBufferCache &cache)
void gather_edge_to_corner_gpu(const MeshRenderData &mr, MeshBufferCache &cache, gpu::VertBuf &src, gpu::VertBuf &dst)
static void dispatch_batched(gpu::Shader *shader, const int size)
static void gather_to_corner_gpu(const MeshRenderData &mr, gpu::VertBuf &src, gpu::VertBuf &indices, gpu::VertBuf &dst)
void gather_vert_to_corner_gpu(const MeshRenderData &mr, MeshBufferCache &cache, gpu::VertBuf &src, gpu::VertBuf &dst)
static gpu::VertBuf & corner_verts_ensure(const MeshRenderData &mr, MeshBufferCache &cache)
static gpu::VertBufPtr bm_corner_indices_create(const BMesh &bm, const GetIndex get_index)
std::unique_ptr< gpu::VertBuf, gpu::VertBufDeleter > VertBufPtr
void parallel_for(const IndexRange range, const int64_t grain_size, const Function &function, const TaskSizeHints &size_hints=detail::TaskSizeHints_Static(1))
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
gpu::Shader * DRW_shader_mesh_scatter_faces_get(const int element_size)
const GPUVertFormat * GPU_vertbuf_get_format(const gpu::VertBuf *verts)
void GPU_compute_dispatch(gpu::Shader *shader, uint groups_x_len, uint groups_y_len, uint groups_z_len, const gpu::shader::SpecializationConstants *constants_state=nullptr)
void GPU_vertbuf_bind_as_ssbo(gpu::VertBuf *verts, int binding)
gpu::Shader * DRW_shader_mesh_gather_get(const int element_size)
int GPU_max_work_group_count(int index)
void GPU_memory_barrier(GPUBarrier barrier)
BMesh const char void * data
void GPU_shader_bind(gpu::Shader *shader, const gpu::shader::SpecializationConstants *constants_state=nullptr)
void GPU_shader_uniform_1i(gpu::Shader *sh, const char *name, int value)
@ GPU_BARRIER_VERTEX_ATTRIB_ARRAY
@ GPU_BARRIER_SHADER_STORAGE
MINLINE uint divide_ceil_u(uint a, uint b)
uint GPU_vertbuf_get_vertex_len(const gpu::VertBuf *verts)
gpu::VertBufPtr face_offsets
gpu::VertBufPtr corner_edges
gpu::VertBufPtr corner_verts
MeshExtractType extract_type
OffsetIndices< int > faces