Refactor: Remove unnecessary C wrappers for vertex and index buffers
Now that all relevant code is C++, the indirection from the C struct `GPUVertBuf` to the C++ `blender::gpu::VertBuf` class just adds complexity and necessitates a wrapper API, making more cleanups like use of RAII or other C++ types more difficult. This commit replaces the C wrapper structs with direct use of the vertex and index buffer base classes. In C++ we can choose which parts of a class are private, so we don't risk exposing too many implementation details here. Pull Request: https://projects.blender.org/blender/blender/pulls/119825
This commit is contained in:
@@ -10,7 +10,9 @@
|
||||
|
||||
#include "BLI_compiler_attrs.h"
|
||||
|
||||
struct GPUVertBuf;
|
||||
namespace blender::gpu {
|
||||
class VertBuf;
|
||||
}
|
||||
|
||||
extern PyTypeObject BPyGPUVertBuf_Type;
|
||||
|
||||
@@ -19,7 +21,7 @@ extern PyTypeObject BPyGPUVertBuf_Type;
|
||||
struct BPyGPUVertBuf {
|
||||
PyObject_VAR_HEAD
|
||||
/* The buf is owned, we may support thin wrapped batches later. */
|
||||
GPUVertBuf *buf;
|
||||
blender::gpu::VertBuf *buf;
|
||||
};
|
||||
|
||||
PyObject *BPyGPUVertBuf_CreatePyObject(GPUVertBuf *buf) ATTR_NONNULL(1);
|
||||
PyObject *BPyGPUVertBuf_CreatePyObject(blender::gpu::VertBuf *buf) ATTR_NONNULL(1);
|
||||
|
||||
Reference in New Issue
Block a user