diff options
Diffstat (limited to 'source/blender/gpu/opengl/gl_vertex_buffer.hh')
-rw-r--r-- | source/blender/gpu/opengl/gl_vertex_buffer.hh | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/source/blender/gpu/opengl/gl_vertex_buffer.hh b/source/blender/gpu/opengl/gl_vertex_buffer.hh index 4c29c17dcf7..e0a21587b60 100644 --- a/source/blender/gpu/opengl/gl_vertex_buffer.hh +++ b/source/blender/gpu/opengl/gl_vertex_buffer.hh @@ -11,18 +11,23 @@ #include "glew-mx.h" +#include "GPU_texture.h" + #include "gpu_vertex_buffer_private.hh" namespace blender { namespace gpu { class GLVertBuf : public VertBuf { - friend class GLTexture; /* For buffer texture. */ - friend class GLShader; /* For transform feedback. */ + friend class GLTexture; /* For buffer texture. */ + friend class GLShader; /* For transform feedback. */ + friend class GLStorageBuf; /* For sub copy. */ private: /** OpenGL buffer handle. Init on first upload. Immutable after that. */ GLuint vbo_id_ = 0; + /** Texture used if the buffer is bound as buffer texture. Init on first use. */ + struct ::GPUTexture *buffer_texture_ = nullptr; /** Defines whether the buffer handle is wrapped by this GLVertBuf, i.e. we do not own it and * should not free it. */ bool is_wrapper_ = false; @@ -46,6 +51,7 @@ class GLVertBuf : public VertBuf { void upload_data() override; void duplicate_data(VertBuf *dst) override; void bind_as_ssbo(uint binding) override; + void bind_as_texture(uint binding) override; private: bool is_active() const; |