From ce448ce770b6c329caec7ad1ae00e01dddb67b03 Mon Sep 17 00:00:00 2001 From: Fernando Sahmkow Date: Fri, 18 Nov 2022 00:21:13 +0100 Subject: Revert Buffer cache changes and setup additional macros. --- src/video_core/engines/maxwell_3d.h | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'src/video_core/engines/maxwell_3d.h') diff --git a/src/video_core/engines/maxwell_3d.h b/src/video_core/engines/maxwell_3d.h index cd996413c..f0a379801 100644 --- a/src/video_core/engines/maxwell_3d.h +++ b/src/video_core/engines/maxwell_3d.h @@ -272,6 +272,7 @@ public: }; union { + u32 raw; BitField<0, 1, Mode> mode; BitField<4, 8, u32> pad; }; @@ -1217,10 +1218,12 @@ public: struct Window { union { + u32 raw_1; BitField<0, 16, u32> x_min; BitField<16, 16, u32> x_max; }; union { + u32 raw_2; BitField<0, 16, u32> y_min; BitField<16, 16, u32> y_max; }; @@ -3090,9 +3093,16 @@ public: return macro_addresses[index]; } - void RefreshParameters(); + void RefreshParameters() { + if (!current_macro_dirty) { + return; + } + RefreshParametersImpl(); + } - bool AnyParametersDirty(); + bool AnyParametersDirty() { + return current_macro_dirty; + } u32 GetMaxCurrentVertices(); @@ -3101,6 +3111,9 @@ public: /// Handles a write to the CLEAR_BUFFERS register. void ProcessClearBuffers(u32 layer_count); + /// Handles a write to the CB_BIND register. + void ProcessCBBind(size_t stage_index); + private: void InitializeRegisterDefaults(); @@ -3154,12 +3167,11 @@ private: void ProcessCBData(u32 value); void ProcessCBMultiData(const u32* start_base, u32 amount); - /// Handles a write to the CB_BIND register. - void ProcessCBBind(size_t stage_index); - /// Returns a query's value or an empty object if the value will be deferred through a cache. std::optional GetQueryResult(); + void RefreshParametersImpl(); + Core::System& system; MemoryManager& memory_manager; @@ -3187,6 +3199,7 @@ private: bool draw_indexed{}; std::vector> macro_segments; std::vector macro_addresses; + bool current_macro_dirty{}; }; #define ASSERT_REG_POSITION(field_name, position) \ -- cgit v1.2.3