Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Eagar <joeedh@gmail.com>2022-09-28 23:34:28 +0300
committerJoseph Eagar <joeedh@gmail.com>2022-09-28 23:34:28 +0300
commit73c26e99561e3268dfe3f107161f8c2c0b7720ec (patch)
tree5904cbdd2ab8d937c85bf218625c14cea0b99fee
parented80ba27876f6da0925e81d22c8be3e54ce0273e (diff)
temp-pbvh-vbos: final patch revision
m---------release/datafiles/locale0
m---------release/scripts/addons0
m---------release/scripts/addons_contrib0
-rw-r--r--source/blender/blenkernel/intern/pbvh.c2
-rw-r--r--source/blender/blenkernel/intern/pbvh_bmesh.c2
-rw-r--r--source/blender/draw/CMakeLists.txt1
-rw-r--r--source/blender/draw/DRW_engine.h74
-rw-r--r--source/blender/draw/DRW_pbvh.h98
-rw-r--r--source/blender/draw/intern/draw_manager_data.c2
-rw-r--r--source/blender/draw/intern/draw_pbvh.cc4
m---------source/tools0
11 files changed, 105 insertions, 78 deletions
diff --git a/release/datafiles/locale b/release/datafiles/locale
-Subproject 7be7aff5a18c550465b3f7634539ed4168af7c5
+Subproject 1b891478f44dd047c3a92fda3ebd17fae1c3acd
diff --git a/release/scripts/addons b/release/scripts/addons
-Subproject 726d08c9036b939f46b59bceb72a61e3102600c
+Subproject 67f1fbca1482d9d9362a4001332e785c3fd5d23
diff --git a/release/scripts/addons_contrib b/release/scripts/addons_contrib
-Subproject c43c0b2bcf08c34d933c3b56f096c9a23c8eff6
+Subproject 95107484d076bc965239942e857c83433bfa86d
diff --git a/source/blender/blenkernel/intern/pbvh.c b/source/blender/blenkernel/intern/pbvh.c
index 23cefa14a73..a1de8e40fe3 100644
--- a/source/blender/blenkernel/intern/pbvh.c
+++ b/source/blender/blenkernel/intern/pbvh.c
@@ -25,7 +25,7 @@
#include "BKE_pbvh.h"
#include "BKE_subdiv_ccg.h"
-#include "DRW_engine.h"
+#include "DRW_pbvh.h"
#include "PIL_time.h"
diff --git a/source/blender/blenkernel/intern/pbvh_bmesh.c b/source/blender/blenkernel/intern/pbvh_bmesh.c
index 795117a8f73..de908adac79 100644
--- a/source/blender/blenkernel/intern/pbvh_bmesh.c
+++ b/source/blender/blenkernel/intern/pbvh_bmesh.c
@@ -17,7 +17,7 @@
#include "BKE_ccg.h"
#include "BKE_pbvh.h"
-#include "DRW_engine.h"
+#include "DRW_pbvh.h"
#include "bmesh.h"
#include "pbvh_intern.h"
diff --git a/source/blender/draw/CMakeLists.txt b/source/blender/draw/CMakeLists.txt
index b477182dbb6..2acff89ce7e 100644
--- a/source/blender/draw/CMakeLists.txt
+++ b/source/blender/draw/CMakeLists.txt
@@ -208,6 +208,7 @@ set(SRC
DRW_engine.h
DRW_select_buffer.h
+ DRW_pbvh.h
intern/DRW_gpu_wrapper.hh
intern/DRW_render.h
intern/draw_attributes.h
diff --git a/source/blender/draw/DRW_engine.h b/source/blender/draw/DRW_engine.h
index cfa122845f4..dec7a22aadb 100644
--- a/source/blender/draw/DRW_engine.h
+++ b/source/blender/draw/DRW_engine.h
@@ -7,12 +7,7 @@
#pragma once
-#include "BLI_assert.h"
-#include "BLI_bitmap.h"
#include "BLI_sys_types.h" /* for bool */
-#include "BLI_utildefines.h"
-
-#include "BKE_ccg.h"
#include "DNA_object_enums.h"
@@ -32,16 +27,9 @@ struct GPUVertFormat;
struct CustomDataLayer;
struct CustomData;
struct GPUViewport;
-struct PBVHAttrReq;
-struct GPUBatch;
struct ID;
struct Main;
struct Object;
-struct PBVH_GPU_Args;
-struct PBVHBatches;
-struct PBVHNode;
-struct CCGElem;
-struct DMFlagMat;
struct Render;
struct RenderEngine;
struct RenderEngineType;
@@ -239,68 +227,6 @@ void DRW_cdlayer_attr_aliases_add(struct GPUVertFormat *format,
const struct CustomDataLayer *cl,
bool is_active_render,
bool is_active_layer);
-
-/* PBVH */
-
-typedef struct PBVHBatches PBVHBatches;
-
-typedef struct PBVH_GPU_Args {
- int pbvh_type;
-
- struct BMesh *bm;
- const struct Mesh *me;
- const struct MVert *mvert;
- const struct MLoop *mloop;
- const struct MPoly *mpoly;
- int mesh_verts_num, mesh_faces_num, mesh_grids_num;
- struct CustomData *vdata, *ldata, *pdata;
- const float (*vert_normals)[3];
-
- int face_sets_color_seed, face_sets_color_default;
- int *face_sets; /* for PBVH_FACES and PBVH_GRIDS */
-
- struct SubdivCCG *subdiv_ccg;
- const struct DMFlagMat *grid_flag_mats;
- const int *grid_indices;
- struct CCGKey ccg_key;
- CCGElem **grids;
- void **gridfaces;
- BLI_bitmap **grid_hidden;
-
- int *prim_indices;
- int totprim;
-
- bool *hide_poly;
-
- int node_verts_num;
-
- const struct MLoopTri *mlooptri;
- struct PBVHNode *node;
-
- /* BMesh. */
- struct GSet *bm_unique_vert, *bm_other_verts, *bm_faces;
- int cd_mask_layer;
-} PBVH_GPU_Args;
-
-typedef struct PBVHGPUFormat PBVHGPUFormat;
-
-void DRW_pbvh_node_update(struct PBVHBatches *batches, struct PBVH_GPU_Args *args);
-void DRW_pbvh_update_pre(struct PBVHBatches *batches, struct PBVH_GPU_Args *args);
-
-void DRW_pbvh_node_gpu_flush(struct PBVHBatches *batches);
-struct PBVHBatches *DRW_pbvh_node_create(struct PBVH_GPU_Args *args);
-void DRW_pbvh_node_free(struct PBVHBatches *batches);
-struct GPUBatch *DRW_pbvh_tris_get(struct PBVHBatches *batches,
- struct PBVHAttrReq *attrs,
- int attrs_num,
- struct PBVH_GPU_Args *args,
- int *r_prim_count);
-struct GPUBatch *DRW_pbvh_lines_get(struct PBVHBatches *batches,
- struct PBVHAttrReq *attrs,
- int attrs_num,
- struct PBVH_GPU_Args *args,
- int *r_prim_count);
-
#ifdef __cplusplus
}
#endif
diff --git a/source/blender/draw/DRW_pbvh.h b/source/blender/draw/DRW_pbvh.h
new file mode 100644
index 00000000000..ffd4b92d87b
--- /dev/null
+++ b/source/blender/draw/DRW_pbvh.h
@@ -0,0 +1,98 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later
+ * Copyright 2022 Blender Foundation. */
+
+/** \file
+ * \ingroup draw
+ */
+
+#pragma once
+
+/* Needed for BKE_ccg.h. */
+#include "BLI_assert.h"
+#include "BLI_bitmap.h"
+
+#include "BKE_ccg.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct GPUViewport;
+struct PBVHAttrReq;
+struct GPUBatch;
+struct PBVHNode;
+struct GSet;
+struct DMFlagMat;
+struct Object;
+struct Mesh;
+struct MLoopTri;
+struct CustomData;
+struct MVert;
+struct MEdge;
+struct MLoop;
+struct MPoly;
+struct SubdivCCG;
+struct BMesh;
+
+typedef struct PBVHBatches PBVHBatches;
+
+typedef struct PBVH_GPU_Args {
+ int pbvh_type;
+
+ struct BMesh *bm;
+ const struct Mesh *me;
+ const struct MVert *mvert;
+ const struct MLoop *mloop;
+ const struct MPoly *mpoly;
+ int mesh_verts_num, mesh_faces_num, mesh_grids_num;
+ struct CustomData *vdata, *ldata, *pdata;
+ const float (*vert_normals)[3];
+
+ int face_sets_color_seed, face_sets_color_default;
+ int *face_sets; /* for PBVH_FACES and PBVH_GRIDS */
+
+ struct SubdivCCG *subdiv_ccg;
+ const struct DMFlagMat *grid_flag_mats;
+ const int *grid_indices;
+ CCGKey ccg_key;
+ CCGElem **grids;
+ void **gridfaces;
+ BLI_bitmap **grid_hidden;
+
+ int *prim_indices;
+ int totprim;
+
+ bool *hide_poly;
+
+ int node_verts_num;
+
+ const struct MLoopTri *mlooptri;
+ struct PBVHNode *node;
+
+ /* BMesh. */
+ struct GSet *bm_unique_vert, *bm_other_verts, *bm_faces;
+ int cd_mask_layer;
+} PBVH_GPU_Args;
+
+typedef struct PBVHGPUFormat PBVHGPUFormat;
+
+void DRW_pbvh_node_update(PBVHBatches *batches, PBVH_GPU_Args *args);
+void DRW_pbvh_update_pre(PBVHBatches *batches, PBVH_GPU_Args *args);
+
+void DRW_pbvh_node_gpu_flush(PBVHBatches *batches);
+struct PBVHBatches *DRW_pbvh_node_create(PBVH_GPU_Args *args);
+void DRW_pbvh_node_free(PBVHBatches *batches);
+struct GPUBatch *DRW_pbvh_tris_get(PBVHBatches *batches,
+ struct PBVHAttrReq *attrs,
+ int attrs_num,
+ PBVH_GPU_Args *args,
+ int *r_prim_count);
+struct GPUBatch *DRW_pbvh_lines_get(struct PBVHBatches *batches,
+ struct PBVHAttrReq *attrs,
+ int attrs_num,
+ PBVH_GPU_Args *args,
+ int *r_prim_count);
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/source/blender/draw/intern/draw_manager_data.c b/source/blender/draw/intern/draw_manager_data.c
index 6f70b2a43ed..3e0708d8b49 100644
--- a/source/blender/draw/intern/draw_manager_data.c
+++ b/source/blender/draw/intern/draw_manager_data.c
@@ -5,6 +5,8 @@
* \ingroup draw
*/
+#include "DRW_pbvh.h"
+
#include "draw_attributes.h"
#include "draw_manager.h"
#include "draw_pbvh.h"
diff --git a/source/blender/draw/intern/draw_pbvh.cc b/source/blender/draw/intern/draw_pbvh.cc
index db854972ce8..126ba98d06c 100644
--- a/source/blender/draw/intern/draw_pbvh.cc
+++ b/source/blender/draw/intern/draw_pbvh.cc
@@ -46,10 +46,10 @@
#include "GPU_batch.h"
#include "DRW_engine.h"
-#include "draw_pbvh.h"
+#include "DRW_pbvh.h"
+#include "draw_pbvh.h"
#include "gpu_private.h"
-
#include "bmesh.h"
#define MAX_PBVH_BATCH_KEY 512
diff --git a/source/tools b/source/tools
-Subproject 2ab59df2c987d383a7ed9dbcd4f3897bbba7c12
+Subproject 2a541f164a222ef7bcd036d37687738acee8d94