mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-03 21:41:26 +12:00
gl: Change clear timing to immediate
gl: Handle cell write to locked RTT region addendum: Fix buffer locking (personal 4)
This commit is contained in:
parent
7c73c3b75c
commit
ef8e92cbe3
4 changed files with 13 additions and 26 deletions
|
@ -194,12 +194,6 @@ void GLGSRender::begin()
|
||||||
if (!draw_fbo.check())
|
if (!draw_fbo.check())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (surface_clear_flags)
|
|
||||||
{
|
|
||||||
clear_surface(surface_clear_flags);
|
|
||||||
surface_clear_flags = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::chrono::time_point<steady_clock> then = steady_clock::now();
|
std::chrono::time_point<steady_clock> then = steady_clock::now();
|
||||||
|
|
||||||
bool color_mask_b = rsx::method_registers.color_mask_b();
|
bool color_mask_b = rsx::method_registers.color_mask_b();
|
||||||
|
@ -664,9 +658,12 @@ bool GLGSRender::do_method(u32 cmd, u32 arg)
|
||||||
switch (cmd)
|
switch (cmd)
|
||||||
{
|
{
|
||||||
case NV4097_CLEAR_SURFACE:
|
case NV4097_CLEAR_SURFACE:
|
||||||
|
{
|
||||||
init_buffers(true);
|
init_buffers(true);
|
||||||
surface_clear_flags |= arg;
|
synchronize_buffers();
|
||||||
|
clear_surface(arg);
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
case NV4097_TEXTURE_READ_SEMAPHORE_RELEASE:
|
case NV4097_TEXTURE_READ_SEMAPHORE_RELEASE:
|
||||||
case NV4097_BACK_END_WRITE_SEMAPHORE_RELEASE:
|
case NV4097_BACK_END_WRITE_SEMAPHORE_RELEASE:
|
||||||
flush_draw_buffers = true;
|
flush_draw_buffers = true;
|
||||||
|
|
|
@ -89,7 +89,6 @@ private:
|
||||||
gcm_buffer_info surface_info[rsx::limits::color_buffers_count];
|
gcm_buffer_info surface_info[rsx::limits::color_buffers_count];
|
||||||
gcm_buffer_info depth_surface_info;
|
gcm_buffer_info depth_surface_info;
|
||||||
|
|
||||||
u32 surface_clear_flags = 0;
|
|
||||||
bool flush_draw_buffers = false;
|
bool flush_draw_buffers = false;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -153,16 +153,6 @@ namespace
|
||||||
|
|
||||||
void GLGSRender::init_buffers(bool skip_reading)
|
void GLGSRender::init_buffers(bool skip_reading)
|
||||||
{
|
{
|
||||||
//NOTE 1: Sometimes, we process clear before sync flushing rsx buffers. Leads to downloading of blank data
|
|
||||||
//Clearing of surfaces is deferred to handle this
|
|
||||||
//NOTE 2: It is possible for a game to do:
|
|
||||||
//1. Bind buffer 1
|
|
||||||
//2. Clear
|
|
||||||
//3. Bind buffer 2 without touching 1
|
|
||||||
//4. Clear
|
|
||||||
//5. Bind buffer 1
|
|
||||||
//6. Draw without clear
|
|
||||||
|
|
||||||
if (draw_fbo && !m_rtts_dirty)
|
if (draw_fbo && !m_rtts_dirty)
|
||||||
{
|
{
|
||||||
set_viewport();
|
set_viewport();
|
||||||
|
@ -173,13 +163,6 @@ void GLGSRender::init_buffers(bool skip_reading)
|
||||||
//LOG_WARNING(RSX, "Render targets have changed; checking for sync points (EID=%d)", m_draw_calls);
|
//LOG_WARNING(RSX, "Render targets have changed; checking for sync points (EID=%d)", m_draw_calls);
|
||||||
synchronize_buffers();
|
synchronize_buffers();
|
||||||
|
|
||||||
//If the old buffers were dirty, clear them before we bind new buffers
|
|
||||||
if (surface_clear_flags)
|
|
||||||
{
|
|
||||||
clear_surface(surface_clear_flags);
|
|
||||||
surface_clear_flags = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_rtts_dirty = false;
|
m_rtts_dirty = false;
|
||||||
|
|
||||||
const u16 clip_horizontal = rsx::method_registers.surface_clip_width();
|
const u16 clip_horizontal = rsx::method_registers.surface_clip_width();
|
||||||
|
|
|
@ -712,7 +712,15 @@ namespace gl
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
verify(HERE), region->is_locked();
|
if (!region->is_locked())
|
||||||
|
{
|
||||||
|
verify(HERE), region->is_dirty();
|
||||||
|
LOG_WARNING(RSX, "Cell write to bound render target area");
|
||||||
|
|
||||||
|
region->protect(0, vm::page_writable | vm::page_readable);
|
||||||
|
region->set_dirty(false);
|
||||||
|
}
|
||||||
|
|
||||||
region->copy_texture();
|
region->copy_texture();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue