mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-08-05 15:49:20 +00:00
rsx: Trivially detect single-image-blit transfer operations
This commit is contained in:
parent
8ebf24d8e7
commit
cef4ea786a
2 changed files with 24 additions and 9 deletions
|
@ -218,11 +218,15 @@ namespace rsx
|
||||||
texcoord_xform.clamp = false;
|
texcoord_xform.clamp = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool section_fills_target(const copy_region_descriptor& cpy) const
|
inline bool section_fills_target(const copy_region_descriptor& cpy) const
|
||||||
{
|
{
|
||||||
return cpy.dst_x == 0 && cpy.dst_y == 0 &&
|
return cpy.dst_x == 0 && cpy.dst_y == 0 &&
|
||||||
cpy.dst_w == external_subresource_desc.width && cpy.dst_h == external_subresource_desc.height &&
|
cpy.dst_w == external_subresource_desc.width && cpy.dst_h == external_subresource_desc.height;
|
||||||
cpy.src_w == cpy.dst_w && cpy.src_h == cpy.dst_h;
|
}
|
||||||
|
|
||||||
|
inline bool section_is_transfer_only(const copy_region_descriptor& cpy) const
|
||||||
|
{
|
||||||
|
return cpy.src_w == cpy.dst_w && cpy.src_h == cpy.dst_h;
|
||||||
}
|
}
|
||||||
|
|
||||||
void simplify()
|
void simplify()
|
||||||
|
@ -256,12 +260,21 @@ namespace rsx
|
||||||
// Optimizations in the straightforward methods copy_image_static and copy_image_dynamic make them preferred over the atlas method
|
// Optimizations in the straightforward methods copy_image_static and copy_image_dynamic make them preferred over the atlas method
|
||||||
if (sections.size() == 1 && section_fills_target(sections[0]))
|
if (sections.size() == 1 && section_fills_target(sections[0]))
|
||||||
{
|
{
|
||||||
// Change the command to copy_image_static
|
|
||||||
const auto cpy = sections[0];
|
const auto cpy = sections[0];
|
||||||
external_subresource_desc.external_handle = cpy.src;
|
if (section_is_transfer_only(cpy))
|
||||||
external_subresource_desc.x = cpy.src_x;
|
{
|
||||||
external_subresource_desc.y = cpy.src_y;
|
// Change the command to copy_image_static
|
||||||
external_subresource_desc.op = deferred_request_command::copy_image_static;
|
external_subresource_desc.external_handle = cpy.src;
|
||||||
|
external_subresource_desc.x = cpy.src_x;
|
||||||
|
external_subresource_desc.y = cpy.src_y;
|
||||||
|
external_subresource_desc.op = deferred_request_command::copy_image_static;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Blit op is a semantic variant of the copy and atlas ops.
|
||||||
|
// We can simply reuse the atlas handler for this for now, but this allows simplification.
|
||||||
|
external_subresource_desc.op = deferred_request_command::blit_image_static;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1693,6 +1706,7 @@ namespace rsx
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case deferred_request_command::atlas_gather:
|
case deferred_request_command::atlas_gather:
|
||||||
|
case deferred_request_command::blit_image_static:
|
||||||
{
|
{
|
||||||
result = generate_atlas_from_images(cmd, desc.gcm_format, desc.width, desc.height, desc.sections_to_copy, desc.remap);
|
result = generate_atlas_from_images(cmd, desc.gcm_format, desc.width, desc.height, desc.sections_to_copy, desc.remap);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -43,7 +43,8 @@ namespace rsx
|
||||||
atlas_gather, // Provided list of sections generates a texture atlas
|
atlas_gather, // Provided list of sections generates a texture atlas
|
||||||
_3d_gather, // Provided list of sections generates a 3D array
|
_3d_gather, // Provided list of sections generates a 3D array
|
||||||
_3d_unwrap, // One large texture provided to be partitioned into a 3D array
|
_3d_unwrap, // One large texture provided to be partitioned into a 3D array
|
||||||
mipmap_gather // Provided list of sections to be reassembled as mipmap levels of the same texture
|
mipmap_gather, // Provided list of sections to be reassembled as mipmap levels of the same texture
|
||||||
|
blit_image_static, // Variant of the copy command that does scaling instead of copying
|
||||||
};
|
};
|
||||||
|
|
||||||
struct image_section_attributes_t
|
struct image_section_attributes_t
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue