diff options
author | Chad Versace <[email protected]> | 2015-11-03 14:55:58 -0800 |
---|---|---|
committer | Chad Versace <[email protected]> | 2015-11-04 15:20:52 -0800 |
commit | a9a3071fc4638f5f86ba846dd114e3383bf1bc17 (patch) | |
tree | 4ac78500829c6d26fac65a8c869a35abb6c45b6e /src/vulkan/anv_meta.c | |
parent | 49c96a14c512b7b56d19c47d384ddcc67941633e (diff) |
anv/meta: Rewrite clear code
Fixes Crucible test "func.clear.load-clear.attachments-8".
The old clear code, when clearing attachments for
VK_ATTACHMENT_LOAD_OP_CLEAR, suffered from some fundamental bugs. The
bugs were not fixable with the old code's approach.
- It assumed that a VkRenderPass contained at most one depthstencil
attachment.
- It tried to clear all attachments (color and the sole
depthstencil) with a single instanced draw call, using the VUE
header's RenderTargetArrayIndex to specify the instance's target
color attachment. But the RenderTargetArrayIndex does not select
entries in the binding table; it only selects an array index of
a singled layered surface.
- If at least one attachment of VkRenderPass had
VK_ATTACHMENT_LOAD_OP_CLEAR,
then the old code cleared *all* attachments. This was
a consequence of using a single draw call and single pipeline for
the clear.
The new clear code fixes those bugs by making a separate draw call for
each attachment, and using one pipeline when clearing color attachments
and a different pipeline for depth attachments.
The new code, like the old code, does not clear stencil attachments. It
is left as a FINISHME.
Diffstat (limited to 'src/vulkan/anv_meta.c')
-rw-r--r-- | src/vulkan/anv_meta.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/vulkan/anv_meta.c b/src/vulkan/anv_meta.c index ba03dff9d3a..0f670393112 100644 --- a/src/vulkan/anv_meta.c +++ b/src/vulkan/anv_meta.c @@ -1303,9 +1303,7 @@ anv_device_init_meta(struct anv_device *device) void anv_device_finish_meta(struct anv_device *device) { - /* Clear */ - anv_DestroyPipeline(anv_device_to_handle(device), - device->meta_state.clear.pipeline); + anv_device_finish_meta_clear_state(device); /* Blit */ anv_DestroyRenderPass(anv_device_to_handle(device), |