From b3fb6d7d1874f0d874fa267518ab7020260916a1 Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Tue, 23 Mar 2021 22:32:50 +0300 Subject: [PATCH] Add and fix -Wredundant-decls (GCC) --- Utilities/JIT.cpp | 1 + Utilities/JIT.h | 1 + rpcs3/Emu/Cell/Modules/cellMsgDialog.cpp | 3 +- rpcs3/Emu/Cell/Modules/sysPrxForUser.cpp | 3 +- rpcs3/Emu/Cell/PPUInterpreter.cpp | 2 +- rpcs3/Emu/Cell/PPUThread.cpp | 4 +- rpcs3/Emu/Cell/SPUASMJITRecompiler.cpp | 3 +- rpcs3/Emu/Cell/SPURecompiler.cpp | 3 +- rpcs3/Emu/Cell/SPUThread.cpp | 4 +- rpcs3/Emu/Cell/lv2/lv2.cpp | 2 - rpcs3/Emu/Cell/lv2/sys_rsx.cpp | 4 +- rpcs3/Emu/Cell/lv2/sys_spu.cpp | 3 +- rpcs3/Emu/Cell/lv2/sys_sync.h | 3 +- rpcs3/Emu/Cell/lv2/sys_timer.cpp | 3 +- rpcs3/Emu/Cell/lv2/sys_vm.cpp | 3 +- rpcs3/Emu/Cell/timers.hpp | 7 +++ rpcs3/Emu/RSX/Common/texture_cache.h | 2 +- rpcs3/Emu/RSX/GL/GLTextureCache.cpp | 46 +++++++++++++++++++ rpcs3/Emu/RSX/GL/GLTextureCache.h | 50 +-------------------- rpcs3/Emu/RSX/Overlays/overlay_controls.h | 3 +- rpcs3/Emu/RSX/Overlays/overlays.h | 3 +- rpcs3/Emu/RSX/RSXThread.cpp | 4 +- rpcs3/Emu/RSX/RSXThread.h | 4 +- rpcs3/Emu/RSX/VK/VKGSRender.h | 2 +- rpcs3/Emu/RSX/VK/VKHelpers.h | 1 - rpcs3/Emu/RSX/VK/VKResolveHelper.h | 4 +- rpcs3/Emu/RSX/VK/VKTextureCache.h | 3 +- rpcs3/Emu/RSX/VK/vkutils/sync.cpp | 4 +- rpcs3/Emu/RSX/rsx_methods.cpp | 16 +++++++ rpcs3/Emu/RSX/rsx_methods.h | 20 +-------- rpcs3/Emu/System.h | 3 +- rpcs3/cmake_modules/ConfigureCompiler.cmake | 2 +- rpcs3/emucore.vcxproj | 1 + rpcs3/emucore.vcxproj.filters | 3 ++ 34 files changed, 105 insertions(+), 115 deletions(-) create mode 100644 rpcs3/Emu/Cell/timers.hpp diff --git a/Utilities/JIT.cpp b/Utilities/JIT.cpp index 678971f5c9..f73263e937 100644 --- a/Utilities/JIT.cpp +++ b/Utilities/JIT.cpp @@ -283,6 +283,7 @@ asmjit::Runtime& asmjit::get_global_runtime() #pragma GCC diagnostic ignored "-Wold-style-cast" #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#pragma GCC diagnostic ignored "-Wredundant-decls" #endif #include "llvm/Support/TargetSelect.h" #include "llvm/Support/FormattedStream.h" diff --git a/Utilities/JIT.h b/Utilities/JIT.h index 0ca8930641..e520a2ae4b 100644 --- a/Utilities/JIT.h +++ b/Utilities/JIT.h @@ -15,6 +15,7 @@ #pragma GCC diagnostic ignored "-Wold-style-cast" #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#pragma GCC diagnostic ignored "-Wredundant-decls" #ifndef __clang__ #pragma GCC diagnostic ignored "-Wduplicated-branches" #endif diff --git a/rpcs3/Emu/Cell/Modules/cellMsgDialog.cpp b/rpcs3/Emu/Cell/Modules/cellMsgDialog.cpp index 0ee889f5fa..c62e803b20 100644 --- a/rpcs3/Emu/Cell/Modules/cellMsgDialog.cpp +++ b/rpcs3/Emu/Cell/Modules/cellMsgDialog.cpp @@ -3,6 +3,7 @@ #include "Emu/Cell/PPUModule.h" #include "Emu/Cell/PPUThread.h" #include "Emu/Cell/lv2/sys_sync.h" +#include "Emu/Cell/timers.hpp" #include "Emu/Io/interception.h" #include "Emu/RSX/Overlays/overlay_message_dialog.h" @@ -15,8 +16,6 @@ LOG_CHANNEL(cellSysutil); -extern u64 get_guest_system_time(); - template<> void fmt_class_string::format(std::string& out, u64 arg) { diff --git a/rpcs3/Emu/Cell/Modules/sysPrxForUser.cpp b/rpcs3/Emu/Cell/Modules/sysPrxForUser.cpp index c8b04558ac..b1522e1d22 100644 --- a/rpcs3/Emu/Cell/Modules/sysPrxForUser.cpp +++ b/rpcs3/Emu/Cell/Modules/sysPrxForUser.cpp @@ -1,5 +1,6 @@ #include "stdafx.h" #include "Emu/Cell/PPUModule.h" +#include "Emu/Cell/timers.hpp" #include "Emu/Cell/lv2/sys_mutex.h" #include "Emu/Cell/lv2/sys_interrupt.h" @@ -10,8 +11,6 @@ LOG_CHANNEL(sysPrxForUser); -extern u64 get_guest_system_time(); - vm::gvar sys_prx_version; // ??? vm::gvar> g_ppu_atexitspawn; vm::gvar> g_ppu_at_Exitspawn; diff --git a/rpcs3/Emu/Cell/PPUInterpreter.cpp b/rpcs3/Emu/Cell/PPUInterpreter.cpp index 6e5388f866..eaae5bf611 100644 --- a/rpcs3/Emu/Cell/PPUInterpreter.cpp +++ b/rpcs3/Emu/Cell/PPUInterpreter.cpp @@ -6,6 +6,7 @@ #include "PPUThread.h" #include "Emu/Cell/Common.h" #include "Emu/Cell/PPUFunction.h" +#include "Emu/Cell/timers.hpp" #include #include @@ -387,7 +388,6 @@ static add_flags_result_t add64_flags(u64 a, u64 b, bool c) return{ a, b, c }; } -extern u64 get_timebased_time(); extern void ppu_execute_syscall(ppu_thread& ppu, u64 code); extern u32 ppu_lwarx(ppu_thread& ppu, u32 addr); diff --git a/rpcs3/Emu/Cell/PPUThread.cpp b/rpcs3/Emu/Cell/PPUThread.cpp index 13f12fca7f..34f8dc4e5a 100644 --- a/rpcs3/Emu/Cell/PPUThread.cpp +++ b/rpcs3/Emu/Cell/PPUThread.cpp @@ -16,6 +16,7 @@ #include "PPUModule.h" #include "PPUDisAsm.h" #include "SPURecompiler.h" +#include "timers.hpp" #include "lv2/sys_sync.h" #include "lv2/sys_prx.h" #include "lv2/sys_overlay.h" @@ -76,8 +77,6 @@ const bool s_use_ssse3 = utils::has_ssse3(); -extern u64 get_guest_system_time(); - extern atomic_t g_watchdog_hold_ctr; extern atomic_t g_progr; @@ -1293,7 +1292,6 @@ void ppu_thread::stack_pop_verbose(u32 addr, u32 size) noexcept ppu_log.error("Invalid thread"); } -extern u64 get_timebased_time(); extern ppu_function_t ppu_get_syscall(u64 code); extern __m128 sse_exp2_ps(__m128 A); diff --git a/rpcs3/Emu/Cell/SPUASMJITRecompiler.cpp b/rpcs3/Emu/Cell/SPUASMJITRecompiler.cpp index 74459f8d44..8c6f32d977 100644 --- a/rpcs3/Emu/Cell/SPUASMJITRecompiler.cpp +++ b/rpcs3/Emu/Cell/SPUASMJITRecompiler.cpp @@ -3,6 +3,7 @@ #include "Emu/system_config.h" #include "Emu/IdManager.h" +#include "Emu/Cell/timers.hpp" #include "SPUDisAsm.h" #include "SPUThread.h" @@ -28,8 +29,6 @@ extern const spu_decoder g_spu_interpreter_fast{}; // TODO: avoid const spu_decoder s_spu_decoder; -extern u64 get_timebased_time(); - std::unique_ptr spu_recompiler_base::make_asmjit_recompiler() { return std::make_unique(); diff --git a/rpcs3/Emu/Cell/SPURecompiler.cpp b/rpcs3/Emu/Cell/SPURecompiler.cpp index 40d634389e..f41531c8bb 100644 --- a/rpcs3/Emu/Cell/SPURecompiler.cpp +++ b/rpcs3/Emu/Cell/SPURecompiler.cpp @@ -4,6 +4,7 @@ #include "Emu/System.h" #include "Emu/system_config.h" #include "Emu/IdManager.h" +#include "Emu/Cell/timers.hpp" #include "Crypto/sha1.h" #include "Utilities/StrUtil.h" #include "Utilities/JIT.h" @@ -32,8 +33,6 @@ const spu_decoder s_spu_iflag; extern const spu_decoder g_spu_interpreter_precise{}; extern const spu_decoder g_spu_interpreter_fast; -extern u64 get_timebased_time(); - // Move 4 args for calling native function from a GHC calling convention function static u8* move_args_ghc_to_native(u8* raw) { diff --git a/rpcs3/Emu/Cell/SPUThread.cpp b/rpcs3/Emu/Cell/SPUThread.cpp index 4a383a44ce..dc8eb49b04 100644 --- a/rpcs3/Emu/Cell/SPUThread.cpp +++ b/rpcs3/Emu/Cell/SPUThread.cpp @@ -23,6 +23,7 @@ #include "Emu/Cell/SPUInterpreter.h" #include "Emu/Cell/SPURecompiler.h" #include "Emu/Cell/RawSPUThread.h" +#include "Emu/Cell/timers.hpp" #include #include @@ -282,9 +283,6 @@ extern void mov_rdata_nt(spu_rdata_t& _dst, const spu_rdata_t& _src) _mm_stream_si128(reinterpret_cast<__m128i*>(_dst + 112), v3); } -extern u64 get_timebased_time(); -extern u64 get_system_time(); - void do_cell_atomic_128_store(u32 addr, const void* to_write); extern thread_local u64 g_tls_fault_spu; diff --git a/rpcs3/Emu/Cell/lv2/lv2.cpp b/rpcs3/Emu/Cell/lv2/lv2.cpp index 6fc3b115f2..6b545aca60 100644 --- a/rpcs3/Emu/Cell/lv2/lv2.cpp +++ b/rpcs3/Emu/Cell/lv2/lv2.cpp @@ -1106,8 +1106,6 @@ std::string ppu_get_syscall_name(u64 code) return fmt::format("syscall_%u", code); } -extern u64 get_guest_system_time(); - DECLARE(lv2_obj::g_mutex); DECLARE(lv2_obj::g_ppu); DECLARE(lv2_obj::g_pending); diff --git a/rpcs3/Emu/Cell/lv2/sys_rsx.cpp b/rpcs3/Emu/Cell/lv2/sys_rsx.cpp index d51585b0c6..dfc364e328 100644 --- a/rpcs3/Emu/Cell/lv2/sys_rsx.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_rsx.cpp @@ -3,15 +3,13 @@ #include "Emu/Cell/PPUModule.h" #include "Emu/Cell/ErrorCodes.h" +#include "Emu/Cell/timers.hpp" #include "Emu/Memory/vm_locking.h" #include "Emu/RSX/RSXThread.h" #include "sys_event.h" - LOG_CHANNEL(sys_rsx); -extern u64 get_timebased_time(); - // Unknown error code returned by sys_rsx_context_attribute enum sys_rsx_error : s32 { diff --git a/rpcs3/Emu/Cell/lv2/sys_spu.cpp b/rpcs3/Emu/Cell/lv2/sys_spu.cpp index fa3babd8ca..16d6e23ff9 100644 --- a/rpcs3/Emu/Cell/lv2/sys_spu.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_spu.cpp @@ -14,6 +14,7 @@ #include "Emu/Cell/PPUThread.h" #include "Emu/Cell/PPUModule.h" #include "Emu/Cell/RawSPUThread.h" +#include "Emu/Cell/timers.hpp" #include "sys_interrupt.h" #include "sys_process.h" #include "sys_memory.h" @@ -25,8 +26,6 @@ LOG_CHANNEL(sys_spu); -extern u64 get_timebased_time(); - template <> void fmt_class_string::format(std::string& out, u64 arg) { diff --git a/rpcs3/Emu/Cell/lv2/sys_sync.h b/rpcs3/Emu/Cell/lv2/sys_sync.h index def3624f60..a0749c0895 100644 --- a/rpcs3/Emu/Cell/lv2/sys_sync.h +++ b/rpcs3/Emu/Cell/lv2/sys_sync.h @@ -5,6 +5,7 @@ #include "Emu/CPU/CPUThread.h" #include "Emu/Cell/ErrorCodes.h" +#include "Emu/Cell/timers.hpp" #include "Emu/IdManager.h" #include "Emu/IPC.h" #include "Emu/system_config.h" @@ -304,8 +305,6 @@ public: // Clamp usec = std::min(usec, max_timeout); - extern u64 get_system_time(); - u64 passed = 0; u64 remaining; diff --git a/rpcs3/Emu/Cell/lv2/sys_timer.cpp b/rpcs3/Emu/Cell/lv2/sys_timer.cpp index f1a25a8d7b..a26801dfd6 100644 --- a/rpcs3/Emu/Cell/lv2/sys_timer.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_timer.cpp @@ -5,6 +5,7 @@ #include "Emu/Cell/ErrorCodes.h" #include "Emu/Cell/PPUThread.h" +#include "Emu/Cell/timers.hpp" #include "sys_event.h" #include "sys_process.h" @@ -12,8 +13,6 @@ LOG_CHANNEL(sys_timer); -extern u64 get_guest_system_time(); - void lv2_timer_context::operator()() { while (thread_ctrl::state() != thread_state::aborting) diff --git a/rpcs3/Emu/Cell/lv2/sys_vm.cpp b/rpcs3/Emu/Cell/lv2/sys_vm.cpp index 01cb8c6081..e016e90d2d 100644 --- a/rpcs3/Emu/Cell/lv2/sys_vm.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_vm.cpp @@ -4,10 +4,9 @@ #include "Emu/IdManager.h" #include "Emu/Cell/ErrorCodes.h" #include "Emu/Cell/PPUThread.h" +#include "Emu/Cell/timers.hpp" #include "Emu/Memory/vm_locking.h" -extern u64 get_timebased_time(); - sys_vm_t::sys_vm_t(u32 _addr, u32 vsize, lv2_memory_container* ct, u32 psize) : ct(ct) , addr(_addr) diff --git a/rpcs3/Emu/Cell/timers.hpp b/rpcs3/Emu/Cell/timers.hpp new file mode 100644 index 0000000000..bdc7a8b88e --- /dev/null +++ b/rpcs3/Emu/Cell/timers.hpp @@ -0,0 +1,7 @@ +#pragma once + +#include "util/types.hpp" + +u64 get_timebased_time(); +u64 get_system_time(); +u64 get_guest_system_time(); diff --git a/rpcs3/Emu/RSX/Common/texture_cache.h b/rpcs3/Emu/RSX/Common/texture_cache.h index f742ddb45f..11cea58805 100644 --- a/rpcs3/Emu/RSX/Common/texture_cache.h +++ b/rpcs3/Emu/RSX/Common/texture_cache.h @@ -6,7 +6,7 @@ #include -extern u64 get_system_time(); +#include "Emu/Cell/timers.hpp" #define RSX_GCM_FORMAT_IGNORED 0 diff --git a/rpcs3/Emu/RSX/GL/GLTextureCache.cpp b/rpcs3/Emu/RSX/GL/GLTextureCache.cpp index 58b3462ac7..afb794d8e5 100644 --- a/rpcs3/Emu/RSX/GL/GLTextureCache.cpp +++ b/rpcs3/Emu/RSX/GL/GLTextureCache.cpp @@ -89,6 +89,52 @@ namespace gl } } + gl::texture_view* texture_cache::create_temporary_subresource_impl(gl::command_context& cmd, gl::texture* src, GLenum sized_internal_fmt, GLenum dst_type, + u32 gcm_format, u16 x, u16 y, u16 width, u16 height, u16 depth, u8 mipmaps, const rsx::texture_channel_remap_t& remap, bool copy) + { + if (sized_internal_fmt == GL_NONE) + { + sized_internal_fmt = gl::get_sized_internal_format(gcm_format); + } + + std::unique_ptr dst = std::make_unique(dst_type, width, height, depth, mipmaps, sized_internal_fmt, rsx::classify_format(gcm_format)); + + if (copy) + { + std::vector region = + {{ + src, + rsx::surface_transform::coordinate_transform, + 0, + x, y, 0, 0, 0, + width, height, width, height + }}; + + copy_transfer_regions_impl(cmd, dst.get(), region); + } + + std::array swizzle; + if (!src || static_cast(src->get_internal_format()) != sized_internal_fmt) + { + // Apply base component map onto the new texture if a data cast has been done + swizzle = get_component_mapping(gcm_format, rsx::texture_create_flags::default_component_order); + } + else + { + swizzle = src->get_native_component_layout(); + } + + if (memcmp(remap.first.data(), rsx::default_remap_vector.first.data(), 4) || + memcmp(remap.second.data(), rsx::default_remap_vector.second.data(), 4)) + swizzle = apply_swizzle_remap(swizzle, remap); + + auto view = std::make_unique(dst.get(), dst_type, sized_internal_fmt, swizzle.data()); + auto result = view.get(); + + m_temporary_surfaces.emplace_back(dst, view); + return result; + } + void texture_cache::copy_transfer_regions_impl(gl::command_context& cmd, gl::texture* dst_image, const std::vector& sources) const { const auto dst_bpp = dst_image->pitch() / dst_image->width(); diff --git a/rpcs3/Emu/RSX/GL/GLTextureCache.h b/rpcs3/Emu/RSX/GL/GLTextureCache.h index 846ea70dd0..098a8a18c3 100644 --- a/rpcs3/Emu/RSX/GL/GLTextureCache.h +++ b/rpcs3/Emu/RSX/GL/GLTextureCache.h @@ -14,10 +14,7 @@ namespace gl { class blitter; - extern GLenum get_sized_internal_format(u32); - extern GLenum get_target(rsx::texture_dimension_extended type); - extern void copy_typeless(texture*, const texture*, const coord3u&, const coord3u&); - extern blitter *g_hw_blitter; + extern blitter* g_hw_blitter; class cached_texture_section; class texture_cache; @@ -471,50 +468,7 @@ namespace gl } gl::texture_view* create_temporary_subresource_impl(gl::command_context& cmd, gl::texture* src, GLenum sized_internal_fmt, GLenum dst_type, u32 gcm_format, - u16 x, u16 y, u16 width, u16 height, u16 depth, u8 mipmaps, const rsx::texture_channel_remap_t& remap, bool copy) - { - if (sized_internal_fmt == GL_NONE) - { - sized_internal_fmt = gl::get_sized_internal_format(gcm_format); - } - - std::unique_ptr dst = std::make_unique(dst_type, width, height, depth, mipmaps, sized_internal_fmt, rsx::classify_format(gcm_format)); - - if (copy) - { - std::vector region = - {{ - src, - rsx::surface_transform::coordinate_transform, - 0, - x, y, 0, 0, 0, - width, height, width, height - }}; - - copy_transfer_regions_impl(cmd, dst.get(), region); - } - - std::array swizzle; - if (!src || static_cast(src->get_internal_format()) != sized_internal_fmt) - { - // Apply base component map onto the new texture if a data cast has been done - swizzle = get_component_mapping(gcm_format, rsx::texture_create_flags::default_component_order); - } - else - { - swizzle = src->get_native_component_layout(); - } - - if (memcmp(remap.first.data(), rsx::default_remap_vector.first.data(), 4) || - memcmp(remap.second.data(), rsx::default_remap_vector.second.data(), 4)) - swizzle = apply_swizzle_remap(swizzle, remap); - - auto view = std::make_unique(dst.get(), dst_type, sized_internal_fmt, swizzle.data()); - auto result = view.get(); - - m_temporary_surfaces.emplace_back(dst, view); - return result; - } + u16 x, u16 y, u16 width, u16 height, u16 depth, u8 mipmaps, const rsx::texture_channel_remap_t& remap, bool copy); std::array get_component_mapping(u32 gcm_format, rsx::texture_create_flags flags) const { diff --git a/rpcs3/Emu/RSX/Overlays/overlay_controls.h b/rpcs3/Emu/RSX/Overlays/overlay_controls.h index f0e8e53360..d518b6d9c0 100644 --- a/rpcs3/Emu/RSX/Overlays/overlay_controls.h +++ b/rpcs3/Emu/RSX/Overlays/overlay_controls.h @@ -8,6 +8,7 @@ #include "overlay_fonts.h" #include "Emu/localized_string.h" +#include "Emu/Cell/timers.hpp" #include #include @@ -30,8 +31,6 @@ #include #endif -extern u64 get_system_time(); - // Definitions for common UI controls and their routines namespace rsx { diff --git a/rpcs3/Emu/RSX/Overlays/overlays.h b/rpcs3/Emu/RSX/Overlays/overlays.h index 049a442099..a25bcf2971 100644 --- a/rpcs3/Emu/RSX/Overlays/overlays.h +++ b/rpcs3/Emu/RSX/Overlays/overlays.h @@ -3,6 +3,7 @@ #include "overlay_controls.h" #include "Emu/IdManager.h" +#include "Emu/Cell/timers.hpp" #include "Utilities/mutex.h" #include "Utilities/Timer.h" @@ -10,8 +11,6 @@ #include #include -// Utils -extern u64 get_system_time(); // Definition of user interface implementations namespace rsx diff --git a/rpcs3/Emu/RSX/RSXThread.cpp b/rpcs3/Emu/RSX/RSXThread.cpp index a4c64fc2f9..4ccbf480e8 100644 --- a/rpcs3/Emu/RSX/RSXThread.cpp +++ b/rpcs3/Emu/RSX/RSXThread.cpp @@ -2,6 +2,7 @@ #include "RSXThread.h" #include "Emu/Cell/PPUCallback.h" +#include "Emu/Cell/timers.hpp" #include "Common/BufferUtils.h" #include "Common/GLSLCommon.h" @@ -12,6 +13,7 @@ #include "rsx_utils.h" #include "gcm_printing.h" #include "Emu/Cell/lv2/sys_event.h" +#include "Emu/Cell/lv2/sys_time.h" #include "Emu/Cell/Modules/cellGcmSys.h" #include "Overlays/overlay_perf_metrics.h" #include "Utilities/date_time.h" @@ -36,8 +38,6 @@ rsx::frame_capture_data frame_capture; extern CellGcmOffsetTable offsetTable; extern thread_local std::string(*g_tls_log_prefix)(); -extern u64 sys_time_get_timebase_frequency(); -extern u64 get_timebased_time(); namespace rsx { diff --git a/rpcs3/Emu/RSX/RSXThread.h b/rpcs3/Emu/RSX/RSXThread.h index 05341032ba..2d6b049dce 100644 --- a/rpcs3/Emu/RSX/RSXThread.h +++ b/rpcs3/Emu/RSX/RSXThread.h @@ -22,12 +22,10 @@ #include "Capture/rsx_replay.h" #include "Emu/Cell/lv2/sys_rsx.h" +#include "Emu/Cell/timers.hpp" #include "Emu/IdManager.h" #include "Emu/system_config.h" -extern u64 get_guest_system_time(); -extern u64 get_system_time(); - extern atomic_t g_user_asked_for_frame_capture; extern rsx::frame_trace_data frame_debug; extern rsx::frame_capture_data frame_capture; diff --git a/rpcs3/Emu/RSX/VK/VKGSRender.h b/rpcs3/Emu/RSX/VK/VKGSRender.h index ac76c3cb9d..5aafe7b7d0 100644 --- a/rpcs3/Emu/RSX/VK/VKGSRender.h +++ b/rpcs3/Emu/RSX/VK/VKGSRender.h @@ -1,5 +1,6 @@ #pragma once #include "Emu/RSX/GSRender.h" +#include "Emu/Cell/timers.hpp" #include "vkutils/descriptors.hpp" #include "vkutils/data_heap.h" @@ -55,7 +56,6 @@ namespace vk #define VK_MAX_ASYNC_FRAMES 2 using rsx::flags32_t; -extern u64 get_system_time(); namespace vk { diff --git a/rpcs3/Emu/RSX/VK/VKHelpers.h b/rpcs3/Emu/RSX/VK/VKHelpers.h index b75dbd78f9..8b18342572 100644 --- a/rpcs3/Emu/RSX/VK/VKHelpers.h +++ b/rpcs3/Emu/RSX/VK/VKHelpers.h @@ -59,7 +59,6 @@ namespace vk template T* get_compute_task(); - void reset_compute_tasks(); void destroy_global_resources(); void reset_global_resources(); diff --git a/rpcs3/Emu/RSX/VK/VKResolveHelper.h b/rpcs3/Emu/RSX/VK/VKResolveHelper.h index c7ffef59ac..922d1ccfaa 100644 --- a/rpcs3/Emu/RSX/VK/VKResolveHelper.h +++ b/rpcs3/Emu/RSX/VK/VKResolveHelper.h @@ -541,8 +541,8 @@ namespace vk } }; - void resolve_image(vk::command_buffer& cmd, vk::viewable_image* dst, vk::viewable_image* src); - void unresolve_image(vk::command_buffer& cmd, vk::viewable_image* dst, vk::viewable_image* src); + //void resolve_image(vk::command_buffer& cmd, vk::viewable_image* dst, vk::viewable_image* src); + //void unresolve_image(vk::command_buffer& cmd, vk::viewable_image* dst, vk::viewable_image* src); void reset_resolve_resources(); void clear_resolve_helpers(); } diff --git a/rpcs3/Emu/RSX/VK/VKTextureCache.h b/rpcs3/Emu/RSX/VK/VKTextureCache.h index 214850ada4..aed8e25ca9 100644 --- a/rpcs3/Emu/RSX/VK/VKTextureCache.h +++ b/rpcs3/Emu/RSX/VK/VKTextureCache.h @@ -7,12 +7,11 @@ #include "vkutils/image_helpers.h" #include "../Common/texture_cache.h" +#include "Emu/Cell/timers.hpp" #include #include -extern u64 get_system_time(); - namespace vk { class cached_texture_section; diff --git a/rpcs3/Emu/RSX/VK/vkutils/sync.cpp b/rpcs3/Emu/RSX/VK/vkutils/sync.cpp index 50345ebb4f..9379979f96 100644 --- a/rpcs3/Emu/RSX/VK/vkutils/sync.cpp +++ b/rpcs3/Emu/RSX/VK/vkutils/sync.cpp @@ -5,11 +5,11 @@ #include "sync.h" #include "shared.h" +#include "Emu/Cell/timers.hpp" + #include "util/sysinfo.hpp" #include "util/asm.hpp" -extern u64 get_system_time(); - namespace vk { #ifdef _MSC_VER diff --git a/rpcs3/Emu/RSX/rsx_methods.cpp b/rpcs3/Emu/RSX/rsx_methods.cpp index 1cb2d41353..a51fe90af2 100644 --- a/rpcs3/Emu/RSX/rsx_methods.cpp +++ b/rpcs3/Emu/RSX/rsx_methods.cpp @@ -2625,6 +2625,22 @@ namespace rsx return registers[reg] == value; } + void draw_clause::reset(primitive_type type) + { + current_range_index = ~0u; + last_execution_barrier_index = 0; + + command = draw_command::none; + primitive = type; + primitive_barrier_enable = false; + + draw_command_ranges.clear(); + draw_command_barriers.clear(); + inline_vertex_array.clear(); + + is_disjoint_primitive = is_primitive_disjointed(primitive); + } + u32 draw_clause::execute_pipeline_dependencies() const { u32 result = 0; diff --git a/rpcs3/Emu/RSX/rsx_methods.h b/rpcs3/Emu/RSX/rsx_methods.h index ba017de000..52b57352de 100644 --- a/rpcs3/Emu/RSX/rsx_methods.h +++ b/rpcs3/Emu/RSX/rsx_methods.h @@ -12,9 +12,7 @@ #include "rsx_vertex_data.h" #include "rsx_utils.h" #include "Utilities/geometry.h" - -extern u64 get_system_time(); -extern bool is_primitive_disjointed(rsx::primitive_type); +#include "Emu/Cell/timers.hpp" namespace rsx { @@ -297,21 +295,7 @@ namespace rsx return count; } - void reset(rsx::primitive_type type) - { - current_range_index = ~0u; - last_execution_barrier_index = 0; - - command = draw_command::none; - primitive = type; - primitive_barrier_enable = false; - - draw_command_ranges.clear(); - draw_command_barriers.clear(); - inline_vertex_array.clear(); - - is_disjoint_primitive = is_primitive_disjointed(primitive); - } + void reset(rsx::primitive_type type); void begin() { diff --git a/rpcs3/Emu/System.h b/rpcs3/Emu/System.h index a1722ee812..7215d54a30 100644 --- a/rpcs3/Emu/System.h +++ b/rpcs3/Emu/System.h @@ -8,8 +8,7 @@ #include #include -u64 get_system_time(); -u64 get_guest_system_time(); +#include "Emu/Cell/timers.hpp" enum class localized_string_id; enum class video_renderer; diff --git a/rpcs3/cmake_modules/ConfigureCompiler.cmake b/rpcs3/cmake_modules/ConfigureCompiler.cmake index 8bd2caf930..ddcca746c4 100644 --- a/rpcs3/cmake_modules/ConfigureCompiler.cmake +++ b/rpcs3/cmake_modules/ConfigureCompiler.cmake @@ -42,6 +42,7 @@ else() #add_compile_options(-Wconversion) #add_compile_options(-Wpadded) add_compile_options(-Wempty-body) + add_compile_options(-Wredundant-decls) add_compile_options(-Wstrict-aliasing=1) #add_compile_options(-Wnull-dereference) @@ -54,7 +55,6 @@ else() add_compile_options(-Wcast-function-type) add_compile_options(-Wduplicated-branches) add_compile_options(-Wduplicated-cond) - #add_compile_options(-Wredundant-decls) endif() #TODO Clean the code so these are removed diff --git a/rpcs3/emucore.vcxproj b/rpcs3/emucore.vcxproj index 8e00e1ea50..d4ecbc5d68 100644 --- a/rpcs3/emucore.vcxproj +++ b/rpcs3/emucore.vcxproj @@ -686,6 +686,7 @@ + diff --git a/rpcs3/emucore.vcxproj.filters b/rpcs3/emucore.vcxproj.filters index 3c4812c79e..d61125bd7f 100644 --- a/rpcs3/emucore.vcxproj.filters +++ b/rpcs3/emucore.vcxproj.filters @@ -722,6 +722,9 @@ Emu\Cell + + Emu\Cell + Emu\CPU