From 9cdc576f6055cbb308551f09e3566b34233b226e Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Thu, 20 Jun 2019 03:44:06 -0300 Subject: gl_rasterizer: Fix vertex and index data invalidations --- src/video_core/renderer_opengl/utils.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'src/video_core/renderer_opengl/utils.h') diff --git a/src/video_core/renderer_opengl/utils.h b/src/video_core/renderer_opengl/utils.h index d2a3d25d9..6c2b45546 100644 --- a/src/video_core/renderer_opengl/utils.h +++ b/src/video_core/renderer_opengl/utils.h @@ -11,6 +11,33 @@ namespace OpenGL { +class VertexArrayPushBuffer final { +public: + explicit VertexArrayPushBuffer(); + ~VertexArrayPushBuffer(); + + void Setup(GLuint vao_); + + void SetIndexBuffer(const GLuint* buffer); + + void SetVertexBuffer(GLuint binding_index, const GLuint* buffer, GLintptr offset, + GLsizei stride); + + void Bind(); + +private: + struct Entry { + GLuint binding_index{}; + const GLuint* buffer{}; + GLintptr offset{}; + GLsizei stride{}; + }; + + GLuint vao{}; + const GLuint* index_buffer{}; + std::vector vertex_buffers; +}; + class BindBuffersRangePushBuffer final { public: explicit BindBuffersRangePushBuffer(GLenum target); -- cgit v1.2.3