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 <basni@google.com>
Fixes: f4e499ec79 "radv: add initial non-conformant radv vulkan driver"
Reviewed-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
Bas Nieuwenhuizen
2017-07-23 21:59:01 +02:00
parent bfe8134472
commit ea08a296fe
6 changed files with 45 additions and 20 deletions

View File

@@ -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))