diff options
| author | Markus Wick <markus@selfnet.de> | 2018-09-05 11:36:50 +0200 |
|---|---|---|
| committer | Markus Wick <markus@selfnet.de> | 2018-09-05 18:46:35 +0200 |
| commit | d3ad9469a172eeaaf34ca641a6bf679b7b10eedf (patch) | |
| tree | f4883bd9d06a1f370039e96c41beea70ff1a3f2b /src/video_core/renderer_opengl/gl_rasterizer.h | |
| parent | 527e362a839632ab2d9f7fae3147f53709469d32 (diff) | |
gl_rasterizer: Implement a VAO cache.
This patch caches VAO objects instead of re-emiting all pointers per draw call.
Configuring this pointers is known as a fast task, but it yields too many GL
calls. So for better performance, just bind the VAO instead of 16 pointers.
Diffstat (limited to 'src/video_core/renderer_opengl/gl_rasterizer.h')
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.h b/src/video_core/renderer_opengl/gl_rasterizer.h index 4c4b084b8..9c30dc0e8 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.h +++ b/src/video_core/renderer_opengl/gl_rasterizer.h @@ -6,6 +6,7 @@ #include <array> #include <cstddef> +#include <map> #include <memory> #include <tuple> #include <utility> @@ -168,14 +169,15 @@ private: ScreenInfo& screen_info; std::unique_ptr<GLShader::ProgramManager> shader_program_manager; - OGLVertexArray sw_vao; - OGLVertexArray hw_vao; + std::map<std::array<Tegra::Engines::Maxwell3D::Regs::VertexAttribute, + Tegra::Engines::Maxwell3D::Regs::NumVertexAttributes>, + OGLVertexArray> + vertex_array_cache; std::array<SamplerInfo, GLShader::NumTextureSamplers> texture_samplers; static constexpr size_t STREAM_BUFFER_SIZE = 128 * 1024 * 1024; OGLBufferCache buffer_cache; - OGLBuffer uniform_buffer; OGLFramebuffer framebuffer; GLint uniform_buffer_alignment; |
