mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-01-30 21:32:50 +00:00
rsx: Allow clear_surface command for depth-only passes. Removes invalidate cache hack
This commit is contained in:
parent
5db45c3699
commit
a8e1754fa4
@ -103,9 +103,6 @@ namespace
|
|||||||
|
|
||||||
void D3D12GSRender::clear_surface(u32 arg)
|
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<steady_clock> start_duration = steady_clock::now();
|
std::chrono::time_point<steady_clock> start_duration = steady_clock::now();
|
||||||
|
|
||||||
std::chrono::time_point<steady_clock> rtt_duration_start = steady_clock::now();
|
std::chrono::time_point<steady_clock> rtt_duration_start = steady_clock::now();
|
||||||
|
@ -845,7 +845,6 @@ void GLGSRender::on_exit()
|
|||||||
void GLGSRender::clear_surface(u32 arg)
|
void GLGSRender::clear_surface(u32 arg)
|
||||||
{
|
{
|
||||||
if (skip_frame || !framebuffer_status_valid) return;
|
if (skip_frame || !framebuffer_status_valid) return;
|
||||||
if (rsx::method_registers.surface_color_target() == rsx::surface_target::none) return;
|
|
||||||
if ((arg & 0xf3) == 0) return;
|
if ((arg & 0xf3) == 0) return;
|
||||||
|
|
||||||
GLbitfield mask = 0;
|
GLbitfield mask = 0;
|
||||||
@ -1181,10 +1180,6 @@ void GLGSRender::flip(int buffer)
|
|||||||
tex->remove();
|
tex->remove();
|
||||||
|
|
||||||
m_rtts.invalidated_resources.clear();
|
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();
|
m_vertex_cache->purge();
|
||||||
|
|
||||||
//If we are skipping the next frame, do not reset perf counters
|
//If we are skipping the next frame, do not reset perf counters
|
||||||
|
@ -166,20 +166,33 @@ void GLGSRender::init_buffers(bool skip_reading)
|
|||||||
const u16 clip_horizontal = rsx::method_registers.surface_clip_width();
|
const u16 clip_horizontal = rsx::method_registers.surface_clip_width();
|
||||||
const u16 clip_vertical = rsx::method_registers.surface_clip_height();
|
const u16 clip_vertical = rsx::method_registers.surface_clip_height();
|
||||||
|
|
||||||
|
framebuffer_status_valid = false;
|
||||||
|
|
||||||
if (clip_horizontal == 0 || clip_vertical == 0)
|
if (clip_horizontal == 0 || clip_vertical == 0)
|
||||||
{
|
{
|
||||||
LOG_ERROR(RSX, "Invalid framebuffer setup, w=%d, h=%d", clip_horizontal, clip_vertical);
|
LOG_ERROR(RSX, "Invalid framebuffer setup, w=%d, h=%d", clip_horizontal, clip_vertical);
|
||||||
framebuffer_status_valid = false;
|
|
||||||
return;
|
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 pitchs = get_pitchs();
|
||||||
const auto surface_format = rsx::method_registers.surface_color();
|
const auto surface_format = rsx::method_registers.surface_color();
|
||||||
const auto depth_format = rsx::method_registers.surface_depth_fmt();
|
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,
|
m_rtts.prepare_render_target(nullptr, surface_format, depth_format, clip_horizontal, clip_vertical,
|
||||||
rsx::method_registers.surface_color_target(),
|
rsx::method_registers.surface_color_target(),
|
||||||
surface_addresses, depth_address);
|
surface_addresses, depth_address);
|
||||||
|
@ -1341,9 +1341,6 @@ void VKGSRender::clear_surface(u32 mask)
|
|||||||
{
|
{
|
||||||
if (skip_frame) return;
|
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
|
// Ignore invalid clear flags
|
||||||
if (!(mask & 0xF3)) return;
|
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 storage is double buffered and should be safe to tag on frame boundary
|
||||||
m_rtts.free_invalidated();
|
m_rtts.free_invalidated();
|
||||||
|
|
||||||
@ -2175,17 +2168,31 @@ void VKGSRender::prepare_rtts()
|
|||||||
u32 clip_x = rsx::method_registers.surface_clip_origin_x();
|
u32 clip_x = rsx::method_registers.surface_clip_origin_x();
|
||||||
u32 clip_y = rsx::method_registers.surface_clip_origin_y();
|
u32 clip_y = rsx::method_registers.surface_clip_origin_y();
|
||||||
|
|
||||||
|
framebuffer_status_valid = false;
|
||||||
|
|
||||||
if (clip_width == 0 || clip_height == 0)
|
if (clip_width == 0 || clip_height == 0)
|
||||||
{
|
{
|
||||||
LOG_ERROR(RSX, "Invalid framebuffer setup, w=%d, h=%d", clip_width, clip_height);
|
LOG_ERROR(RSX, "Invalid framebuffer setup, w=%d, h=%d", clip_width, clip_height);
|
||||||
framebuffer_status_valid = false;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
framebuffer_status_valid = true;
|
|
||||||
|
|
||||||
auto surface_addresses = get_color_surface_addresses();
|
auto surface_addresses = get_color_surface_addresses();
|
||||||
auto zeta_address = get_zeta_surface_address();
|
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(),
|
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() };
|
rsx::method_registers.surface_c_pitch(), rsx::method_registers.surface_d_pitch() };
|
||||||
|
@ -171,9 +171,9 @@ namespace
|
|||||||
rsx::method_registers.current_draw_clause.alternate_first_count_commands.resize(0);
|
rsx::method_registers.current_draw_clause.alternate_first_count_commands.resize(0);
|
||||||
|
|
||||||
if (index_type == rsx::index_array_type::u16)
|
if (index_type == rsx::index_array_type::u16)
|
||||||
rsx::split_index_list(reinterpret_cast<u16*>(tmp.data()), index_count, UINT16_MAX, rsx::method_registers.current_draw_clause.alternate_first_count_commands);
|
rsx::split_index_list(reinterpret_cast<u16*>(tmp.data()), index_count, (u16)UINT16_MAX, rsx::method_registers.current_draw_clause.alternate_first_count_commands);
|
||||||
else
|
else
|
||||||
rsx::split_index_list(reinterpret_cast<u32*>(tmp.data()), index_count, UINT32_MAX, rsx::method_registers.current_draw_clause.alternate_first_count_commands);
|
rsx::split_index_list(reinterpret_cast<u32*>(tmp.data()), index_count, (u32)UINT32_MAX, rsx::method_registers.current_draw_clause.alternate_first_count_commands);
|
||||||
|
|
||||||
memcpy(buf, tmp.data(), tmp.size());
|
memcpy(buf, tmp.data(), tmp.size());
|
||||||
}
|
}
|
||||||
|
@ -324,7 +324,6 @@ struct cfg_root : cfg::node
|
|||||||
cfg::_bool use_gpu_texture_scaling{this, "Use GPU texture scaling", true};
|
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 stretch_to_display_area{this, "Stretch To Display Area"};
|
||||||
cfg::_bool force_high_precision_z_buffer{this, "Force High Precision Z buffer"};
|
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 strict_rendering_mode{this, "Strict Rendering Mode"};
|
||||||
cfg::_bool disable_zcull_queries{this, "Disable ZCull Occlusion Queries", false};
|
cfg::_bool disable_zcull_queries{this, "Disable ZCull Occlusion Queries", false};
|
||||||
cfg::_bool disable_vertex_cache{this, "Disable Vertex Cache", false};
|
cfg::_bool disable_vertex_cache{this, "Disable Vertex Cache", false};
|
||||||
|
@ -80,7 +80,6 @@
|
|||||||
"main": {
|
"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.",
|
"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.",
|
"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.",
|
"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.",
|
"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."
|
"stretchToDisplayArea": "Overrides the aspect ratio and stretches the image to the full display area."
|
||||||
|
@ -56,7 +56,6 @@ public:
|
|||||||
D3D12Adapter,
|
D3D12Adapter,
|
||||||
VulkanAdapter,
|
VulkanAdapter,
|
||||||
ForceHighpZ,
|
ForceHighpZ,
|
||||||
AutoInvalidateCache,
|
|
||||||
StrictRenderingMode,
|
StrictRenderingMode,
|
||||||
DisableVertexCache,
|
DisableVertexCache,
|
||||||
DisableOcclusionQueries,
|
DisableOcclusionQueries,
|
||||||
@ -209,7 +208,6 @@ private:
|
|||||||
{ GPUTextureScaling, { "Video", "Use GPU texture scaling"}},
|
{ GPUTextureScaling, { "Video", "Use GPU texture scaling"}},
|
||||||
{ StretchToDisplayArea, { "Video", "Stretch To Display Area"}},
|
{ StretchToDisplayArea, { "Video", "Stretch To Display Area"}},
|
||||||
{ ForceHighpZ, { "Video", "Force High Precision Z buffer"}},
|
{ ForceHighpZ, { "Video", "Force High Precision Z buffer"}},
|
||||||
{ AutoInvalidateCache, { "Video", "Invalidate Cache Every Frame"}},
|
|
||||||
{ StrictRenderingMode, { "Video", "Strict Rendering Mode"}},
|
{ StrictRenderingMode, { "Video", "Strict Rendering Mode"}},
|
||||||
{ DisableVertexCache, { "Video", "Disable Vertex Cache"}},
|
{ DisableVertexCache, { "Video", "Disable Vertex Cache"}},
|
||||||
{ DisableOcclusionQueries, { "Video", "Disable ZCull Occlusion Queries" }},
|
{ DisableOcclusionQueries, { "Video", "Disable ZCull Occlusion Queries" }},
|
||||||
|
@ -406,9 +406,6 @@ settings_dialog::settings_dialog(std::shared_ptr<gui_settings> guiSettings, std:
|
|||||||
xemu_settings->EnhanceCheckBox(ui->vsync, emu_settings::VSync);
|
xemu_settings->EnhanceCheckBox(ui->vsync, emu_settings::VSync);
|
||||||
ui->vsync->setToolTip(json_gpu_main["vsync"].toString());
|
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);
|
xemu_settings->EnhanceCheckBox(ui->gpuTextureScaling, emu_settings::GPUTextureScaling);
|
||||||
ui->gpuTextureScaling->setToolTip(json_gpu_main["gpuTextureScaling"].toString());
|
ui->gpuTextureScaling->setToolTip(json_gpu_main["gpuTextureScaling"].toString());
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>7</number>
|
<number>1</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="coreTab">
|
<widget class="QWidget" name="coreTab">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
@ -503,13 +503,6 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<widget class="QCheckBox" name="autoInvalidateCache">
|
|
||||||
<property name="text">
|
|
||||||
<string>Invalidate Cache Every Frame</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="gpuTextureScaling">
|
<widget class="QCheckBox" name="gpuTextureScaling">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user