rsx: Force compatibility checks when applying fast-path optimizations

This commit is contained in:
kd-11 2023-07-02 04:16:59 +03:00 committed by kd-11
parent a37f786a37
commit 4decad6f6b
3 changed files with 22 additions and 5 deletions

View File

@ -168,6 +168,22 @@ namespace rsx
{
return static_cast<viewable_image_type>(external_handle);
}
image_resource_type src0() const
{
if (external_handle)
{
return external_handle;
}
if (!sections_to_copy.empty())
{
return sections_to_copy[0].src;
}
// Return typed null
return external_handle;
}
};
struct sampled_image_descriptor : public sampled_image_descriptor_base
@ -1988,8 +2004,9 @@ namespace rsx
(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)
if (is_simple_subresource_copy &&
attr.edge_clamped &&
render_target_format_is_compatible(result.external_subresource_desc.src0(), attr.gcm_format))
{
if (result.external_subresource_desc.op != deferred_request_command::blit_image_static) [[ likely ]]
{

View File

@ -765,8 +765,8 @@ namespace gl
switch (gcm_format)
{
default:
//TODO
// warn_once("Format incompatibility detected, reporting failure to force data copy (GL_INTERNAL_FORMAT=0x%X, GCM_FORMAT=0x%X)", static_cast<u32>(ifmt), gcm_format);
// TODO
err_once("Format incompatibility detected, reporting failure to force data copy (GL_INTERNAL_FORMAT=0x%X, GCM_FORMAT=0x%X)", static_cast<u32>(ifmt), gcm_format);
return false;
case CELL_GCM_TEXTURE_W16_Z16_Y16_X16_FLOAT:
return (ifmt == gl::texture::internal_format::rgba16f);

View File

@ -1112,7 +1112,7 @@ namespace vk
{
default:
//TODO
// warn_once("Format incompatibility detected, reporting failure to force data copy (VK_FORMAT=0x%X, GCM_FORMAT=0x%X)", static_cast<u32>(vk_format), gcm_format);
err_once("Format incompatibility detected, reporting failure to force data copy (VK_FORMAT=0x%X, GCM_FORMAT=0x%X)", static_cast<u32>(vk_format), gcm_format);
return false;
#ifndef __APPLE__
case CELL_GCM_TEXTURE_R5G6B5: