diff options
author | Jason Ekstrand <[email protected]> | 2017-04-07 10:33:25 -0700 |
---|---|---|
committer | Andres Gomez <[email protected]> | 2017-04-26 00:10:04 +0300 |
commit | af58e0dbe6daa9f5de20f0d2fdd3c776ffebc704 (patch) | |
tree | 5ca26854bf03b47409823271d58dd0628eca9564 | |
parent | 9717c0aad5e18078a5ad827494f9a2a62162dfe1 (diff) |
anv/cmd_buffer: Use the null surface state for ATTACHMENT_UNUSED
Reviewed-by: Nanley Chery <[email protected]>
Cc: <[email protected]>
(cherry picked from commit 21d2ca72d88e00ddf37c7e1030472e184a038195)
[Andres Gomez: the anv_subpass structure was not storing yet VkAttachmentReference]
Signed-off-by: Andres Gomez <[email protected]>
Conflicts:
src/intel/vulkan/genX_cmd_buffer.c
-rw-r--r-- | src/intel/vulkan/genX_cmd_buffer.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c index 943e223f51d..b08ab5b8731 100644 --- a/src/intel/vulkan/genX_cmd_buffer.c +++ b/src/intel/vulkan/genX_cmd_buffer.c @@ -1153,7 +1153,18 @@ emit_binding_table(struct anv_cmd_buffer *cmd_buffer, assert(binding->binding == 0); if (binding->index < subpass->color_count) { const unsigned att = subpass->color_attachments[binding->index]; - surface_state = cmd_buffer->state.attachments[att].color_rt_state; + + /* From the Vulkan 1.0.46 spec: + * + * "If any color or depth/stencil attachments are + * VK_ATTACHMENT_UNUSED, then no writes occur for those + * attachments." + */ + if (att == VK_ATTACHMENT_UNUSED) { + surface_state = cmd_buffer->state.null_surface_state; + } else { + surface_state = cmd_buffer->state.attachments[att].color_rt_state; + } } else { surface_state = cmd_buffer->state.null_surface_state; } |