From 9753dec07dcdb56be5a4bf97b37b40861033a2b3 Mon Sep 17 00:00:00 2001 From: Charlie Date: Mon, 14 Jun 2021 22:54:26 +0100 Subject: [PATCH] v3dv: remove sRGB blending workaround This reverts commits 4c15131b1d36874b643aed8407933ccd8675841d and 1cf36797bf9d63b33c405d85ce720dcd5e75a47c. Reviewed-by: Iago Toral Quiroga Part-of: --- src/broadcom/vulkan/v3dv_cmd_buffer.c | 24 ++---------------------- src/broadcom/vulkan/v3dv_pass.c | 9 +-------- src/broadcom/vulkan/v3dv_private.h | 2 -- 3 files changed, 3 insertions(+), 32 deletions(-) diff --git a/src/broadcom/vulkan/v3dv_cmd_buffer.c b/src/broadcom/vulkan/v3dv_cmd_buffer.c index 12c855e5743..f30d1458fb5 100644 --- a/src/broadcom/vulkan/v3dv_cmd_buffer.c +++ b/src/broadcom/vulkan/v3dv_cmd_buffer.c @@ -4354,9 +4354,8 @@ emit_index_buffer(struct v3dv_cmd_buffer *cmd_buffer) static void cmd_buffer_emit_pre_draw(struct v3dv_cmd_buffer *cmd_buffer) { - struct v3dv_pipeline *pipeline = cmd_buffer->state.gfx.pipeline; - assert(pipeline); - assert(!(pipeline->active_stages & VK_SHADER_STAGE_COMPUTE_BIT)); + assert(cmd_buffer->state.gfx.pipeline); + assert(!(cmd_buffer->state.gfx.pipeline->active_stages & VK_SHADER_STAGE_COMPUTE_BIT)); /* If we emitted a pipeline barrier right before this draw we won't have * an active job. In that case, create a new job continuing the current @@ -4370,25 +4369,6 @@ cmd_buffer_emit_pre_draw(struct v3dv_cmd_buffer *cmd_buffer) /* Restart single sample job for MSAA pipeline if needed */ cmd_buffer_restart_job_for_msaa_if_needed(cmd_buffer); - /* Enable always flush if we are blending to sRGB render targets. This - * fixes test failures in: - * dEQP-VK.pipeline.blend.format.r8g8b8a8_srgb.* - * - * FIXME: not sure why we need this. The tile buffer is always linear, with - * conversion from/to sRGB happening on tile load/store operations. This - * means that when we enable flushing the only difference is that we convert - * to sRGB on the store after each draw call and we convert from sRGB on the - * load before each draw call, but the blend happens in linear format in the - * tile buffer anyway, which is the same scenario as if we didn't flush. - */ - assert(pipeline->subpass); - assert(cmd_buffer->state.job); - if (pipeline->subpass->has_srgb_rt && pipeline->blend.enables) { - cmd_buffer->state.job->always_flush = true; - perf_debug("flushing draw calls for subpass %d because bound pipeline " - "uses sRGB blending\n", cmd_buffer->state.subpass_idx); - } - /* If the job is configured to flush on every draw call we need to create * a new job now. */ diff --git a/src/broadcom/vulkan/v3dv_pass.c b/src/broadcom/vulkan/v3dv_pass.c index e734580f183..918f5083338 100644 --- a/src/broadcom/vulkan/v3dv_pass.c +++ b/src/broadcom/vulkan/v3dv_pass.c @@ -22,7 +22,6 @@ */ #include "v3dv_private.h" -#include "vk_format_info.h" static uint32_t num_subpass_attachments(const VkSubpassDescription *desc) @@ -175,16 +174,10 @@ v3dv_CreateRenderPass(VkDevice _device, p += desc->colorAttachmentCount; for (uint32_t j = 0; j < desc->colorAttachmentCount; j++) { - const uint32_t attachment_idx = - desc->pColorAttachments[j].attachment; subpass->color_attachments[j] = (struct v3dv_subpass_attachment) { - .attachment = attachment_idx, + .attachment = desc->pColorAttachments[j].attachment, .layout = desc->pColorAttachments[j].layout, }; - if (attachment_idx != VK_ATTACHMENT_UNUSED) { - VkFormat format = pass->attachments[attachment_idx].desc.format; - subpass->has_srgb_rt |= vk_format_is_srgb(format); - } } } diff --git a/src/broadcom/vulkan/v3dv_private.h b/src/broadcom/vulkan/v3dv_private.h index 2efe9c6701f..d49b8636954 100644 --- a/src/broadcom/vulkan/v3dv_private.h +++ b/src/broadcom/vulkan/v3dv_private.h @@ -585,8 +585,6 @@ struct v3dv_subpass { struct v3dv_subpass_attachment ds_attachment; - bool has_srgb_rt; - /* If we need to emit the clear of the depth/stencil attachment using a * a draw call instead of using the TLB (GFXH-1461). */