Browse Source
[video_core] Avoid false feedback loop barriers for render targets (#3338)
Ignore views that are render targets when checking feedback loops. Fixes flickering caused by false barriers.
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3338
Reviewed-by: Lizzie <lizzie@eden-emu.dev>
Co-authored-by: MaranBr <maranbr@outlook.com>
Co-committed-by: MaranBr <maranbr@outlook.com>
pull/3341/head
MaranBr
3 weeks ago
committed by
crueter
No known key found for this signature in database
GPG Key ID: 425ACD2D4830EBC6
1 changed files with
27 additions and
7 deletions
-
src/video_core/texture_cache/texture_cache.h
|
|
@ -288,21 +288,41 @@ void TextureCache<P>::CheckFeedbackLoop(std::span<const ImageViewInOut> views) { |
|
|
if (!view.id) { |
|
|
if (!view.id) { |
|
|
continue; |
|
|
continue; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
bool is_render_target = false; |
|
|
|
|
|
|
|
|
|
|
|
for (const auto& ct_view_id : render_targets.color_buffer_ids) { |
|
|
|
|
|
if (ct_view_id && ct_view_id == view.id) { |
|
|
|
|
|
is_render_target = true; |
|
|
|
|
|
break; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (!is_render_target && render_targets.depth_buffer_id == view.id) { |
|
|
|
|
|
is_render_target = true; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (is_render_target) { |
|
|
|
|
|
continue; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
auto& image_view = slot_image_views[view.id]; |
|
|
auto& image_view = slot_image_views[view.id]; |
|
|
|
|
|
|
|
|
// Check color targets |
|
|
|
|
|
for (const auto& ct_view_id : render_targets.color_buffer_ids) { |
|
|
for (const auto& ct_view_id : render_targets.color_buffer_ids) { |
|
|
if (ct_view_id) { |
|
|
|
|
|
|
|
|
if (!ct_view_id) { |
|
|
|
|
|
continue; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
auto& ct_view = slot_image_views[ct_view_id]; |
|
|
auto& ct_view = slot_image_views[ct_view_id]; |
|
|
|
|
|
|
|
|
if (image_view.image_id == ct_view.image_id) { |
|
|
if (image_view.image_id == ct_view.image_id) { |
|
|
return true; |
|
|
return true; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Check zeta target |
|
|
|
|
|
if (render_targets.depth_buffer_id) { |
|
|
if (render_targets.depth_buffer_id) { |
|
|
auto& zt_view = slot_image_views[render_targets.depth_buffer_id]; |
|
|
auto& zt_view = slot_image_views[render_targets.depth_buffer_id]; |
|
|
|
|
|
|
|
|
if (image_view.image_id == zt_view.image_id) { |
|
|
if (image_view.image_id == zt_view.image_id) { |
|
|
return true; |
|
|
return true; |
|
|
} |
|
|
} |
|
|
|