38 for (const int face_index : range) {
39 const IndexRange face = faces[face_index];
40 for (const int corner : face) {
41 const int edge = corner_edges[corner];
42 if ((!hide_edge.is_empty() && hide_edge[edge]) ||
43 (!orig_index_edge.is_empty() && (orig_index_edge[edge] == ORIGINDEX_NONE)))
45 data[edge] = uint2(gpu::RESTART_INDEX);
49 const int corner_next = bke::mesh::face_corner_next(face, corner);
50 if (!select_poly.is_empty() && select_poly[face_index]) {
51 if (BLI_BITMAP_TEST_AND_SET_ATOMIC(select_map, edge)) {
53 data[edge] = uint2(gpu::RESTART_INDEX);
57 data[edge] = uint2(corner, corner_next);
62 if (!BLI_BITMAP_TEST(select_map, edge)) {
63 data[edge] = uint2(corner, corner_next);
98 for (
const int subdiv_quad_index :
range) {
99 const int coarse_quad_index = subdiv_loop_face_index[subdiv_quad_index * 4];
100 const IndexRange subdiv_face(subdiv_quad_index * 4, 4);
101 for (
const int corner : subdiv_face) {
102 const uint coarse_edge_index =
uint(subdiv_loop_edge_index[corner]);
103 const uint subdiv_edge_index =
uint(subdiv_loop_subdiv_edge_index[corner]);
104 if (coarse_edge_index == -1u) {
105 data[subdiv_edge_index] =
uint2(gpu::RESTART_INDEX);
108 if ((!hide_edge.
is_empty() && hide_edge[coarse_edge_index]) ||
112 data[subdiv_edge_index] =
uint2(gpu::RESTART_INDEX);
116 const int corner_next = bke::mesh::face_corner_next(subdiv_face, corner);
117 if (!select_poly.
is_empty() && select_poly[coarse_quad_index]) {
120 data[subdiv_edge_index] =
uint2(gpu::RESTART_INDEX);
124 data[subdiv_edge_index] =
uint2(corner, corner_next);
130 data[subdiv_edge_index] =
uint2(corner, corner_next);
#define BLI_BITMAP_NEW(_num, _alloc_string)
#define BLI_BITMAP_TEST(_bitmap, _index)
#define BLI_BITMAP_TEST_AND_SET_ATOMIC(_bitmap, _index)
void GPU_indexbuf_build_in_place_ex(GPUIndexBufBuilder *builder, uint index_min, uint index_max, bool uses_restart_indices, blender::gpu::IndexBuf *elem)
blender::MutableSpan< uint32_t > GPU_indexbuf_get_data(GPUIndexBufBuilder *)
void GPU_indexbuf_init(GPUIndexBufBuilder *, GPUPrimType, uint prim_len, uint vertex_len)
Read Guarded memory(de)allocation.
Provides wrapper around system-specific atomic primitives, and some extensions (faked-atomic operatio...
constexpr MutableSpan< NewT > cast() const
constexpr bool is_empty() const
void MEM_freeN(void *vmemh)
void extract_lines_paint_mask(const MeshRenderData &mr, gpu::IndexBuf &lines)
void extract_lines_paint_mask_subdiv(const MeshRenderData &mr, const DRWSubdivCache &subdiv_cache, gpu::IndexBuf &lines)
void parallel_for(const IndexRange range, const int64_t grain_size, const Function &function, const TaskSizeHints &size_hints=detail::TaskSizeHints_Static(1))
gpu::VertBuf * edges_orig_index
int * subdiv_loop_face_index
int * subdiv_loop_subdiv_edge_index
VArraySpan< bool > hide_edge
VArraySpan< bool > select_poly
const int * orig_index_edge
OffsetIndices< int > faces