From cf229a8e9f688d0d36cf9ea221af7ca71120d885 Mon Sep 17 00:00:00 2001 From: Megamouse Date: Tue, 14 Apr 2020 19:13:52 +0200 Subject: [PATCH] some more dynamic settings --- rpcs3/Emu/RSX/GL/GLDraw.cpp | 4 ++-- rpcs3/Emu/RSX/GL/GLPresent.cpp | 8 +++++--- rpcs3/Emu/RSX/GL/GLTexture.cpp | 7 ++++--- rpcs3/Emu/RSX/RSXThread.cpp | 4 ++-- rpcs3/Emu/RSX/VK/VKDraw.cpp | 7 ++++--- rpcs3/Emu/RSX/VK/VKPresent.cpp | 6 ++++-- rpcs3/Emu/System.cpp | 4 ++-- rpcs3/Emu/system_config.h | 10 +++++----- 8 files changed, 28 insertions(+), 22 deletions(-) diff --git a/rpcs3/Emu/RSX/GL/GLDraw.cpp b/rpcs3/Emu/RSX/GL/GLDraw.cpp index 2b3521c1df..9cb927a17d 100644 --- a/rpcs3/Emu/RSX/GL/GLDraw.cpp +++ b/rpcs3/Emu/RSX/GL/GLDraw.cpp @@ -1,4 +1,4 @@ -#include "stdafx.h" +#include "stdafx.h" #include "GLGSRender.h" #include "../Common/BufferUtils.h" @@ -268,7 +268,7 @@ void GLGSRender::load_texture_env() { // Load textures gl::command_context cmd{ gl_state }; - bool update_framebuffer_sourced = false; + bool update_framebuffer_sourced = false; std::lock_guard lock(m_sampler_mutex); diff --git a/rpcs3/Emu/RSX/GL/GLPresent.cpp b/rpcs3/Emu/RSX/GL/GLPresent.cpp index 2e2109421e..3adce2e5e1 100644 --- a/rpcs3/Emu/RSX/GL/GLPresent.cpp +++ b/rpcs3/Emu/RSX/GL/GLPresent.cpp @@ -215,9 +215,11 @@ void GLGSRender::flip(const rsx::display_flip_info_t& info) m_frame->take_screenshot(std::move(sshot_frame), buffer_width, buffer_height); } - areai screen_area = coordi({}, { static_cast(buffer_width), static_cast(buffer_height) }); + const areai screen_area = coordi({}, { static_cast(buffer_width), static_cast(buffer_height) }); - if (g_cfg.video.full_rgb_range_output && rsx::fcmp(avconfig->gamma, 1.f) && !avconfig->_3d) + const bool use_full_rgb_range_output = g_cfg.video.full_rgb_range_output.get(); + + if (use_full_rgb_range_output && rsx::fcmp(avconfig->gamma, 1.f) && !avconfig->_3d) { // Blit source image to the screen m_flip_fbo.recreate(); @@ -230,7 +232,7 @@ void GLGSRender::flip(const rsx::display_flip_info_t& info) else { const f32 gamma = avconfig->gamma; - const bool limited_range = !g_cfg.video.full_rgb_range_output; + const bool limited_range = !use_full_rgb_range_output; const rsx::simple_array images{ image_to_flip, image_to_flip2 }; gl::screen.bind(); diff --git a/rpcs3/Emu/RSX/GL/GLTexture.cpp b/rpcs3/Emu/RSX/GL/GLTexture.cpp index c190571741..566004d2cb 100644 --- a/rpcs3/Emu/RSX/GL/GLTexture.cpp +++ b/rpcs3/Emu/RSX/GL/GLTexture.cpp @@ -213,7 +213,7 @@ namespace gl fmt::throw_exception("Unknown mag filter" HERE); } - //Apply sampler state settings + // Apply sampler state settings void sampler_state::apply(const rsx::fragment_texture& tex, const rsx::sampled_image_descriptor_base* sampled_image) { set_parameteri(GL_TEXTURE_WRAP_S, wrap_mode(tex.wrap_s())); @@ -263,8 +263,9 @@ namespace gl set_parameterf(GL_TEXTURE_MAX_LOD, tex.max_lod()); } - const bool aniso_override = !g_cfg.video.strict_rendering_mode && g_cfg.video.anisotropic_level_override > 0; - f32 af_level = aniso_override ? g_cfg.video.anisotropic_level_override : max_aniso(tex.max_aniso()); + const int aniso_override_level = g_cfg.video.anisotropic_level_override; + const bool aniso_override = !g_cfg.video.strict_rendering_mode && aniso_override_level > 0; + const f32 af_level = aniso_override ? aniso_override_level : max_aniso(tex.max_aniso()); set_parameterf(GL_TEXTURE_MAX_ANISOTROPY_EXT, af_level); set_parameteri(GL_TEXTURE_MAG_FILTER, tex_mag_filter(tex.mag_filter())); diff --git a/rpcs3/Emu/RSX/RSXThread.cpp b/rpcs3/Emu/RSX/RSXThread.cpp index f9513977a6..bd9bb9267b 100644 --- a/rpcs3/Emu/RSX/RSXThread.cpp +++ b/rpcs3/Emu/RSX/RSXThread.cpp @@ -2617,8 +2617,8 @@ namespace rsx { m_skip_frame_ctr++; - if (m_skip_frame_ctr == g_cfg.video.consequtive_frames_to_draw) - m_skip_frame_ctr = -g_cfg.video.consequtive_frames_to_skip; + if (m_skip_frame_ctr >= g_cfg.video.consecutive_frames_to_draw) + m_skip_frame_ctr = -g_cfg.video.consecutive_frames_to_skip; skip_current_frame = (m_skip_frame_ctr < 0); } diff --git a/rpcs3/Emu/RSX/VK/VKDraw.cpp b/rpcs3/Emu/RSX/VK/VKDraw.cpp index e1d82ee4e2..69fd749916 100644 --- a/rpcs3/Emu/RSX/VK/VKDraw.cpp +++ b/rpcs3/Emu/RSX/VK/VKDraw.cpp @@ -1,4 +1,4 @@ -#include "stdafx.h" +#include "stdafx.h" #include "VKGSRender.h" #include "../Common/BufferUtils.h" @@ -188,8 +188,9 @@ void VKGSRender::load_texture_env() } } - const bool aniso_override = !g_cfg.video.strict_rendering_mode && g_cfg.video.anisotropic_level_override > 0; - const f32 af_level = aniso_override ? g_cfg.video.anisotropic_level_override : vk::max_aniso(rsx::method_registers.fragment_textures[i].max_aniso()); + const int aniso_override_level = g_cfg.video.anisotropic_level_override; + const bool aniso_override = !g_cfg.video.strict_rendering_mode && aniso_override_level > 0; + const f32 af_level = aniso_override ? aniso_override_level : vk::max_aniso(rsx::method_registers.fragment_textures[i].max_aniso()); const auto wrap_s = vk::vk_wrap_mode(rsx::method_registers.fragment_textures[i].wrap_s()); const auto wrap_t = vk::vk_wrap_mode(rsx::method_registers.fragment_textures[i].wrap_t()); const auto wrap_r = vk::vk_wrap_mode(rsx::method_registers.fragment_textures[i].wrap_r()); diff --git a/rpcs3/Emu/RSX/VK/VKPresent.cpp b/rpcs3/Emu/RSX/VK/VKPresent.cpp index ce6381eee0..899b10d931 100644 --- a/rpcs3/Emu/RSX/VK/VKPresent.cpp +++ b/rpcs3/Emu/RSX/VK/VKPresent.cpp @@ -562,7 +562,9 @@ void VKGSRender::flip(const rsx::display_flip_info_t& info) if (image_to_flip) { - if (!g_cfg.video.full_rgb_range_output || !rsx::fcmp(avconfig->gamma, 1.f) || avconfig->_3d) [[unlikely]] + const bool use_full_rgb_range_output = g_cfg.video.full_rgb_range_output.get(); + + if (!use_full_rgb_range_output || !rsx::fcmp(avconfig->gamma, 1.f) || avconfig->_3d) [[unlikely]] { calibration_src.push_back(dynamic_cast(image_to_flip)); verify("Image not viewable" HERE), calibration_src.front(); @@ -592,7 +594,7 @@ void VKGSRender::flip(const rsx::display_flip_info_t& info) direct_fbo->add_ref(); image_to_flip->push_layout(*m_current_command_buffer, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL); - m_video_output_pass->run(*m_current_command_buffer, areau(aspect_ratio), direct_fbo, calibration_src, avconfig->gamma, !g_cfg.video.full_rgb_range_output, avconfig->_3d, single_target_pass); + m_video_output_pass->run(*m_current_command_buffer, areau(aspect_ratio), direct_fbo, calibration_src, avconfig->gamma, !use_full_rgb_range_output, avconfig->_3d, single_target_pass); image_to_flip->pop_layout(*m_current_command_buffer); direct_fbo->release(); diff --git a/rpcs3/Emu/System.cpp b/rpcs3/Emu/System.cpp index a71ffb5ef0..6869a6f5bf 100644 --- a/rpcs3/Emu/System.cpp +++ b/rpcs3/Emu/System.cpp @@ -1760,8 +1760,8 @@ std::string Emulator::GetFormattedTitle(double fps) const u32 Emulator::GetMaxThreads() const { - u32 max_threads = static_cast(g_cfg.core.llvm_threads); - u32 thread_count = max_threads > 0 ? std::min(max_threads, std::thread::hardware_concurrency()) : std::thread::hardware_concurrency(); + const u32 max_threads = static_cast(g_cfg.core.llvm_threads); + const u32 thread_count = max_threads > 0 ? std::min(max_threads, std::thread::hardware_concurrency()) : std::thread::hardware_concurrency(); return thread_count; } diff --git a/rpcs3/Emu/system_config.h b/rpcs3/Emu/system_config.h index c751e66560..bcb24b4895 100644 --- a/rpcs3/Emu/system_config.h +++ b/rpcs3/Emu/system_config.h @@ -118,21 +118,21 @@ struct cfg_root : cfg::node cfg::_bool disable_zcull_queries{ this, "Disable ZCull Occlusion Queries", false }; cfg::_bool disable_vertex_cache{ this, "Disable Vertex Cache", false }; cfg::_bool disable_FIFO_reordering{ this, "Disable FIFO Reordering", false }; - cfg::_bool frame_skip_enabled{ this, "Enable Frame Skip", false }; + cfg::_bool frame_skip_enabled{ this, "Enable Frame Skip", false, true }; cfg::_bool force_cpu_blit_processing{ this, "Force CPU Blit", false, true }; // Debugging option cfg::_bool disable_on_disk_shader_cache{ this, "Disable On-Disk Shader Cache", false }; cfg::_bool disable_vulkan_mem_allocator{ this, "Disable Vulkan Memory Allocator", false }; - cfg::_bool full_rgb_range_output{ this, "Use full RGB output range", true }; // Video out dynamic range + cfg::_bool full_rgb_range_output{ this, "Use full RGB output range", true, true }; // Video out dynamic range cfg::_bool disable_asynchronous_shader_compiler{ this, "Disable Asynchronous Shader Compiler", false }; cfg::_bool strict_texture_flushing{ this, "Strict Texture Flushing", false }; cfg::_bool disable_native_float16{ this, "Disable native float16 support", false }; cfg::_bool multithreaded_rsx{ this, "Multithreaded RSX", false }; cfg::_bool relaxed_zcull_sync{ this, "Relaxed ZCULL Sync", false }; cfg::_bool enable_3d{ this, "Enable 3D", false }; - cfg::_int<1, 8> consequtive_frames_to_draw{ this, "Consecutive Frames To Draw", 1 }; - cfg::_int<1, 8> consequtive_frames_to_skip{ this, "Consecutive Frames To Skip", 1 }; + cfg::_int<1, 8> consecutive_frames_to_draw{ this, "Consecutive Frames To Draw", 1, true}; + cfg::_int<1, 8> consecutive_frames_to_skip{ this, "Consecutive Frames To Skip", 1, true}; cfg::_int<50, 800> resolution_scale_percent{ this, "Resolution Scale", 100 }; - cfg::_int<0, 16> anisotropic_level_override{ this, "Anisotropic Filter Override", 0 }; + cfg::_int<0, 16> anisotropic_level_override{ this, "Anisotropic Filter Override", 0, true }; cfg::_int<1, 1024> min_scalable_dimension{ this, "Minimum Scalable Dimension", 16 }; cfg::_int<0, 30000000> driver_recovery_timeout{ this, "Driver Recovery Timeout", 1000000, true }; cfg::_int<0, 16667> driver_wakeup_delay{ this, "Driver Wake-Up Delay", 1, true };