diff --git a/rpcs3/Emu/RSX/Common/texture_cache.h b/rpcs3/Emu/RSX/Common/texture_cache.h index 5d3c374b5d..d85f9c5c7d 100644 --- a/rpcs3/Emu/RSX/Common/texture_cache.h +++ b/rpcs3/Emu/RSX/Common/texture_cache.h @@ -1972,16 +1972,29 @@ namespace rsx const bool is_simple_subresource_copy = (result.external_subresource_desc.op == deferred_request_command::copy_image_static) || - (result.external_subresource_desc.op == deferred_request_command::copy_image_dynamic); + (result.external_subresource_desc.op == deferred_request_command::copy_image_dynamic) || + (result.external_subresource_desc.op == deferred_request_command::blit_image_static); + // FIXME: We need to check if the formats are compatible here! if (is_simple_subresource_copy && attr.edge_clamped) { - helpers::convert_image_copy_to_clip_descriptor( - result, - position2i(result.external_subresource_desc.x, result.external_subresource_desc.y), - size2i(result.external_subresource_desc.width, result.external_subresource_desc.width), - size2i(result.external_subresource_desc.external_handle->width(), result.external_subresource_desc.external_handle->height()), - encoded_remap, remap, false /*FIXME*/); + if (result.external_subresource_desc.op != deferred_request_command::blit_image_static) [[ likely ]] + { + helpers::convert_image_copy_to_clip_descriptor( + result, + position2i(result.external_subresource_desc.x, result.external_subresource_desc.y), + size2i(result.external_subresource_desc.width, result.external_subresource_desc.height), + size2i(result.external_subresource_desc.external_handle->width(), result.external_subresource_desc.external_handle->height()), + encoded_remap, remap, false /* FIXME */); + } + else + { + helpers::convert_image_blit_to_clip_descriptor( + result, + encoded_remap, + remap, + false /* FIXME */); + } return result; } diff --git a/rpcs3/Emu/RSX/Common/texture_cache_helpers.h b/rpcs3/Emu/RSX/Common/texture_cache_helpers.h index 1f7a868240..58cda5f0a8 100644 --- a/rpcs3/Emu/RSX/Common/texture_cache_helpers.h +++ b/rpcs3/Emu/RSX/Common/texture_cache_helpers.h @@ -544,6 +544,35 @@ namespace rsx calculate_sample_clip_parameters(desc, offset, desired_dimensions, actual_dimensions); } + template + void convert_image_blit_to_clip_descriptor( + sampled_image_descriptor& desc, + u32 encoded_remap, + const texture_channel_remap_t& decoded_remap, + bool cyclic_reference) + { + const auto& section = desc.external_subresource_desc.sections_to_copy[0]; + + // Our "desired" output is the source window, and the "actual" output is the real size + const auto aa_scale_x = section.src->samples() % 2; + const auto aa_scale_y = section.src->samples() / 2; + const auto surface_width = section.src->width() * aa_scale_x; + const auto surface_height = section.src->height() * aa_scale_y; + + // First, we convert this descriptor to a copy descriptor + desc.external_subresource_desc.external_handle = section.src; + + // Now apply conversion + convert_image_copy_to_clip_descriptor( + desc, + position2i(section.src_x, section.src_y), + size2i(section.src_w, section.src_h), + size2i(surface_width, surface_height), + encoded_remap, + decoded_remap, + cyclic_reference); + } + template sampled_image_descriptor process_framebuffer_resource_fast(commandbuffer_type& cmd, render_target_type texptr,