From 370ab5df9b34882fb17d5fe680b4c48f6d56065c Mon Sep 17 00:00:00 2001 From: Subv Date: Sat, 19 May 2018 11:36:09 -0500 Subject: GLRenderer: Remove unused vertex buffer and increase the size of the stream buffer to 128 MB. The stream buffer is where all the vertex data is copied, some games require this to be much bigger than the 4 MB we used to have. --- src/video_core/renderer_opengl/gl_rasterizer.cpp | 5 +---- src/video_core/renderer_opengl/gl_rasterizer.h | 7 ++----- 2 files changed, 3 insertions(+), 9 deletions(-) (limited to 'src/video_core/renderer_opengl') diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index 907236136..39546b7ef 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -75,14 +75,11 @@ RasterizerOpenGL::RasterizerOpenGL() { // Clipping plane 0 is always enabled for PICA fixed clip plane z <= 0 state.clip_distance[0] = true; - // Generate VBO, VAO and UBO - vertex_buffer = OGLStreamBuffer::MakeBuffer(GLAD_GL_ARB_buffer_storage, GL_ARRAY_BUFFER); - vertex_buffer->Create(VERTEX_BUFFER_SIZE, VERTEX_BUFFER_SIZE / 2); + // Generate VAO and UBO sw_vao.Create(); uniform_buffer.Create(); state.draw.vertex_array = sw_vao.handle; - state.draw.vertex_buffer = vertex_buffer->GetHandle(); state.draw.uniform_buffer = uniform_buffer.handle; state.Apply(); diff --git a/src/video_core/renderer_opengl/gl_rasterizer.h b/src/video_core/renderer_opengl/gl_rasterizer.h index 9709e595e..158b74436 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.h +++ b/src/video_core/renderer_opengl/gl_rasterizer.h @@ -141,14 +141,11 @@ private: Tegra::Engines::Maxwell3D::Regs::MaxShaderStage> ssbos; - static constexpr size_t VERTEX_BUFFER_SIZE = 128 * 1024 * 1024; - std::unique_ptr vertex_buffer; + static constexpr size_t STREAM_BUFFER_SIZE = 128 * 1024 * 1024; + std::unique_ptr stream_buffer; OGLBuffer uniform_buffer; OGLFramebuffer framebuffer; - static constexpr size_t STREAM_BUFFER_SIZE = 4 * 1024 * 1024; - std::unique_ptr stream_buffer; - size_t CalculateVertexArraysSize() const; std::pair SetupVertexArrays(u8* array_ptr, GLintptr buffer_offset); -- cgit v1.2.3 From 98b143c2d6f6e0bc2402333968fba3e42ac8f2b9 Mon Sep 17 00:00:00 2001 From: Subv Date: Sat, 19 May 2018 11:36:38 -0500 Subject: GLRenderer: Remove unused hw_vao_enabled_attributes variable. --- src/video_core/renderer_opengl/gl_rasterizer.cpp | 3 --- src/video_core/renderer_opengl/gl_rasterizer.h | 1 - 2 files changed, 4 deletions(-) (limited to 'src/video_core/renderer_opengl') diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index 39546b7ef..35c1b1890 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -87,7 +87,6 @@ RasterizerOpenGL::RasterizerOpenGL() { framebuffer.Create(); hw_vao.Create(); - hw_vao_enabled_attributes.fill(false); stream_buffer = OGLStreamBuffer::MakeBuffer(has_ARB_buffer_storage, GL_ARRAY_BUFFER); stream_buffer->Create(STREAM_BUFFER_SIZE, STREAM_BUFFER_SIZE / 2); @@ -178,8 +177,6 @@ std::pair RasterizerOpenGL::SetupVertexArrays(u8* array_ptr, glVertexAttribFormat(index, attrib.ComponentCount(), MaxwellToGL::VertexType(attrib), attrib.IsNormalized() ? GL_TRUE : GL_FALSE, attrib.offset); glVertexAttribBinding(index, attrib.buffer); - - hw_vao_enabled_attributes[index] = true; } return {array_ptr, buffer_offset}; diff --git a/src/video_core/renderer_opengl/gl_rasterizer.h b/src/video_core/renderer_opengl/gl_rasterizer.h index 158b74436..4b915c76a 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.h +++ b/src/video_core/renderer_opengl/gl_rasterizer.h @@ -134,7 +134,6 @@ private: std::unique_ptr shader_program_manager; OGLVertexArray sw_vao; OGLVertexArray hw_vao; - std::array hw_vao_enabled_attributes; std::array texture_samplers; std::array, -- cgit v1.2.3