Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vulkan: Record modifications for barriers after changing the framebuffer #4775

Merged
merged 1 commit into from
May 3, 2023

Commits on May 2, 2023

  1. Vulkan: Record modifications after changing the framebuffer

    Our Vulkan backend inserts image barriers when a texture is sampled after it is rendered. This is done via a "modification flag" which is set when a render target is unbound (presuming that a texture has finished drawing to it).
    
    Imagine the following scenario:
    - Game sets render target to texture A
    - Game renders to texture A
    - (render pass ends)
    - Game binds texture A to a sampler
    - Game sets render target to texture B
    - Renders to texture B using texture A (barrier required)
    
    Because of the previous behaviour, the check to add a barrier for sampling a texture actually happens before it is registered as modified, meaning no barrier was added at all. This isn't always the case, but it was definitely causing issues in Xenoblade 2.
    
    This doesn't fix any more complicated issues where a texture is repeatedly sampled while it is currently being rendered.
    
    Fixes visual glitches at lower resolutions in Xenoblade 2. May fix other cases.
    riperiperi committed May 2, 2023
    Configuration menu
    Copy the full SHA
    d5bc10b View commit details
    Browse the repository at this point in the history