Skip to content

Commit

Permalink
rsx: Account for null blit ops (memcpy)
Browse files Browse the repository at this point in the history
- Do not perform extra memory tasks if no actual image copy was performed
  • Loading branch information
kd-11 committed Feb 16, 2018
1 parent 661b8b0 commit a8ab408
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 14 deletions.
24 changes: 14 additions & 10 deletions rpcs3/Emu/RSX/GL/GLTextureCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -998,19 +998,23 @@ namespace gl

if (result.succeeded)
{
gl::texture::format fmt;
if (!result.is_depth)
if (result.real_dst_size)
{
fmt = dst.format == rsx::blit_engine::transfer_destination_format::a8r8g8b8 ?
gl::texture::format::bgra : gl::texture::format::rgba;
}
else
{
fmt = dst.format == rsx::blit_engine::transfer_destination_format::a8r8g8b8 ?
gl::texture::format::depth_stencil : gl::texture::format::depth;
gl::texture::format fmt;
if (!result.is_depth)
{
fmt = dst.format == rsx::blit_engine::transfer_destination_format::a8r8g8b8 ?
gl::texture::format::bgra : gl::texture::format::rgba;
}
else
{
fmt = dst.format == rsx::blit_engine::transfer_destination_format::a8r8g8b8 ?
gl::texture::format::depth_stencil : gl::texture::format::depth;
}

flush_if_cache_miss_likely(fmt, result.real_dst_address, result.real_dst_size);
}

flush_if_cache_miss_likely(fmt, result.real_dst_address, result.real_dst_size);
return true;
}

Expand Down
9 changes: 6 additions & 3 deletions rpcs3/Emu/RSX/VK/VKGSRender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3214,9 +3214,12 @@ bool VKGSRender::scaled_image_from_memory(rsx::blit_src_info& src, rsx::blit_dst
require_flush = true;
}

if (m_texture_cache.flush_if_cache_miss_likely(result.dst_image->info.format, result.real_dst_address, result.real_dst_size,
*m_current_command_buffer, m_memory_type_mapping, m_swap_chain->get_present_queue()))
require_flush = true;
if (result.dst_image)
{
if (m_texture_cache.flush_if_cache_miss_likely(result.dst_image->info.format, result.real_dst_address, result.real_dst_size,
*m_current_command_buffer, m_memory_type_mapping, m_swap_chain->get_present_queue()))
require_flush = true;
}

if (require_flush)
flush_command_queue();
Expand Down
2 changes: 1 addition & 1 deletion rpcs3/Emu/RSX/rsx_methods.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -934,7 +934,7 @@ namespace rsx
LOG_ERROR(RSX, "NV0039_OFFSET_IN: Unsupported format: inFormat=%d, outFormat=%d", in_format, out_format);
}

LOG_NOTICE(RSX, "NV0039_OFFSET_IN: pitch(in=0x%x, out=0x%x), line(len=0x%x, cnt=0x%x), fmt(in=0x%x, out=0x%x), notify=0x%x",
LOG_TRACE(RSX, "NV0039_OFFSET_IN: pitch(in=0x%x, out=0x%x), line(len=0x%x, cnt=0x%x), fmt(in=0x%x, out=0x%x), notify=0x%x",
in_pitch, out_pitch, line_length, line_count, in_format, out_format, notify);

if (!in_pitch)
Expand Down

0 comments on commit a8ab408

Please sign in to comment.