diff --git a/rpcs3/Emu/RSX/RSXFIFO.cpp b/rpcs3/Emu/RSX/RSXFIFO.cpp index 8849bd10bb..a357432ca6 100644 --- a/rpcs3/Emu/RSX/RSXFIFO.cpp +++ b/rpcs3/Emu/RSX/RSXFIFO.cpp @@ -4,12 +4,6 @@ #include "RSXThread.h" #include "Capture/rsx_capture.h" -extern rsx::frame_capture_data frame_capture; -extern bool user_asked_for_frame_capture; -extern bool capture_current_frame; - -#define ENABLE_OPTIMIZATION_DEBUGGING 0 - namespace rsx { namespace FIFO @@ -185,28 +179,6 @@ namespace rsx data.set(cmd & 0xfffc, vm::read32(m_args_ptr)); } - flattening_helper::flattening_helper() - { - const std::pair ignorable_ranges[] = - { - // General - { NV4097_INVALIDATE_VERTEX_FILE, 3 }, // PSLight clears VERTEX_FILE[0-2] - { NV4097_INVALIDATE_VERTEX_CACHE_FILE, 1 }, - { NV4097_INVALIDATE_L2, 1 }, - { NV4097_INVALIDATE_ZCULL, 1 } - }; - - std::fill(m_register_properties.begin(), m_register_properties.end(), 0u); - - for (const auto &method : ignorable_ranges) - { - for (u32 i = 0; i < method.second; ++i) - { - m_register_properties[method.first + i] |= register_props::always_ignore; - } - } - } - void flattening_helper::reset(bool _enabled) { enabled = _enabled; @@ -336,8 +308,7 @@ namespace rsx { if (UNLIKELY(draw_count)) { - const auto props = m_register_properties[reg]; - if (UNLIKELY(props & register_props::always_ignore)) + if (UNLIKELY(m_register_properties[reg] & register_props::always_ignore)) { // Always ignore command.reg = FIFO_DISABLED_COMMAND; diff --git a/rpcs3/Emu/RSX/RSXFIFO.h b/rpcs3/Emu/RSX/RSXFIFO.h index 3bae4d3d5d..a32b0e47cd 100644 --- a/rpcs3/Emu/RSX/RSXFIFO.h +++ b/rpcs3/Emu/RSX/RSXFIFO.h @@ -2,23 +2,10 @@ #include #include -#include -#include #include "rsx_utils.h" #include "Emu/Cell/lv2/sys_rsx.h" -#include -#include -#include -#include - -#ifndef __unused -#define __unused(expression) do { (void)(expression); } while(0) -#endif - -struct RsxDmaControl; - namespace rsx { class thread; @@ -72,7 +59,33 @@ namespace rsx application_not_compatible }; - std::array m_register_properties; + // Workaround for MSVC, C2248 + static constexpr u8 register_props_always_ignore = register_props::always_ignore; + + static constexpr std::array m_register_properties = [] + { + constexpr std::array, 4> ignorable_ranges = + {{ + // General + { NV4097_INVALIDATE_VERTEX_FILE, 3 }, // PSLight clears VERTEX_FILE[0-2] + { NV4097_INVALIDATE_VERTEX_CACHE_FILE, 1 }, + { NV4097_INVALIDATE_L2, 1 }, + { NV4097_INVALIDATE_ZCULL, 1 } + }}; + + std::array register_properties{}; + + for (const auto &method : ignorable_ranges) + { + for (u32 i = 0; i < method.second; ++i) + { + register_properties[method.first + i] |= register_props_always_ignore; + } + } + + return register_properties; + }(); + u32 deferred_primitive = 0; u32 draw_count = 0; u32 begin_end_ctr = 0; @@ -84,8 +97,8 @@ namespace rsx void reset(bool _enabled); public: - flattening_helper(); - ~flattening_helper() {} + flattening_helper() = default; + ~flattening_helper() = default; u32 get_primitive() const { return deferred_primitive; } bool is_enabled() const { return enabled; }