Blender  V3.3
GPU_buffers.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2005 Blender Foundation. All rights reserved. */
3 
8 #pragma once
9 
10 #include <stddef.h>
11 
12 #include "BKE_attribute.h"
13 #include "BKE_pbvh.h"
14 
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18 
19 struct BMesh;
20 struct CCGElem;
21 struct CCGKey;
22 struct DMFlagMat;
23 struct GSet;
24 struct TableGSet;
25 struct MLoop;
26 struct MLoopCol;
27 struct MLoopTri;
28 struct MPoly;
29 struct MPropCol;
30 struct MVert;
31 struct Mesh;
32 struct PBVH;
33 struct SubdivCCG;
34 struct CustomData;
35 
36 typedef struct PBVHGPUFormat PBVHGPUFormat;
37 
41 typedef struct GPU_PBVH_Buffers GPU_PBVH_Buffers;
42 
50  const struct MLoop *mloop,
51  const struct MLoopTri *looptri,
52  const struct MVert *mvert,
53  const int *face_indices,
54  const int *sculpt_face_sets,
55  int face_indices_len,
56  const struct Mesh *mesh);
57 
62  unsigned int **grid_hidden,
63  bool smooth);
64 
69 
75  const struct DMFlagMat *grid_flag_mats,
76  const int *grid_indices);
77 
81 enum {
85 };
86 
93  GPU_PBVH_Buffers *buffers,
94  const struct MVert *mvert,
95  const CustomData *vdata,
96  const CustomData *ldata,
97  const float *vmask,
98  const int *sculpt_face_sets,
99  const int face_sets_color_seed,
100  const int face_sets_color_default,
101  const int update_flags,
102  const float (*vert_normals)[3]);
103 
105  PBVHGPUFormat *vbo_id,
106  const struct CustomData *vdata,
107  const struct CustomData *ldata,
108  bool active_attrs_only);
109 
116  struct GPU_PBVH_Buffers *buffers,
117  struct BMesh *bm,
118  struct GSet *bm_faces,
119  struct GSet *bm_unique_verts,
120  struct GSet *bm_other_verts,
121  const int update_flags);
122 
127  GPU_PBVH_Buffers *buffers,
128  struct SubdivCCG *subdiv_ccg,
129  struct CCGElem **grids,
130  const struct DMFlagMat *grid_flag_mats,
131  int *grid_indices,
132  int totgrid,
133  const int *sculpt_face_sets,
134  int face_sets_color_seed,
135  int face_sets_color_default,
136  const struct CCGKey *key,
137  int update_flags);
138 
144 
149 
151 struct GPUBatch *GPU_pbvh_buffers_batch_get(GPU_PBVH_Buffers *buffers, bool fast, bool wires);
152 
155 
157 void GPU_pbvh_free_format(PBVHGPUFormat *vbo_id);
158 
159 #ifdef __cplusplus
160 }
161 #endif
Generic geometry attributes built on CustomData.
struct CCGElem CCGElem
Definition: BKE_ccg.h:30
A BVH for high poly meshes.
PBVHType
Definition: BKE_pbvh.h:233
struct GSet GSet
Definition: BLI_ghash.h:340
GPUBatch
Definition: GPU_batch.h:78
GPU_PBVH_Buffers * GPU_pbvh_mesh_buffers_build(const struct MPoly *mpoly, const struct MLoop *mloop, const struct MLoopTri *looptri, const struct MVert *mvert, const int *face_indices, const int *sculpt_face_sets, int face_indices_len, const struct Mesh *mesh)
short GPU_pbvh_buffers_material_index_get(GPU_PBVH_Buffers *buffers)
Definition: gpu_buffers.c:1439
struct GPUBatch * GPU_pbvh_buffers_batch_get(GPU_PBVH_Buffers *buffers, bool fast, bool wires)
Definition: gpu_buffers.c:1425
void GPU_pbvh_buffers_free(GPU_PBVH_Buffers *buffers)
Definition: gpu_buffers.c:1471
void GPU_pbvh_bmesh_buffers_update(PBVHGPUFormat *vbo_id, struct GPU_PBVH_Buffers *buffers, struct BMesh *bm, struct GSet *bm_faces, struct GSet *bm_unique_verts, struct GSet *bm_other_verts, const int update_flags)
Definition: gpu_buffers.c:999
void GPU_pbvh_bmesh_buffers_update_free(GPU_PBVH_Buffers *buffers)
Definition: gpu_buffers.c:984
void GPU_pbvh_free_format(PBVHGPUFormat *vbo_id)
Definition: gpu_buffers.c:113
@ GPU_PBVH_BUFFERS_SHOW_MASK
Definition: GPU_buffers.h:82
@ GPU_PBVH_BUFFERS_SHOW_VCOL
Definition: GPU_buffers.h:83
@ GPU_PBVH_BUFFERS_SHOW_SCULPT_FACE_SETS
Definition: GPU_buffers.h:84
void GPU_pbvh_mesh_buffers_update(PBVHGPUFormat *vbo_id, GPU_PBVH_Buffers *buffers, const struct MVert *mvert, const CustomData *vdata, const CustomData *ldata, const float *vmask, const int *sculpt_face_sets, const int face_sets_color_seed, const int face_sets_color_default, const int update_flags, const float(*vert_normals)[3])
void GPU_pbvh_grid_buffers_update(PBVHGPUFormat *vbo_id, GPU_PBVH_Buffers *buffers, struct SubdivCCG *subdiv_ccg, struct CCGElem **grids, const struct DMFlagMat *grid_flag_mats, int *grid_indices, int totgrid, const int *sculpt_face_sets, int face_sets_color_seed, int face_sets_color_default, const struct CCGKey *key, int update_flags)
Definition: gpu_buffers.c:706
bool GPU_pbvh_buffers_has_overlays(GPU_PBVH_Buffers *buffers)
Definition: gpu_buffers.c:1434
void GPU_pbvh_buffers_update_flush(GPU_PBVH_Buffers *buffers)
Definition: gpu_buffers.c:1457
GPU_PBVH_Buffers * GPU_pbvh_grid_buffers_build(int totgrid, unsigned int **grid_hidden, bool smooth)
Definition: gpu_buffers.c:884
GPU_PBVH_Buffers * GPU_pbvh_bmesh_buffers_build(bool smooth_shading)
Definition: gpu_buffers.c:1169
bool GPU_pbvh_attribute_names_update(PBVHType pbvh_type, PBVHGPUFormat *vbo_id, const struct CustomData *vdata, const struct CustomData *ldata, bool active_attrs_only)
void GPU_pbvh_grid_buffers_update_free(GPU_PBVH_Buffers *buffers, const struct DMFlagMat *grid_flag_mats, const int *grid_indices)
Definition: gpu_buffers.c:686
PBVHGPUFormat * GPU_pbvh_make_format(void)
Definition: gpu_buffers.c:104
ATTR_WARN_UNUSED_RESULT BMesh * bm
smooth(Type::FLOAT, "mask_weight")
Definition: BKE_ccg.h:32
const int * grid_indices
Definition: gpu_buffers.c:67
const int * face_indices
Definition: gpu_buffers.c:59
const MVert * mvert
Definition: gpu_buffers.c:57
const MPoly * mpoly
Definition: gpu_buffers.c:54
CCGElem ** grids
Definition: gpu_buffers.c:64
const MLoopTri * looptri
Definition: gpu_buffers.c:56
const MLoop * mloop
Definition: gpu_buffers.c:55
const DMFlagMat * grid_flag_mats
Definition: gpu_buffers.c:65
BLI_bitmap *const * grid_hidden
Definition: gpu_buffers.c:66