diff options
author | Markus Wick <markus@selfnet.de> | 2018-11-06 19:37:10 +0100 |
---|---|---|
committer | Markus Wick <markus@selfnet.de> | 2018-11-06 22:31:33 +0100 |
commit | 0590dd2971ecdb203cd108082dc0f48a1a796ddc (patch) | |
tree | 9ba36226853a604085ac0f56b8728519a795b8a4 | |
parent | Merge pull request #1649 from degasus/split_resource_manager (diff) | |
download | yuzu-0590dd2971ecdb203cd108082dc0f48a1a796ddc.tar yuzu-0590dd2971ecdb203cd108082dc0f48a1a796ddc.tar.gz yuzu-0590dd2971ecdb203cd108082dc0f48a1a796ddc.tar.bz2 yuzu-0590dd2971ecdb203cd108082dc0f48a1a796ddc.tar.lz yuzu-0590dd2971ecdb203cd108082dc0f48a1a796ddc.tar.xz yuzu-0590dd2971ecdb203cd108082dc0f48a1a796ddc.tar.zst yuzu-0590dd2971ecdb203cd108082dc0f48a1a796ddc.zip |
-rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 18 | ||||
-rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.h | 3 |
2 files changed, 16 insertions, 5 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index a0527fe57..d4c7191b3 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -33,7 +33,8 @@ using Maxwell = Tegra::Engines::Maxwell3D::Regs; using PixelFormat = VideoCore::Surface::PixelFormat; using SurfaceType = VideoCore::Surface::SurfaceType; -MICROPROFILE_DEFINE(OpenGL_VAO, "OpenGL", "Vertex Array Setup", MP_RGB(128, 128, 192)); +MICROPROFILE_DEFINE(OpenGL_VAO, "OpenGL", "Vertex Format Setup", MP_RGB(128, 128, 192)); +MICROPROFILE_DEFINE(OpenGL_VB, "OpenGL", "Vertex Buffer Setup", MP_RGB(128, 128, 192)); MICROPROFILE_DEFINE(OpenGL_Shader, "OpenGL", "Shader Setup", MP_RGB(128, 128, 192)); MICROPROFILE_DEFINE(OpenGL_UBO, "OpenGL", "Const Buffer Setup", MP_RGB(128, 128, 192)); MICROPROFILE_DEFINE(OpenGL_Index, "OpenGL", "Index Buffer Setup", MP_RGB(128, 128, 192)); @@ -122,7 +123,7 @@ RasterizerOpenGL::RasterizerOpenGL(Core::Frontend::EmuWindow& window, ScreenInfo RasterizerOpenGL::~RasterizerOpenGL() {} -void RasterizerOpenGL::SetupVertexArrays() { +void RasterizerOpenGL::SetupVertexFormat() { MICROPROFILE_SCOPE(OpenGL_VAO); const auto& gpu = Core::System::GetInstance().GPU().Maxwell3D(); const auto& regs = gpu.regs; @@ -175,8 +176,13 @@ void RasterizerOpenGL::SetupVertexArrays() { } } state.draw.vertex_array = VAO.handle; - state.draw.vertex_buffer = buffer_cache.GetHandle(); state.Apply(); +} + +void RasterizerOpenGL::SetupVertexBuffer() { + MICROPROFILE_SCOPE(OpenGL_VB); + const auto& gpu = Core::System::GetInstance().GPU().Maxwell3D(); + const auto& regs = gpu.regs; // Upload all guest vertex arrays sequentially to our buffer for (u32 index = 0; index < Maxwell::NumVertexArrays; ++index) { @@ -203,6 +209,9 @@ void RasterizerOpenGL::SetupVertexArrays() { glVertexBindingDivisor(index, 0); } } + + // Implicit set by glBindVertexBuffer. Stupid glstate handling... + state.draw.vertex_buffer = buffer_cache.GetHandle(); } DrawParameters RasterizerOpenGL::SetupDraw() { @@ -621,7 +630,8 @@ void RasterizerOpenGL::DrawArrays() { buffer_cache.Map(buffer_size); - SetupVertexArrays(); + SetupVertexFormat(); + SetupVertexBuffer(); DrawParameters params = SetupDraw(); SetupShaders(params.primitive_mode); diff --git a/src/video_core/renderer_opengl/gl_rasterizer.h b/src/video_core/renderer_opengl/gl_rasterizer.h index 47097c569..0fab3eb28 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.h +++ b/src/video_core/renderer_opengl/gl_rasterizer.h @@ -207,7 +207,8 @@ private: std::size_t CalculateIndexBufferSize() const; - void SetupVertexArrays(); + void SetupVertexFormat(); + void SetupVertexBuffer(); DrawParameters SetupDraw(); |