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

Fix for incorrect framebuffer attachment handling #89

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

attackgoat
Copy link
Owner

Framebuffer attachments should always be matched with the same image:

RenderGraph::new()
    .begin_pass("My Graphic Pass")
    .bind_pipeline(&my_graphic_pipeline)
    .clear_color(0, swapchain_image)
    .store_color(0, swapchain_image)

And in the case of merged render passes they will always having matching formats and sample counts because Attachment::are_identical() checks that they are in fact the same image.

With this logic it is safe to set the format, sample count, and initial layout on framebuffer load operations and then also set the format and sample count in addition to final layout on store operations. In cases where the user does not specify a load or store operation we can infer the format. This fixes the issue of depth images having the wrong layout due to it being set based on the load operation but ignoring the store.

In cases where the user simply attaches images (the DONT_CARE ops) there is no change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Depth buffer missing or incorrect barriers in some cases.
1 participant