diff --git a/rpcs3/Emu/RSX/D3D12/D3D12RenderTargetSets.cpp b/rpcs3/Emu/RSX/D3D12/D3D12RenderTargetSets.cpp index c84e59c38e..4db62cabec 100644 --- a/rpcs3/Emu/RSX/D3D12/D3D12RenderTargetSets.cpp +++ b/rpcs3/Emu/RSX/D3D12/D3D12RenderTargetSets.cpp @@ -103,9 +103,6 @@ namespace void D3D12GSRender::clear_surface(u32 arg) { - // Ignore clear if surface target is set to CELL_GCM_SURFACE_TARGET_NONE - if (rsx::method_registers.surface_color_target() == rsx::surface_target::none) return; - std::chrono::time_point start_duration = steady_clock::now(); std::chrono::time_point rtt_duration_start = steady_clock::now(); diff --git a/rpcs3/Emu/RSX/GL/GLGSRender.cpp b/rpcs3/Emu/RSX/GL/GLGSRender.cpp index 4df8a407bc..6fc4110961 100644 --- a/rpcs3/Emu/RSX/GL/GLGSRender.cpp +++ b/rpcs3/Emu/RSX/GL/GLGSRender.cpp @@ -845,7 +845,6 @@ void GLGSRender::on_exit() void GLGSRender::clear_surface(u32 arg) { if (skip_frame || !framebuffer_status_valid) return; - if (rsx::method_registers.surface_color_target() == rsx::surface_target::none) return; if ((arg & 0xf3) == 0) return; GLbitfield mask = 0; @@ -1181,10 +1180,6 @@ void GLGSRender::flip(int buffer) tex->remove(); m_rtts.invalidated_resources.clear(); - - if (g_cfg.video.invalidate_surface_cache_every_frame) - m_rtts.invalidate_surface_cache_data(nullptr); - m_vertex_cache->purge(); //If we are skipping the next frame, do not reset perf counters diff --git a/rpcs3/Emu/RSX/GL/GLRenderTargets.cpp b/rpcs3/Emu/RSX/GL/GLRenderTargets.cpp index e1f3ee3322..442e15fb7a 100644 --- a/rpcs3/Emu/RSX/GL/GLRenderTargets.cpp +++ b/rpcs3/Emu/RSX/GL/GLRenderTargets.cpp @@ -166,20 +166,33 @@ void GLGSRender::init_buffers(bool skip_reading) const u16 clip_horizontal = rsx::method_registers.surface_clip_width(); const u16 clip_vertical = rsx::method_registers.surface_clip_height(); + framebuffer_status_valid = false; + if (clip_horizontal == 0 || clip_vertical == 0) { LOG_ERROR(RSX, "Invalid framebuffer setup, w=%d, h=%d", clip_horizontal, clip_vertical); - framebuffer_status_valid = false; return; } + const auto surface_addresses = get_color_surface_addresses(); + const auto depth_address = get_zeta_surface_address(); + + for (const auto &addr: surface_addresses) + { + if (addr) + { + framebuffer_status_valid = true; + break; + } + } + + if (!framebuffer_status_valid && !depth_address) + return; + const auto pitchs = get_pitchs(); const auto surface_format = rsx::method_registers.surface_color(); const auto depth_format = rsx::method_registers.surface_depth_fmt(); - const auto surface_addresses = get_color_surface_addresses(); - const auto depth_address = get_zeta_surface_address(); - m_rtts.prepare_render_target(nullptr, surface_format, depth_format, clip_horizontal, clip_vertical, rsx::method_registers.surface_color_target(), surface_addresses, depth_address); diff --git a/rpcs3/Emu/RSX/VK/VKGSRender.cpp b/rpcs3/Emu/RSX/VK/VKGSRender.cpp index 487bbe33cc..81260bad79 100644 --- a/rpcs3/Emu/RSX/VK/VKGSRender.cpp +++ b/rpcs3/Emu/RSX/VK/VKGSRender.cpp @@ -1341,9 +1341,6 @@ void VKGSRender::clear_surface(u32 mask) { if (skip_frame) return; - // Ignore clear if surface target is set to CELL_GCM_SURFACE_TARGET_NONE - if (rsx::method_registers.surface_color_target() == rsx::surface_target::none) return; - // Ignore invalid clear flags if (!(mask & 0xF3)) return; @@ -1565,10 +1562,6 @@ void VKGSRender::advance_queued_frames() } } - //Only marks surfaces as dirty without actually deleting them so its safe to use - if (g_cfg.video.invalidate_surface_cache_every_frame) - m_rtts.invalidate_surface_cache_data(&*m_current_command_buffer); - //m_rtts storage is double buffered and should be safe to tag on frame boundary m_rtts.free_invalidated(); @@ -2175,17 +2168,31 @@ void VKGSRender::prepare_rtts() u32 clip_x = rsx::method_registers.surface_clip_origin_x(); u32 clip_y = rsx::method_registers.surface_clip_origin_y(); + framebuffer_status_valid = false; + if (clip_width == 0 || clip_height == 0) { LOG_ERROR(RSX, "Invalid framebuffer setup, w=%d, h=%d", clip_width, clip_height); - framebuffer_status_valid = false; return; } - framebuffer_status_valid = true; - auto surface_addresses = get_color_surface_addresses(); auto zeta_address = get_zeta_surface_address(); + + for (const auto &addr: surface_addresses) + { + if (addr) + { + framebuffer_status_valid = true; + break; + } + } + + if (!framebuffer_status_valid && !zeta_address) + return; + + //At least one attachment exists + framebuffer_status_valid = true; const u32 surface_pitchs[] = { rsx::method_registers.surface_a_pitch(), rsx::method_registers.surface_b_pitch(), rsx::method_registers.surface_c_pitch(), rsx::method_registers.surface_d_pitch() }; diff --git a/rpcs3/Emu/RSX/VK/VKVertexBuffers.cpp b/rpcs3/Emu/RSX/VK/VKVertexBuffers.cpp index ee9c614c4c..b28838e4b6 100644 --- a/rpcs3/Emu/RSX/VK/VKVertexBuffers.cpp +++ b/rpcs3/Emu/RSX/VK/VKVertexBuffers.cpp @@ -171,9 +171,9 @@ namespace rsx::method_registers.current_draw_clause.alternate_first_count_commands.resize(0); if (index_type == rsx::index_array_type::u16) - rsx::split_index_list(reinterpret_cast(tmp.data()), index_count, UINT16_MAX, rsx::method_registers.current_draw_clause.alternate_first_count_commands); + rsx::split_index_list(reinterpret_cast(tmp.data()), index_count, (u16)UINT16_MAX, rsx::method_registers.current_draw_clause.alternate_first_count_commands); else - rsx::split_index_list(reinterpret_cast(tmp.data()), index_count, UINT32_MAX, rsx::method_registers.current_draw_clause.alternate_first_count_commands); + rsx::split_index_list(reinterpret_cast(tmp.data()), index_count, (u32)UINT32_MAX, rsx::method_registers.current_draw_clause.alternate_first_count_commands); memcpy(buf, tmp.data(), tmp.size()); } diff --git a/rpcs3/Emu/System.h b/rpcs3/Emu/System.h index d930e51211..bc1adb4c0e 100644 --- a/rpcs3/Emu/System.h +++ b/rpcs3/Emu/System.h @@ -324,7 +324,6 @@ struct cfg_root : cfg::node cfg::_bool use_gpu_texture_scaling{this, "Use GPU texture scaling", true}; cfg::_bool stretch_to_display_area{this, "Stretch To Display Area"}; cfg::_bool force_high_precision_z_buffer{this, "Force High Precision Z buffer"}; - cfg::_bool invalidate_surface_cache_every_frame{this, "Invalidate Cache Every Frame", true}; cfg::_bool strict_rendering_mode{this, "Strict Rendering Mode"}; cfg::_bool disable_zcull_queries{this, "Disable ZCull Occlusion Queries", false}; cfg::_bool disable_vertex_cache{this, "Disable Vertex Cache", false}; diff --git a/rpcs3/Json/tooltips.json b/rpcs3/Json/tooltips.json index 8139a031d8..0aee1ee8fe 100644 --- a/rpcs3/Json/tooltips.json +++ b/rpcs3/Json/tooltips.json @@ -80,7 +80,6 @@ "main": { "dumpColor": "Enable this option if you get missing graphics or broken lighting ingame.\nMight degrade performance and introduce stuttering in some cases.\nRequired for Demon's Souls.", "vsync": "By having this off you might obtain a higher frame rate at the cost of tearing artifacts in the game.", - "autoInvalidateCache": "Enable this option if the game has broken shadows. May slightly degrade performance.", "gpuTextureScaling": "Small to significant performance boost in most games and rarely with side effects.\nMay cause texture corruption in rare cases.", "scrictModeRendering": "Enforces strict compliance to the API specification.\nMight result in degraded performance in some games.\nCan resolve rare cases of missing graphics and flickering.\nIf unsure, don't use this option.", "stretchToDisplayArea": "Overrides the aspect ratio and stretches the image to the full display area." diff --git a/rpcs3/rpcs3qt/emu_settings.h b/rpcs3/rpcs3qt/emu_settings.h index 942b2e14b6..8f3fd176a7 100644 --- a/rpcs3/rpcs3qt/emu_settings.h +++ b/rpcs3/rpcs3qt/emu_settings.h @@ -56,7 +56,6 @@ public: D3D12Adapter, VulkanAdapter, ForceHighpZ, - AutoInvalidateCache, StrictRenderingMode, DisableVertexCache, DisableOcclusionQueries, @@ -209,7 +208,6 @@ private: { GPUTextureScaling, { "Video", "Use GPU texture scaling"}}, { StretchToDisplayArea, { "Video", "Stretch To Display Area"}}, { ForceHighpZ, { "Video", "Force High Precision Z buffer"}}, - { AutoInvalidateCache, { "Video", "Invalidate Cache Every Frame"}}, { StrictRenderingMode, { "Video", "Strict Rendering Mode"}}, { DisableVertexCache, { "Video", "Disable Vertex Cache"}}, { DisableOcclusionQueries, { "Video", "Disable ZCull Occlusion Queries" }}, diff --git a/rpcs3/rpcs3qt/settings_dialog.cpp b/rpcs3/rpcs3qt/settings_dialog.cpp index 88a850c286..d7b2042962 100644 --- a/rpcs3/rpcs3qt/settings_dialog.cpp +++ b/rpcs3/rpcs3qt/settings_dialog.cpp @@ -406,9 +406,6 @@ settings_dialog::settings_dialog(std::shared_ptr guiSettings, std: xemu_settings->EnhanceCheckBox(ui->vsync, emu_settings::VSync); ui->vsync->setToolTip(json_gpu_main["vsync"].toString()); - xemu_settings->EnhanceCheckBox(ui->autoInvalidateCache, emu_settings::AutoInvalidateCache); - ui->autoInvalidateCache->setToolTip(json_gpu_main["autoInvalidateCache"].toString()); - xemu_settings->EnhanceCheckBox(ui->gpuTextureScaling, emu_settings::GPUTextureScaling); ui->gpuTextureScaling->setToolTip(json_gpu_main["gpuTextureScaling"].toString()); diff --git a/rpcs3/rpcs3qt/settings_dialog.ui b/rpcs3/rpcs3qt/settings_dialog.ui index 55757ec95b..5b833369dd 100644 --- a/rpcs3/rpcs3qt/settings_dialog.ui +++ b/rpcs3/rpcs3qt/settings_dialog.ui @@ -36,7 +36,7 @@ - 7 + 1 @@ -503,13 +503,6 @@ - - - - Invalidate Cache Every Frame - - -