aboutsummaryrefslogtreecommitdiff
path: root/src/video_core/renderer_opengl/utils.h
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2019-06-20 03:44:06 -0300
committerReinUsesLisp <reinuseslisp@airmail.cc>2019-07-06 00:37:55 -0300
commit9cdc576f6055cbb308551f09e3566b34233b226e (patch)
tree7106c6ef615e0771a070afc3180d30cade558e74 /src/video_core/renderer_opengl/utils.h
parent1fa21fa1927feecc63f0d81824ce4ea203f79fcc (diff)
gl_rasterizer: Fix vertex and index data invalidations
Diffstat (limited to 'src/video_core/renderer_opengl/utils.h')
-rw-r--r--src/video_core/renderer_opengl/utils.h27
1 files changed, 27 insertions, 0 deletions
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<Entry> vertex_buffers;
+};
+
class BindBuffersRangePushBuffer final {
public:
explicit BindBuffersRangePushBuffer(GLenum target);