gl: Workaround for depth/color format mismatch when using hardware blit

This commit is contained in:
kd-11 2017-08-01 23:37:55 +03:00
parent b2b5f564a1
commit c0409a819e
2 changed files with 7 additions and 3 deletions

View file

@ -382,7 +382,7 @@ private:
}
public:
surface_subresource get_surface_subresource_if_applicable(u32 texaddr, u16 requested_width, u16 requested_height, u16 requested_pitch, bool scale_to_fit =false, bool crop=false)
surface_subresource get_surface_subresource_if_applicable(u32 texaddr, u16 requested_width, u16 requested_height, u16 requested_pitch, bool scale_to_fit=false, bool crop=false, bool ignore_depth_formats=false)
{
gl::render_target *surface = nullptr;
u16 x_offset = 0;
@ -427,6 +427,9 @@ public:
}
}
if (ignore_depth_formats)
return{};
//Check depth surfaces for overlap
for (auto &tex_info : m_depth_stencil_storage)
{

View file

@ -1068,7 +1068,7 @@ namespace gl
const u32 dst_address = (u32)((u64)dst.pixels - (u64)vm::base(0));
//Check if src/dst are parts of render targets
surface_subresource dst_subres = m_rtts.get_surface_subresource_if_applicable(dst_address, dst.width, dst.clip_height, dst.pitch, true, true);
surface_subresource dst_subres = m_rtts.get_surface_subresource_if_applicable(dst_address, dst.width, dst.clip_height, dst.pitch, true, true, true);
dst_is_render_target = dst_subres.surface != nullptr;
u16 max_dst_width = dst.width;
@ -1173,7 +1173,8 @@ namespace gl
}
}
surface_subresource src_subres = m_rtts.get_surface_subresource_if_applicable(src_address, src.width, src.height, src.pitch, true, true);
//TODO: Handle cases where src or dst can be a depth texture while the other is a color texture - requires a render pass to emulate
surface_subresource src_subres = m_rtts.get_surface_subresource_if_applicable(src_address, src.width, src.height, src.pitch, true, true, true);
src_is_render_target = src_subres.surface != nullptr;
//Create source texture if does not exist