Files
angle/include/platform
Shahbaz Youssefi 20e7bbb7ab Vulkan: Fix invalidate of attachments with emulated format
Some image formats may be emulated such that the emulated format has
more channels than the original.  ANGLE clears the image once so that
these extra channels contain valid values, and carefully ensures they
are never modified.

For swapchain images with such formats, as they are automatically
invalidated at the end of the frame, a workaroud was added to make sure
they are re-cleared in the beginning of the next frame.  This however
doesn't fix the issue of glInvalidateFramebuffer resulting in the
contents of attachments with such formats to be discarded (even if the
following render pass clears it, the contents are invalid in between).

This change instead makes sure invalidate of images with emulated
formats that have extra channels are handled appropriately:

- On IMR hardware, the invalidate is dropped altogether as it provides
  little to no benefit.
- On TBR hardware, a clear is automatically staged on the invalidated
  image.

The latter replaces the workaround that was added to make the following
render pass use loadOp=CLEAR, by adding a clear that's respected
regardless of what the future usage is.

This change also paves the way for a future change where the invalidate
of color attachments is tracked in render passes similarly to how
depth/stencil currently is.  With this change, the image is no longer in
an inconsistent state where its contents are considered invalid, even
though some channels are meant to remain valid.

Bug: angleproject:6860
Change-Id: Iec5b4854dfbe3a0bf93cd5aa82c19fe116065744
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3536389
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Charlie Lao <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
2022-03-22 19:28:14 +00:00
..