diff options
author | Bas Nieuwenhuizen <[email protected]> | 2017-07-23 21:59:01 +0200 |
---|---|---|
committer | Bas Nieuwenhuizen <[email protected]> | 2017-07-24 01:50:52 +0200 |
commit | ea08a296fe226f5e67366b4db420c2322f38774c (patch) | |
tree | a52007d0342ab27b86a54b565be7dd545b36a363 /src/amd/vulkan/radv_pipeline.c | |
parent | bfe8134472f90a1790ca37ed2aaad420efe5dff5 (diff) |
radv: Handle VK_ATTACHMENT_UNUSED in color attachments.
This just sets them to INVALID COLOR, instead of shifting the
attachments together.
This also fixes a number of cases where we use it first and only
then check if it is VK_ATTACHMENT_UNUSED.
Signed-off-by: Bas Nieuwenhuizen <[email protected]>
Fixes: f4e499ec791 "radv: add initial non-conformant radv vulkan driver"
Reviewed-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/amd/vulkan/radv_pipeline.c')
-rw-r--r-- | src/amd/vulkan/radv_pipeline.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c index c920cc35be1..84494647c02 100644 --- a/src/amd/vulkan/radv_pipeline.c +++ b/src/amd/vulkan/radv_pipeline.c @@ -1035,14 +1035,17 @@ radv_pipeline_compute_spi_color_formats(struct radv_pipeline *pipeline, unsigned col_format = 0; for (unsigned i = 0; i < (single_cb_enable ? 1 : subpass->color_count); ++i) { - struct radv_render_pass_attachment *attachment; unsigned cf; - attachment = pass->attachments + subpass->color_attachments[i].attachment; + if (subpass->color_attachments[i].attachment == VK_ATTACHMENT_UNUSED) { + cf = V_028714_SPI_SHADER_ZERO; + } else { + struct radv_render_pass_attachment *attachment = pass->attachments + subpass->color_attachments[i].attachment; - cf = si_choose_spi_color_format(attachment->format, - blend_enable & (1 << i), - blend_need_alpha & (1 << i)); + cf = si_choose_spi_color_format(attachment->format, + blend_enable & (1 << i), + blend_need_alpha & (1 << i)); + } col_format |= cf << (4 * i); } @@ -1082,6 +1085,9 @@ radv_pipeline_compute_is_int8(const VkGraphicsPipelineCreateInfo *pCreateInfo) for (unsigned i = 0; i < subpass->color_count; ++i) { struct radv_render_pass_attachment *attachment; + if (subpass->color_attachments[i].attachment == VK_ATTACHMENT_UNUSED) + continue; + attachment = pass->attachments + subpass->color_attachments[i].attachment; if (format_is_int8(attachment->format)) |