Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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.

@attackgoat attackgoat linked an issue Nov 30, 2024 that may be closed by this pull request
@attackgoat attackgoat merged commit d1d8bff into master Dec 20, 2024
2 of 3 checks passed
@attackgoat attackgoat deleted the 82-depth-buffer-barriers branch December 20, 2024 23:24
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.

2 participants