146 cd_used->
uv |= (1 << layer);
156 cd_used->
uv |= (1 << layer);
178 cd_used->
vcol |= (1 << layer);
184 int gpumat_array_len)
194 for (
int i = 0; i < gpumat_array_len; i++) {
199 const char *name = gpu_attr->name;
200 int type = gpu_attr->type;
208 if (name[0] !=
'\0') {
213 if (
U.experimental.use_sculpt_vertex_colors) {
247 cd_used.
uv |= (1 << layer);
257 if (layer == -1 && name[0] !=
'\0') {
262 cd_used.
tan |= (1 << layer);
273 bool use_mloop_cols =
false;
275 layer = (name[0] !=
'\0') ?
280 layer = (name[0] !=
'\0') ?
283 use_mloop_cols =
true;
287 if (use_mloop_cols) {
288 cd_used.
vcol |= (1 << layer);
303 cd_used.
vcol |= (1 << layer);
332 memset(wstate, 0,
sizeof(*wstate));
345 memcpy(wstate_dst, wstate_src,
sizeof(*wstate_dst));
360 return ((!array1 && !array2) ||
361 (array1 && array2 && memcmp(array1, array2,
size *
sizeof(
bool)) == 0));
383 memset(wstate, 0,
sizeof(*wstate));
487 memset(cache, 0,
sizeof(*cache));
543 for (
int i = 0; i < cache->
mat_len; i++) {
551 for (
int i = 0; i < cache->
mat_len; i++) {
719 for (
int i = 0; i <
sizeof(mbufcache->vbo) /
sizeof(
void *); i++) {
722 for (
int i = 0; i <
sizeof(mbufcache->ibo) /
sizeof(
void *); i++) {
727 for (
int i = 0; i < cache->
mat_len; i++) {
732 for (
int i = 0; i <
sizeof(cache->
batch) /
sizeof(
void *); i++) {
765 "No uv layer available in texpaint, but batches requested anyway!");
778 "No MLOOPCOL layer available in vertpaint, but batches requested anyway!");
790 "No MPropCol layer available in Sculpt, but batches requested anyway!");
862 uint gpumat_array_len)
1041 "No uv layer available in edituv, but batches requested anyway!");
1054 float **tot_uv_area)
1060 if (tot_area !=
NULL) {
1063 if (tot_uv_area !=
NULL) {
1138 if (cache ==
NULL) {
1146 if (ctime - cache->
lastmatch >
U.vbotimeout) {
1155 static void drw_mesh_batch_cache_check_available(
struct TaskGraph *task_graph,
Mesh *me)
1163 for (
int i = 0; i <
sizeof(cache->
batch) /
sizeof(
void *); i++) {
1166 for (
int i = 0; i <
sizeof(cache->
final.
vbo) /
sizeof(
void *); i++) {
1169 for (
int i = 0; i <
sizeof(cache->
final.
ibo) /
sizeof(
void *); i++) {
1172 for (
int i = 0; i <
sizeof(cache->
cage.
vbo) /
sizeof(
void *); i++) {
1175 for (
int i = 0; i <
sizeof(cache->
cage.
ibo) /
sizeof(
void *); i++) {
1178 for (
int i = 0; i <
sizeof(cache->
uv_cage.
vbo) /
sizeof(
void *); i++) {
1181 for (
int i = 0; i <
sizeof(cache->
uv_cage.
ibo) /
sizeof(
void *); i++) {
1192 const bool is_paint_mode,
1193 const bool use_hide)
1201 bool cd_uv_update =
false;
1206 drw_mesh_batch_cache_check_available(task_graph, me);
1246 if (batch_requested &
1264 if (cd_overlap ==
false) {
1268 cd_uv_update =
true;
1288 for (
int i = 0; i < cache->
mat_len; i++) {
1303 if (cd_uv_update || (cache->
is_uvsyncsel != is_uvsyncsel)) {
1328 if ((batch_requested & ~cache->
batch_ready) == 0) {
1330 drw_mesh_batch_cache_check_available(task_graph, me);
1341 if (do_update_sculpt_normals) {
1348 const bool do_cage = (is_editmode &&
1419 for (
int i = 0; i < cache->
mat_len; i++) {
1440 mbufcache = (do_cage) ? &cache->
cage : &cache->
final;
1503 mbufcache = (do_uvcage) ? &cache->
uv_cage : &cache->
final;
1603 drw_mesh_batch_cache_check_available(task_graph, me);
CustomData interface, see also DNA_customdata_types.h.
int CustomData_get_active_layer(const struct CustomData *data, int type)
int CustomData_get_stencil_layer(const struct CustomData *data, int type)
void * CustomData_get_layer(const struct CustomData *data, int type)
int CustomData_get_named_layer(const struct CustomData *data, int type, const char *name)
int CustomData_get_render_layer(const struct CustomData *data, int type)
@ BKE_MESH_BATCH_DIRTY_UVEDIT_ALL
@ BKE_MESH_BATCH_DIRTY_SELECT_PAINT
@ BKE_MESH_BATCH_DIRTY_SHADING
@ BKE_MESH_BATCH_DIRTY_UVEDIT_SELECT
@ BKE_MESH_BATCH_DIRTY_ALL
@ BKE_MESH_BATCH_DIRTY_SELECT
bool BKE_modifiers_uses_subsurf_facedots(const struct Scene *scene, struct Object *ob)
A BVH for high poly meshes.
void BKE_pbvh_update_normals(PBVH *pbvh, struct SubdivCCG *subdiv_ccg)
#define LISTBASE_FOREACH(type, var, list)
int BLI_listbase_count(const struct ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void BLI_task_graph_work_and_wait(struct TaskGraph *task_graph)
#define ME_USING_MIRROR_X_VERTEX_GROUPS(_me)
Object is a sort of wrapper for general info.
#define UV_SYNC_SELECTION
#define GPU_BATCH_CLEAR_SAFE(batch)
#define GPU_BATCH_DISCARD_SAFE(batch)
struct GPUIndexBuf GPUIndexBuf
#define GPU_INDEXBUF_DISCARD_SAFE(elem)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
ListBase GPU_material_attributes(GPUMaterial *material)
struct GPUVertBuf GPUVertBuf
#define GPU_VERTBUF_DISCARD_SAFE(verts)
Read Guarded memory(de)allocation.
Provides wrapper around system-specific atomic primitives, and some extensions (faked-atomic operatio...
ATOMIC_INLINE uint32_t atomic_fetch_and_or_uint32(uint32_t *p, uint32_t x)
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
static void texpaint_request_active_uv(MeshBatchCache *cache, Mesh *me)
GPUVertBuf * DRW_mesh_batch_cache_pos_vertbuf_get(Mesh *me)
static void mesh_batch_cache_request_surface_batches(MeshBatchCache *cache)
GPUBatch * DRW_mesh_batch_cache_get_edit_facedots(Mesh *me)
GPUBatch * DRW_mesh_batch_cache_get_surface_texpaint_single(Mesh *me)
BLI_INLINE void mesh_batch_cache_add_request(MeshBatchCache *cache, DRWBatchFlag new_flag)
static void sculpt_request_active_vcol(MeshBatchCache *cache, Mesh *me)
static void mesh_cd_calc_active_mask_uv_layer(const Mesh *me, DRW_MeshCDMask *cd_used)
GPUBatch * DRW_mesh_batch_cache_get_edituv_faces(Mesh *me)
static void mesh_batch_cache_discard_surface_batches(MeshBatchCache *cache)
GPUBatch * DRW_mesh_batch_cache_get_edit_vnors(Mesh *me)
static void mesh_batch_cache_init(Mesh *me)
GPUBatch * DRW_mesh_batch_cache_get_uv_edges(Mesh *me)
static void mesh_cd_calc_edit_uv_layer(const Mesh *UNUSED(me), DRW_MeshCDMask *cd_used)
void DRW_mesh_batch_cache_free_old(Mesh *me, int ctime)
GPUBatch * DRW_mesh_batch_cache_get_triangles_with_select_id(Mesh *me)
BLI_INLINE void mesh_cd_layers_type_merge(DRW_MeshCDMask *a, DRW_MeshCDMask b)
void DRW_mesh_batch_cache_free(Mesh *me)
static void mesh_cd_calc_active_uv_layer(const Mesh *me, DRW_MeshCDMask *cd_used)
GPUBatch * DRW_mesh_batch_cache_get_sculpt_overlays(Mesh *me)
GPUBatch ** DRW_mesh_batch_cache_get_surface_shaded(Mesh *me, struct GPUMaterial **gpumat_array, uint gpumat_array_len)
BLI_INLINE const CustomData * mesh_cd_vdata_get_from_mesh(const Mesh *me)
static void edituv_request_active_uv(MeshBatchCache *cache, Mesh *me)
static MeshBatchCache * mesh_batch_cache_get(Mesh *me)
GPUBatch * DRW_mesh_batch_cache_get_verts_with_select_id(Mesh *me)
BLI_INLINE void mesh_cd_layers_type_clear(DRW_MeshCDMask *a)
BLI_INLINE const Mesh * editmesh_final_or_this(const Mesh *me)
GPUBatch * DRW_mesh_batch_cache_get_edit_mesh_analysis(Mesh *me)
GPUBatch * DRW_mesh_batch_cache_get_edit_vertices(Mesh *me)
static void mesh_batch_cache_clear(Mesh *me)
GPUBatch * DRW_mesh_batch_cache_get_surface_weights(Mesh *me)
GPUBatch * DRW_mesh_batch_cache_get_edituv_edges(Mesh *me)
static bool drw_mesh_weight_state_compare(const struct DRW_MeshWeightState *a, const struct DRW_MeshWeightState *b)
static void drw_mesh_weight_state_clear(struct DRW_MeshWeightState *wstate)
GPUBatch * DRW_mesh_batch_cache_get_surface(Mesh *me)
GPUBatch * DRW_mesh_batch_cache_get_edges_with_select_id(Mesh *me)
static void mesh_batch_cache_discard_uvedit(MeshBatchCache *cache)
GPUBatch * DRW_mesh_batch_cache_get_surface_vertpaint(Mesh *me)
static bool mesh_batch_cache_valid(Mesh *me)
GPUBatch ** DRW_mesh_batch_cache_get_surface_texpaint(Mesh *me)
GPUBatch * DRW_mesh_batch_cache_get_edit_edges(Mesh *me)
static void mesh_cd_calc_active_vcol_layer(const Mesh *me, DRW_MeshCDMask *cd_used)
GPUBatch * DRW_mesh_batch_cache_get_loose_edges(Mesh *me)
GPUBatch * DRW_mesh_batch_cache_get_edge_detection(Mesh *me, bool *r_is_manifold)
static void mesh_batch_cache_discard_shaded_tri(MeshBatchCache *cache)
GPUBatch * DRW_mesh_batch_cache_get_all_edges(Mesh *me)
GPUBatch * DRW_mesh_batch_cache_get_edituv_facedots(Mesh *me)
int DRW_mesh_material_count_get(Mesh *me)
GPUBatch * DRW_mesh_batch_cache_get_edit_skin_roots(Mesh *me)
static void texpaint_request_active_vcol(MeshBatchCache *cache, Mesh *me)
static void mesh_cd_calc_active_mloopcol_layer(const Mesh *me, DRW_MeshCDMask *cd_used)
static void mesh_batch_cache_check_vertex_group(MeshBatchCache *cache, const struct DRW_MeshWeightState *wstate)
GPUBatch * DRW_mesh_batch_cache_get_edituv_verts(Mesh *me)
BLI_INLINE bool mesh_cd_layers_type_overlap(DRW_MeshCDMask a, DRW_MeshCDMask b)
GPUBatch * DRW_mesh_batch_cache_get_edit_triangles(Mesh *me)
GPUBatch * DRW_mesh_batch_cache_get_surface_edges(Mesh *me)
static void drw_mesh_weight_state_copy(struct DRW_MeshWeightState *wstate_dst, const struct DRW_MeshWeightState *wstate_src)
void DRW_mesh_batch_cache_dirty_tag(Mesh *me, eMeshBatchDirtyMode mode)
GPUBatch * DRW_mesh_batch_cache_get_edituv_faces_stretch_area(Mesh *me, float **tot_area, float **tot_uv_area)
GPUBatch * DRW_mesh_batch_cache_get_edit_lnors(Mesh *me)
void DRW_mesh_batch_cache_create_requested(struct TaskGraph *task_graph, Object *ob, Mesh *me, const Scene *scene, const bool is_paint_mode, const bool use_hide)
static bool drw_mesh_flags_equal(const bool *array1, const bool *array2, int size)
BLI_INLINE bool mesh_cd_layers_type_equal(DRW_MeshCDMask a, DRW_MeshCDMask b)
GPUBatch * DRW_mesh_batch_cache_get_all_verts(Mesh *me)
void DRW_mesh_batch_cache_validate(Mesh *me)
static DRW_MeshCDMask mesh_cd_calc_used_gpu_layers(const Mesh *me, struct GPUMaterial **gpumat_array, int gpumat_array_len)
static void mesh_batch_cache_discard_uvedit_select(MeshBatchCache *cache)
GPUBatch * DRW_mesh_batch_cache_get_surface_sculpt(Mesh *me)
static void drw_mesh_weight_state_extract(Object *ob, Mesh *me, const ToolSettings *ts, bool paint_mode, struct DRW_MeshWeightState *wstate)
GPUBatch * DRW_mesh_batch_cache_get_wireframes_face(Mesh *me)
BLI_INLINE const CustomData * mesh_cd_ldata_get_from_mesh(const Mesh *me)
GPUBatch * DRW_mesh_batch_cache_get_edituv_faces_stretch_angle(Mesh *me)
GPUBatch * DRW_mesh_batch_cache_get_facedots_with_select_id(Mesh *me)
BLI_INLINE void DRW_vbo_request(GPUBatch *batch, GPUVertBuf **vbo)
BLI_INLINE bool DRW_vbo_requested(GPUVertBuf *vbo)
BLI_INLINE bool DRW_batch_requested(GPUBatch *batch, int prim_type)
BLI_INLINE void DRW_ibo_request(GPUBatch *batch, GPUIndexBuf **ibo)
BLI_INLINE bool DRW_ibo_requested(GPUIndexBuf *ibo)
BLI_INLINE GPUBatch * DRW_batch_request(GPUBatch **batch)
bool DRW_object_is_in_edit_mode(const Object *ob)
void *(* MEM_dupallocN)(const void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
unsigned __int64 uint64_t
struct Mesh * mesh_eval_final
struct Mesh * mesh_eval_cage
GPUBatch * edit_selection_faces
DRW_MeshCDMask cd_used_over_time
GPUBatch * edit_selection_edges
GPUBatch ** surface_per_mat
GPUBatch * sculpt_overlays
DRWBatchFlag batch_requested
GPUBatch * edit_skin_roots
GPUBatch * edituv_faces_stretch_angle
GPUBatch * wire_loops_uvs
GPUBatch * edit_selection_verts
GPUBatch * edit_mesh_analysis
GPUBatch * edituv_faces_stretch_area
GPUBatch * edge_detection
struct DRW_MeshWeightState weight_state
GPUBatch * surface_weights
GPUBatch * edit_triangles
GPUBatch * edit_selection_fdots
struct MeshBatchCache::@262 batch
GPUIndexBuf * edituv_tris
GPUIndexBuf * edituv_fdots
GPUIndexBuf * lines_adjacency
GPUIndexBuf * lines_paint_mask
struct MeshBufferCache::@261 ibo
GPUIndexBuf * edituv_lines
GPUVertBuf * edituv_stretch_area
GPUVertBuf * edituv_stretch_angle
GPUIndexBuf ** tris_per_mat
GPUVertBuf * mesh_analysis
struct MeshBufferCache::@260 vbo
GPUIndexBuf * lines_loose
GPUVertBuf * fdots_edituv_data
GPUIndexBuf * edituv_points
struct SubdivCCG * subdiv_ccg
struct BMEditMesh * edit_mesh
struct CustomData pdata ldata
struct SculptSession * sculpt
struct ToolSettings * toolsettings