[Bf-blender-cvs] [b2bdbeced6b] temp-pbvh-vbos: temp-pbvh-vbos: Remove old pbvh draw code
Joseph Eagar
noreply at git.blender.org
Fri Sep 16 03:50:46 CEST 2022
Commit: b2bdbeced6babd48c949e8064f4dbe2c9cbfbc55
Author: Joseph Eagar
Date: Thu Sep 15 18:50:32 2022 -0700
Branches: temp-pbvh-vbos
https://developer.blender.org/rBb2bdbeced6babd48c949e8064f4dbe2c9cbfbc55
temp-pbvh-vbos: Remove old pbvh draw code
===================================================================
M source/blender/blenkernel/intern/pbvh.c
M source/blender/blenkernel/intern/pbvh.cc
M source/blender/blenkernel/intern/pbvh_bmesh.c
M source/blender/draw/intern/draw_manager_data.c
M source/blender/draw/intern/draw_pbvh.cc
M source/blender/gpu/CMakeLists.txt
D source/blender/gpu/GPU_buffers.h
D source/blender/gpu/intern/gpu_buffers.cc
===================================================================
diff --git a/source/blender/blenkernel/intern/pbvh.c b/source/blender/blenkernel/intern/pbvh.c
index f51756d4f23..d36d7ed0dab 100644
--- a/source/blender/blenkernel/intern/pbvh.c
+++ b/source/blender/blenkernel/intern/pbvh.c
@@ -29,8 +29,6 @@
#include "PIL_time.h"
-#include "GPU_buffers.h"
-
#include "bmesh.h"
#include "atomic_ops.h"
diff --git a/source/blender/blenkernel/intern/pbvh.cc b/source/blender/blenkernel/intern/pbvh.cc
index 70aeb10f087..4d1c2f0597f 100644
--- a/source/blender/blenkernel/intern/pbvh.cc
+++ b/source/blender/blenkernel/intern/pbvh.cc
@@ -29,8 +29,6 @@
#include "PIL_time.h"
-#include "GPU_buffers.h"
-
#include "bmesh.h"
#include "atomic_ops.h"
diff --git a/source/blender/blenkernel/intern/pbvh_bmesh.c b/source/blender/blenkernel/intern/pbvh_bmesh.c
index 3e5b07d0579..9240f8cb80f 100644
--- a/source/blender/blenkernel/intern/pbvh_bmesh.c
+++ b/source/blender/blenkernel/intern/pbvh_bmesh.c
@@ -17,7 +17,6 @@
#include "BKE_ccg.h"
#include "BKE_pbvh.h"
-#include "GPU_buffers.h"
#include "DRW_engine.h"
#include "bmesh.h"
diff --git a/source/blender/draw/intern/draw_manager_data.c b/source/blender/draw/intern/draw_manager_data.c
index c8ed8bfd94b..13e09dbb6b2 100644
--- a/source/blender/draw/intern/draw_manager_data.c
+++ b/source/blender/draw/intern/draw_manager_data.c
@@ -39,7 +39,6 @@
# include "BLI_math_bits.h"
#endif
-#include "GPU_buffers.h"
#include "GPU_capabilities.h"
#include "GPU_material.h"
#include "GPU_uniform_buffer.h"
diff --git a/source/blender/draw/intern/draw_pbvh.cc b/source/blender/draw/intern/draw_pbvh.cc
index 91fa6864826..309a5d442a0 100644
--- a/source/blender/draw/intern/draw_pbvh.cc
+++ b/source/blender/draw/intern/draw_pbvh.cc
@@ -32,7 +32,6 @@
#include "BKE_subdiv_ccg.h"
#include "GPU_batch.h"
-#include "GPU_buffers.h"
#include "DRW_engine.h"
#include "draw_pbvh.h"
diff --git a/source/blender/gpu/CMakeLists.txt b/source/blender/gpu/CMakeLists.txt
index 9baeedfcc2c..25f0e0fb053 100644
--- a/source/blender/gpu/CMakeLists.txt
+++ b/source/blender/gpu/CMakeLists.txt
@@ -47,7 +47,6 @@ set(SRC
intern/gpu_batch.cc
intern/gpu_batch_presets.c
intern/gpu_batch_utils.c
- intern/gpu_buffers.cc
intern/gpu_capabilities.cc
intern/gpu_codegen.cc
intern/gpu_compute.cc
@@ -84,7 +83,6 @@ set(SRC
GPU_batch.h
GPU_batch_presets.h
GPU_batch_utils.h
- GPU_buffers.h
GPU_capabilities.h
GPU_common.h
GPU_common_types.h
diff --git a/source/blender/gpu/GPU_buffers.h b/source/blender/gpu/GPU_buffers.h
deleted file mode 100644
index 1b8cc248ffb..00000000000
--- a/source/blender/gpu/GPU_buffers.h
+++ /dev/null
@@ -1,173 +0,0 @@
-#if 0
-
-/* SPDX-License-Identifier: GPL-2.0-or-later
- * Copyright 2005 Blender Foundation. All rights reserved. */
-
-/** \file
- * \ingroup gpu
- */
-
-#pragma once
-
-#include <stddef.h>
-
-#include "BKE_attribute.h"
-#include "BKE_pbvh.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct BMesh;
-struct CCGElem;
-struct CCGKey;
-struct DMFlagMat;
-struct GSet;
-struct TableGSet;
-struct Mesh;
-struct MLoop;
-struct MLoopCol;
-struct MLoopTri;
-struct MPoly;
-struct MPropCol;
-struct MVert;
-struct Mesh;
-struct PBVH;
-struct SubdivCCG;
-struct CustomData;
-struct GPUBatch;
-
-
-/**
- * Build must be called once before using the other functions,
- * used every time mesh topology changes.
- *
- * Threaded: do not call any functions that use OpenGL calls!
- */
-GPU_PBVH_Buffers *GPU_pbvh_mesh_buffers_build(const struct Mesh *mesh,
- const struct MLoopTri *looptri,
- const int *face_indices,
- int face_indices_len);
-
-/**
- * Threaded: do not call any functions that use OpenGL calls!
- */
-GPU_PBVH_Buffers *GPU_pbvh_grid_buffers_build(int totgrid,
- unsigned int **grid_hidden,
- bool smooth);
-
-/**
- * Threaded: do not call any functions that use OpenGL calls!
- */
-GPU_PBVH_Buffers *GPU_pbvh_bmesh_buffers_build(bool smooth_shading);
-
-/**
- * Free part of data for update. Not thread safe, must run in OpenGL main thread.
- */
-void GPU_pbvh_bmesh_buffers_update_free(GPU_PBVH_Buffers *buffers);
-void GPU_pbvh_grid_buffers_update_free(GPU_PBVH_Buffers *buffers,
- const struct DMFlagMat *grid_flag_mats,
- const int *grid_indices);
-
-/**
- * Update mesh buffers without topology changes. Threaded.
- */
-enum {
- GPU_PBVH_BUFFERS_SHOW_MASK = (1 << 1),
- GPU_PBVH_BUFFERS_SHOW_VCOL = (1 << 2),
- GPU_PBVH_BUFFERS_SHOW_SCULPT_FACE_SETS = (1 << 3),
-};
-
-/**
- * Creates a vertex buffer (coordinate, normal, color) and,
- * if smooth shading, an element index buffer.
- * Threaded: do not call any functions that use OpenGL calls!
- */
-void GPU_pbvh_mesh_buffers_update(PBVHGPUFormat *vbo_id,
- GPU_PBVH_Buffers *buffers,
- const struct Mesh *mesh,
- const struct MVert *mvert,
- 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]);
-
-bool GPU_pbvh_attribute_names_update(PBVHType pbvh_type,
- PBVHGPUFormat *vbo_id,
- const struct CustomData *vdata,
- const struct CustomData *ldata,
- bool active_attrs_only);
-
-/**
- * Creates a vertex buffer (coordinate, normal, color) and,
- * if smooth shading, an element index buffer.
- * Threaded: do not call any functions that use OpenGL calls!
- */
-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);
-
-/**
- * Threaded: do not call any functions that use OpenGL calls!
- */
-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);
-
-/**
- * Finish update. Not thread safe, must run in OpenGL main
- * thread.
- */
-void GPU_pbvh_buffers_update_flush(GPU_PBVH_Buffers *buffers);
-
-/**
- * Free buffers. Not thread safe, must run in OpenGL main thread.
- */
-void GPU_pbvh_buffers_free(GPU_PBVH_Buffers *buffers);
-
-/** Draw. */
-struct GPUBatch *GPU_pbvh_buffers_batch_get(GPU_PBVH_Buffers *buffers, bool fast, bool wires);
-
-short GPU_pbvh_buffers_material_index_get(GPU_PBVH_Buffers *buffers);
-bool GPU_pbvh_buffers_has_overlays(GPU_PBVH_Buffers *buffers);
-
-PBVHGPUFormat *GPU_pbvh_make_format(void);
-void GPU_pbvh_free_format(PBVHGPUFormat *vbo_id);
-
-void GPU_pbvh_node_update(PBVHBatches *batches, struct PBVH_GPU_Args *args);
-PBVHBatches *GPU_pbvh_node_create(struct PBVH_GPU_Args *args);
-
-void GPU_pbvh_node_free(PBVHBatches *batches);
-
-struct GPUBatch *GPU_pbvh_tris_get(PBVHBatches *batches,
- struct PBVHAttrReq *attrs,
- int attrs_num,
- struct PBVH_GPU_Args *args,
- int *r_prim_count);
-
-struct GPUBatch *GPU_pbvh_lines_get(PBVHBatches *batches,
- struct PBVHAttrReq *attrs,
- int attrs_num,
- struct PBVH_GPU_Args *args,
- int *r_prim_count);
-void GPU_pbvh_node_gpu_flush(PBVHBatches *batches);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/source/blender/gpu/intern/gpu_buffers.cc b/source/blender/gpu/intern/gpu_buffers.cc
deleted file mode 100644
index 939b9639245..00000000000
--- a/source/blender/gpu/intern/gpu_buffers.cc
+++ /dev/null
@@ -1,1490 +0,0 @@
-#if 0
-/* SPDX-License-Identifier: GPL-2.0-or-later
- * Copyright 2005 Blender Foundation. All rights reserved. */
-
-/** \file
- * \ingroup gpu
- *
- * Mesh drawing using OpenGL VBO (Vertex Buffer Objects)
- */
-
-#include <limits.h>
-#include <stddef.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "MEM_guardedalloc.h"
-
-#include "BLI_bitmap.h"
-#include "BLI_ghash.h"
-#include "BLI_math_color.h"
-#include "BLI_utildefines.h"
-
-#include "DNA_mesh_types.h"
-#include "DNA_meshdata_types.h"
-
-#include "BKE_DerivedMesh.h"
-#include "BKE_attribute.h"
-#include "BKE_ccg.h"
-#include "BKE_customdata.h"
-#include "BKE_mesh.h"
-#include "BKE_paint.h"
-#include "BKE_pbvh.h"
-#include "BKE_subdiv_ccg.h"
-
-#include "GPU_batch.h"
-#include "GPU_buffers.h"
-
-#include "DRW_engine.h"
-
-#include "gpu_private.h"
-
-#include "bmesh.h"
-
-#define MAX_PBVH_BATCH_KEY 512
-#define MAX_PBVH_VBOS 16
-
-#include "BLI_index_range.hh"
-#include "BLI_map.hh"
-#include "BLI_math_vec_types.hh"
-#include "BLI_vector.hh"
-#include <vector>
-
-#include <algorithm>
-#include <string>
-
-struct GPU_PBVH_Buffers {
- GPUIndexBuf *index_buf, *index_buf_fast;
- GPUIndexBuf *index_lines_buf, *inde
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list