Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make some more settings dynamic #8037

Merged
merged 2 commits into from Apr 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions rpcs3/Emu/RSX/GL/GLDraw.cpp
@@ -1,4 +1,4 @@
#include "stdafx.h"
#include "stdafx.h"
#include "GLGSRender.h"
#include "../Common/BufferUtils.h"

Expand Down Expand Up @@ -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);

Expand Down
8 changes: 5 additions & 3 deletions rpcs3/Emu/RSX/GL/GLPresent.cpp
Expand Up @@ -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<int>(buffer_width), static_cast<int>(buffer_height) });
const areai screen_area = coordi({}, { static_cast<int>(buffer_width), static_cast<int>(buffer_height) });
kd-11 marked this conversation as resolved.
Show resolved Hide resolved

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();
Expand All @@ -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<GLuint> images{ image_to_flip, image_to_flip2 };

gl::screen.bind();
Expand Down
7 changes: 4 additions & 3 deletions rpcs3/Emu/RSX/GL/GLTexture.cpp
Expand Up @@ -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()));
Expand Down Expand Up @@ -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()));

Expand Down
4 changes: 2 additions & 2 deletions rpcs3/Emu/RSX/RSXThread.cpp
Expand Up @@ -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);
}
Expand Down
7 changes: 4 additions & 3 deletions rpcs3/Emu/RSX/VK/VKDraw.cpp
@@ -1,4 +1,4 @@
#include "stdafx.h"
#include "stdafx.h"
#include "VKGSRender.h"
#include "../Common/BufferUtils.h"

Expand Down Expand Up @@ -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());
Expand Down
6 changes: 4 additions & 2 deletions rpcs3/Emu/RSX/VK/VKPresent.cpp
Expand Up @@ -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<vk::viewable_image*>(image_to_flip));
verify("Image not viewable" HERE), calibration_src.front();
Expand Down Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions rpcs3/Emu/System.cpp
Expand Up @@ -1760,8 +1760,8 @@ std::string Emulator::GetFormattedTitle(double fps) const

u32 Emulator::GetMaxThreads() const
{
u32 max_threads = static_cast<u32>(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<u32>(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;
}

Expand Down
10 changes: 5 additions & 5 deletions rpcs3/Emu/system_config.h
Expand Up @@ -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 };
Expand Down