From 18637766efd1ff9a0c22967553983cfda69c96ca Mon Sep 17 00:00:00 2001 From: Fernando Sahmkow Date: Thu, 17 Nov 2022 16:36:53 +0100 Subject: MacroHLE: Reduce massive calculations on sizing estimation. --- src/video_core/engines/maxwell_3d.cpp | 15 +++++++++++++++ 1 file changed, 15 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 50d8a94b1..a9fd6d960 100644 --- a/src/video_core/engines/maxwell_3d.cpp +++ b/src/video_core/engines/maxwell_3d.cpp @@ -157,6 +157,21 @@ void Maxwell3D::RefreshParameters() { } } +bool Maxwell3D::AnyParametersDirty() { + size_t current_index = 0; + for (auto& segment : macro_segments) { + if (segment.first == 0) { + current_index += segment.second; + continue; + } + if (memory_manager.IsMemoryDirty(segment.first, sizeof(u32) * segment.second)) { + return true; + } + current_index += segment.second; + } + return false; +} + u32 Maxwell3D::GetMaxCurrentVertices() { u32 num_vertices = 0; for (size_t index = 0; index < Regs::NumVertexArrays; ++index) { -- cgit v1.2.3