GPUVertBuf: GL Backend Isolation

Part of the Vulkan port T68990

This makes a few changes in how the data is being handled by the
backend to allow more flexibility in the future.

The overall code logic is left unchanged.
This commit is contained in:
2020-09-07 01:20:55 +02:00
parent bb2aeb4504
commit c38debd39f
7 changed files with 224 additions and 167 deletions

View File

@@ -37,19 +37,20 @@ class GLVertBuf : public VertBuf {
friend class GLShader; /* For transform feedback. */
private:
// GLuint vbo_id_ = 0;
/** OpenGL buffer handle. Init on first upload. Immutable after that. */
GLuint vbo_id_ = 0;
/** Size on the GPU. */
// size_t vbo_size_ = 0;
size_t vbo_size_ = 0;
public:
void bind(void);
protected:
uchar *acquire_data(void);
uchar *resize_data(void);
void release_data(void);
void upload_data(void);
void duplicate_data(VertBuf *dst);
void acquire_data(void) override;
void resize_data(void) override;
void release_data(void) override;
void upload_data(void) override;
void duplicate_data(VertBuf *dst) override;
MEM_CXX_CLASS_ALLOC_FUNCS("GLVertBuf");
};