rsx: Enable hw blit engine for local->main memory blit operations as well

This commit is contained in:
kd-11 2017-11-10 15:13:32 +03:00
parent be6b5922dd
commit 6d2dcbd164
2 changed files with 32 additions and 5 deletions

View File

@ -1605,13 +1605,40 @@ namespace rsx
//Create source texture if does not exist
if (!src_is_render_target)
{
auto preloaded_texture = find_texture_from_dimensions(src_address, src.width, src.slice_h);
auto overlapping_surfaces = find_texture_from_range(src_address, src.pitch * src.height);
if (preloaded_texture != nullptr)
auto old_src_area = src_area;
for (auto &surface : overlapping_surfaces)
{
vram_texture = preloaded_texture->get_raw_texture();
//look for any that will fit, unless its a shader read surface or framebuffer_storage
if (surface->get_context() == rsx::texture_upload_context::shader_read ||
surface->get_context() == rsx::texture_upload_context::framebuffer_storage)
continue;
if (const u32 address_offset = src_address - surface->get_section_base())
{
const u16 bpp = dst_is_argb8 ? 4 : 2;
const u16 offset_y = address_offset / src.pitch;
const u16 offset_x = address_offset % src.pitch;
const u16 offset_x_in_block = offset_x / bpp;
src_area.x1 += offset_x_in_block;
src_area.x2 += offset_x_in_block;
src_area.y1 += offset_y;
src_area.y2 += offset_y;
}
if (src_area.x2 <= surface->get_width() &&
src_area.y2 <= surface->get_height())
{
vram_texture = surface->get_raw_texture();
break;
}
src_area = old_src_area;
}
else
if (!vram_texture)
{
lock.upgrade();

View File

@ -681,7 +681,7 @@ namespace rsx
dst_info.max_tile_h = static_cast<u16>((dst_region.tile->size - dst_region.base) / out_pitch);
}
if (!g_cfg.video.force_cpu_blit_processing && dst_dma == CELL_GCM_CONTEXT_DMA_MEMORY_FRAME_BUFFER)
if (!g_cfg.video.force_cpu_blit_processing && (dst_dma == CELL_GCM_CONTEXT_DMA_MEMORY_FRAME_BUFFER || src_dma == CELL_GCM_CONTEXT_DMA_MEMORY_FRAME_BUFFER))
{
//For now, only use this for actual scaled images, there are use cases that should not go through 3d engine, e.g program ucode transfer
//TODO: Figure out more instances where we can use this without problems