mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-04 05:51:27 +12:00
rsx: Update tag timestamp to match newest inherited data
- Avoids memory appearing older when used for depth test without depth write The write_barrier before the call will inherit new data but the tag will not update as no new information is added.
This commit is contained in:
parent
c67c97844e
commit
7c5bde4aeb
2 changed files with 7 additions and 2 deletions
|
@ -586,6 +586,7 @@ void gl::render_target::memory_barrier(gl::command_context& cmd, bool force_init
|
||||||
const bool dst_is_depth = !!(aspect() & gl::image_aspect::depth);
|
const bool dst_is_depth = !!(aspect() & gl::image_aspect::depth);
|
||||||
const auto dst_bpp = get_bpp();
|
const auto dst_bpp = get_bpp();
|
||||||
unsigned first = prepare_rw_barrier_for_transfer(this);
|
unsigned first = prepare_rw_barrier_for_transfer(this);
|
||||||
|
u64 newest_tag = 0;
|
||||||
|
|
||||||
for (auto i = first; i < old_contents.size(); ++i)
|
for (auto i = first; i < old_contents.size(); ++i)
|
||||||
{
|
{
|
||||||
|
@ -632,9 +633,11 @@ void gl::render_target::memory_barrier(gl::command_context& cmd, bool force_init
|
||||||
section.src_rect(),
|
section.src_rect(),
|
||||||
section.dst_rect(),
|
section.dst_rect(),
|
||||||
!dst_is_depth, dst_is_depth, typeless_info);
|
!dst_is_depth, dst_is_depth, typeless_info);
|
||||||
|
|
||||||
|
newest_tag = src_texture->last_use_tag;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Memory has been transferred, discard old contents and update memory flags
|
// Memory has been transferred, discard old contents and update memory flags
|
||||||
// TODO: Preserve memory outside surface clip region
|
// TODO: Preserve memory outside surface clip region
|
||||||
on_write();
|
on_write(newest_tag);
|
||||||
}
|
}
|
||||||
|
|
|
@ -425,6 +425,7 @@ namespace vk
|
||||||
unsigned first = prepare_rw_barrier_for_transfer(this);
|
unsigned first = prepare_rw_barrier_for_transfer(this);
|
||||||
bool optimize_copy = true;
|
bool optimize_copy = true;
|
||||||
bool any_valid_writes = false;
|
bool any_valid_writes = false;
|
||||||
|
u64 newest_tag = 0;
|
||||||
|
|
||||||
for (auto i = first; i < old_contents.size(); ++i)
|
for (auto i = first; i < old_contents.size(); ++i)
|
||||||
{
|
{
|
||||||
|
@ -504,6 +505,7 @@ namespace vk
|
||||||
/*linear?*/false, /*depth?(unused)*/false, typeless_info);
|
/*linear?*/false, /*depth?(unused)*/false, typeless_info);
|
||||||
|
|
||||||
optimize_copy = optimize_copy && !memory_load;
|
optimize_copy = optimize_copy && !memory_load;
|
||||||
|
newest_tag = src_texture->last_use_tag;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (UNLIKELY(!any_valid_writes))
|
if (UNLIKELY(!any_valid_writes))
|
||||||
|
@ -524,7 +526,7 @@ namespace vk
|
||||||
}
|
}
|
||||||
|
|
||||||
// NOTE: Optimize flag relates to stencil resolve/unresolve for NVIDIA.
|
// NOTE: Optimize flag relates to stencil resolve/unresolve for NVIDIA.
|
||||||
on_write_copy(0, optimize_copy);
|
on_write_copy(newest_tag, optimize_copy);
|
||||||
|
|
||||||
if (!read_access && samples() > 1)
|
if (!read_access && samples() > 1)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue