Blender V5.0
draw_cache_impl_subdivision.cc File Reference

Go to the source code of this file.

Namespaces

namespace  blender
namespace  blender::draw

Macros

#define SUBDIV_LOCAL_WORK_GROUP_SIZE   64

Functions

static uint blender::draw::tris_count_from_number_of_loops (const uint number_of_loops)
static uint blender::draw::get_dispatch_size (uint elements)
static void blender::draw::drw_subdiv_compute_dispatch (const DRWSubdivCache &cache, gpu::Shader *shader, const int src_offset, const int dst_offset, uint total_dispatch_size, const bool has_sculpt_mask=false, const uint edge_loose_offset=0)
void blender::draw::draw_subdiv_extract_pos (const DRWSubdivCache &cache, gpu::VertBuf *pos, gpu::VertBuf *orco)
void blender::draw::draw_subdiv_extract_uvs (const DRWSubdivCache &cache, gpu::VertBuf *uvs, const int face_varying_channel, const int dst_offset)
void blender::draw::draw_subdiv_interp_custom_data (const DRWSubdivCache &cache, gpu::VertBuf &src_data, gpu::VertBuf &dst_data, GPUVertCompType comp_type, int dimensions, int dst_offset)
void blender::draw::draw_subdiv_interp_corner_normals (const DRWSubdivCache &cache, gpu::VertBuf &src_data, gpu::VertBuf &dst_data)
void blender::draw::draw_subdiv_build_sculpt_data_buffer (const DRWSubdivCache &cache, gpu::VertBuf *mask_vbo, gpu::VertBuf *face_set_vbo, gpu::VertBuf *sculpt_data)
void blender::draw::draw_subdiv_accumulate_normals (const DRWSubdivCache &cache, gpu::VertBuf *pos, gpu::VertBuf *face_adjacency_offsets, gpu::VertBuf *face_adjacency_lists, gpu::VertBuf *vertex_loop_map, gpu::VertBuf *vert_normals)
void blender::draw::draw_subdiv_build_tris_buffer (const DRWSubdivCache &cache, gpu::IndexBuf *subdiv_tris, const int material_count)
void blender::draw::draw_subdiv_build_fdots_buffers (const DRWSubdivCache &cache, gpu::VertBuf *fdots_pos, gpu::VertBuf *fdots_nor, gpu::IndexBuf *fdots_indices)
void blender::draw::draw_subdiv_build_lines_buffer (const DRWSubdivCache &cache, gpu::IndexBuf *lines_indices)
void blender::draw::draw_subdiv_build_lines_loose_buffer (const DRWSubdivCache &cache, gpu::IndexBuf *lines_indices, gpu::VertBuf *lines_flags, uint edge_loose_offset, uint num_loose_edges)
void blender::draw::draw_subdiv_build_edge_fac_buffer (const DRWSubdivCache &cache, gpu::VertBuf *pos, gpu::VertBuf *edge_draw_flag, gpu::VertBuf *poly_other_map, gpu::VertBuf *edge_fac)
void blender::draw::draw_subdiv_build_lnor_buffer (const DRWSubdivCache &cache, gpu::VertBuf *pos, gpu::VertBuf *vert_normals, gpu::VertBuf *subdiv_corner_verts, gpu::VertBuf *lnor)
void blender::draw::draw_subdiv_build_paint_overlay_flag_buffer (const DRWSubdivCache &cache, gpu::VertBuf &flags)
void blender::draw::draw_subdiv_build_edituv_stretch_area_buffer (const DRWSubdivCache &cache, gpu::VertBuf *coarse_data, gpu::VertBuf *subdiv_data)
void blender::draw::draw_subdiv_build_edituv_stretch_angle_buffer (const DRWSubdivCache &cache, gpu::VertBuf *pos, gpu::VertBuf *uvs, int uvs_offset, gpu::VertBuf *stretch_angles)
static void blender::draw::draw_subdiv_cache_ensure_mat_offsets (DRWSubdivCache &cache, const Mesh *mesh_eval, uint mat_len)
static bool blender::draw::draw_subdiv_create_requested_buffers (Object &ob, Mesh &mesh, MeshBatchCache &batch_cache, MeshBufferCache &mbc, const Span< IBOType > ibo_requests, const Span< VBOType > vbo_requests, const bool is_editmode, const bool is_paint_mode, const bool do_final, const bool do_uvedit, const bool do_cage, const ToolSettings *ts, const bool use_hide)
void blender::draw::DRW_subdivide_loose_geom (DRWSubdivCache &subdiv_cache, const MeshBufferCache &cache)
void blender::draw::DRW_create_subdivision (Object &ob, Mesh &mesh, MeshBatchCache &batch_cache, MeshBufferCache &mbc, const Span< IBOType > ibo_requests, const Span< VBOType > vbo_requests, const bool is_editmode, const bool is_paint_mode, const bool do_final, const bool do_uvedit, const bool do_cage, const ToolSettings *ts, const bool use_hide)
void blender::draw::DRW_subdiv_cache_free (bke::subdiv::Subdiv *subdiv)
void blender::draw::DRW_cache_free_old_subdiv ()
Vertex Formats

Used for data transfer from OpenSubdiv, and for data processing on our side.

static const GPUVertFormatblender::draw::get_origindex_format ()
Utilities to build a gpu::VertBuf from an origindex buffer.
gpu::VertBufPtr blender::draw::draw_subdiv_init_origindex_buffer (int32_t *vert_origindex, uint num_loops, uint loose_len)
gpu::VertBufblender::draw::draw_subdiv_build_origindex_buffer (int *vert_origindex, uint num_loops)
gpu::VertBufPtr blender::draw::draw_subdiv_init_origindex_buffer (Span< int32_t > vert_origindex, uint loose_len)
gpu::VertBufblender::draw::draw_subdiv_build_origindex_buffer (Span< int > vert_origindex)
Utilities for DRWPatchMap.
static void blender::draw::draw_patch_map_free (DRWPatchMap *gpu_patch_map)
DRWSubdivUboStorage.

Common uniforms for the various shaders.

static void blender::draw::draw_subdiv_init_ubo_storage (const DRWSubdivCache &cache, DRWSubdivUboStorage *ubo, const int src_offset, const int dst_offset, const uint total_dispatch_size, const bool has_sculpt_mask, const uint edge_loose_offset)
static void blender::draw::draw_subdiv_ubo_update_and_bind (const DRWSubdivCache &cache, const int src_offset, const int dst_offset, const uint total_dispatch_size, const bool has_sculpt_mask=false, const uint edge_loose_offset=0)

Variables

static OpenSubdiv_EvaluatorCacheblender::draw::g_subdiv_evaluator_cache = nullptr
static uint64_t blender::draw::g_subdiv_evaluator_users = 0
static Mutex blender::draw::g_subdiv_eval_mutex
static LinkNodeblender::draw::gpu_subdiv_free_queue = nullptr
static blender::Mutex blender::draw::gpu_subdiv_queue_mutex

DRWSubdivCache

This holds the various buffers used to evaluate and render subdivision through OpenGL.

#define SUBDIV_COARSE_FACE_FLAG_SMOOTH   1u
#define SUBDIV_COARSE_FACE_FLAG_SELECT   2u
#define SUBDIV_COARSE_FACE_FLAG_ACTIVE   4u
#define SUBDIV_COARSE_FACE_FLAG_HIDDEN   8u
#define SUBDIV_COARSE_FACE_FLAG_OFFSET   28u
#define SUBDIV_COARSE_FACE_FLAG_SMOOTH_MASK   (SUBDIV_COARSE_FACE_FLAG_SMOOTH << SUBDIV_COARSE_FACE_FLAG_OFFSET)
#define SUBDIV_COARSE_FACE_FLAG_SELECT_MASK   (SUBDIV_COARSE_FACE_FLAG_SELECT << SUBDIV_COARSE_FACE_FLAG_OFFSET)
#define SUBDIV_COARSE_FACE_FLAG_ACTIVE_MASK   (SUBDIV_COARSE_FACE_FLAG_ACTIVE << SUBDIV_COARSE_FACE_FLAG_OFFSET)
#define SUBDIV_COARSE_FACE_FLAG_HIDDEN_MASK   (SUBDIV_COARSE_FACE_FLAG_HIDDEN << SUBDIV_COARSE_FACE_FLAG_OFFSET)
#define SUBDIV_COARSE_FACE_LOOP_START_MASK
static bool blender::draw::draw_subdiv_cache_need_face_data (const DRWSubdivCache &cache)
static void blender::draw::draw_subdiv_cache_free_material_data (DRWSubdivCache &cache)
static void blender::draw::draw_subdiv_free_edit_mode_cache (DRWSubdivCache &cache)
void blender::draw::draw_subdiv_cache_free (DRWSubdivCache &cache)
static uint32_t blender::draw::compute_coarse_face_flag_bm (BMFace *f, BMFace *efa_act)
static void blender::draw::draw_subdiv_cache_extra_coarse_face_data_bm (BMesh *bm, BMFace *efa_act, MutableSpan< uint32_t > flags_data)
static void blender::draw::draw_subdiv_cache_extra_coarse_face_data_mesh (const MeshRenderData &mr, const Mesh *mesh, MutableSpan< uint32_t > flags_data)
static void blender::draw::draw_subdiv_cache_extra_coarse_face_data_mapped (const Mesh *mesh, BMesh *bm, MeshRenderData &mr, MutableSpan< uint32_t > flags_data)
static void blender::draw::draw_subdiv_cache_update_extra_coarse_face_data (DRWSubdivCache &cache, const Mesh *mesh, MeshRenderData &mr)
static DRWSubdivCacheblender::draw::mesh_batch_cache_ensure_subdiv_cache (MeshBatchCache &mbc)

Macro Definition Documentation

◆ SUBDIV_COARSE_FACE_FLAG_ACTIVE

#define SUBDIV_COARSE_FACE_FLAG_ACTIVE   4u

◆ SUBDIV_COARSE_FACE_FLAG_ACTIVE_MASK

#define SUBDIV_COARSE_FACE_FLAG_ACTIVE_MASK   (SUBDIV_COARSE_FACE_FLAG_ACTIVE << SUBDIV_COARSE_FACE_FLAG_OFFSET)

◆ SUBDIV_COARSE_FACE_FLAG_HIDDEN

#define SUBDIV_COARSE_FACE_FLAG_HIDDEN   8u

◆ SUBDIV_COARSE_FACE_FLAG_HIDDEN_MASK

#define SUBDIV_COARSE_FACE_FLAG_HIDDEN_MASK   (SUBDIV_COARSE_FACE_FLAG_HIDDEN << SUBDIV_COARSE_FACE_FLAG_OFFSET)

◆ SUBDIV_COARSE_FACE_FLAG_OFFSET

◆ SUBDIV_COARSE_FACE_FLAG_SELECT

#define SUBDIV_COARSE_FACE_FLAG_SELECT   2u

◆ SUBDIV_COARSE_FACE_FLAG_SELECT_MASK

#define SUBDIV_COARSE_FACE_FLAG_SELECT_MASK   (SUBDIV_COARSE_FACE_FLAG_SELECT << SUBDIV_COARSE_FACE_FLAG_OFFSET)

◆ SUBDIV_COARSE_FACE_FLAG_SMOOTH

◆ SUBDIV_COARSE_FACE_FLAG_SMOOTH_MASK

#define SUBDIV_COARSE_FACE_FLAG_SMOOTH_MASK   (SUBDIV_COARSE_FACE_FLAG_SMOOTH << SUBDIV_COARSE_FACE_FLAG_OFFSET)

◆ SUBDIV_COARSE_FACE_LOOP_START_MASK

#define SUBDIV_COARSE_FACE_LOOP_START_MASK

◆ SUBDIV_LOCAL_WORK_GROUP_SIZE

#define SUBDIV_LOCAL_WORK_GROUP_SIZE   64

Definition at line 930 of file draw_cache_impl_subdivision.cc.

Referenced by blender::draw::get_dispatch_size().