From 359db6a673b1fa13c80e6b8bf54d5c29bc3b25db Mon Sep 17 00:00:00 2001 From: Markus Wick Date: Tue, 6 Nov 2018 19:15:44 +0100 Subject: gl_rasterizer: Skip VAO binding if the state is clean. --- src/video_core/engines/maxwell_3d.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/video_core/engines/maxwell_3d.cpp') diff --git a/src/video_core/engines/maxwell_3d.cpp b/src/video_core/engines/maxwell_3d.cpp index d79c50919..41e554998 100644 --- a/src/video_core/engines/maxwell_3d.cpp +++ b/src/video_core/engines/maxwell_3d.cpp @@ -92,8 +92,16 @@ void Maxwell3D::WriteReg(u32 method, u32 value, u32 remaining_params) { debug_context->OnEvent(Tegra::DebugContext::Event::MaxwellCommandLoaded, nullptr); } + u32 old = regs.reg_array[method]; regs.reg_array[method] = value; + if (value != old) { + if (method >= MAXWELL3D_REG_INDEX(vertex_attrib_format) && + method < MAXWELL3D_REG_INDEX(vertex_attrib_format) + regs.vertex_attrib_format.size()) { + dirty_flags.vertex_attrib_format = true; + } + } + switch (method) { case MAXWELL3D_REG_INDEX(macros.data): { ProcessMacroUpload(value); -- cgit v1.2.3