diff options
author | bunnei <bunneidev@gmail.com> | 2019-07-15 01:03:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-15 01:03:43 +0200 |
commit | 3477b92289244a26e0bfd5a95d60bce53fd1ed61 (patch) | |
tree | 57f26db30db2d2f52029b1f51010459eb9dfb5e4 /src/video_core/renderer_opengl/utils.h | |
parent | Merge pull request #2690 from SciresM/physmem_fixes (diff) | |
parent | buffer_cache: Avoid [[nodiscard]] to make clang-format happy (diff) | |
download | yuzu-3477b92289244a26e0bfd5a95d60bce53fd1ed61.tar yuzu-3477b92289244a26e0bfd5a95d60bce53fd1ed61.tar.gz yuzu-3477b92289244a26e0bfd5a95d60bce53fd1ed61.tar.bz2 yuzu-3477b92289244a26e0bfd5a95d60bce53fd1ed61.tar.lz yuzu-3477b92289244a26e0bfd5a95d60bce53fd1ed61.tar.xz yuzu-3477b92289244a26e0bfd5a95d60bce53fd1ed61.tar.zst yuzu-3477b92289244a26e0bfd5a95d60bce53fd1ed61.zip |
Diffstat (limited to 'src/video_core/renderer_opengl/utils.h')
-rw-r--r-- | src/video_core/renderer_opengl/utils.h | 41 |
1 files changed, 35 insertions, 6 deletions
diff --git a/src/video_core/renderer_opengl/utils.h b/src/video_core/renderer_opengl/utils.h index 4a752f3b4..6c2b45546 100644 --- a/src/video_core/renderer_opengl/utils.h +++ b/src/video_core/renderer_opengl/utils.h @@ -11,20 +11,49 @@ namespace OpenGL { -class BindBuffersRangePushBuffer { +class VertexArrayPushBuffer final { public: - BindBuffersRangePushBuffer(GLenum target); + 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); ~BindBuffersRangePushBuffer(); void Setup(GLuint first_); - void Push(GLuint buffer, GLintptr offset, GLsizeiptr size); + void Push(const GLuint* buffer, GLintptr offset, GLsizeiptr size); - void Bind() const; + void Bind(); private: - GLenum target; - GLuint first; + GLenum target{}; + GLuint first{}; + std::vector<const GLuint*> buffer_pointers; + std::vector<GLuint> buffers; std::vector<GLintptr> offsets; std::vector<GLsizeiptr> sizes; |