1 |
From c4f8fb17497189d730794eb1070129ba3749fefc Mon Sep 17 00:00:00 2001 |
2 |
From: Jason Ekstrand <jason.ekstrand@intel.com> |
3 |
Date: Tue, 12 Mar 2019 22:55:14 -0500 |
4 |
Subject: [PATCH 08/24] anv/pass: Flag the need for a RT flush for resolve |
5 |
attachments |
6 |
|
7 |
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com> |
8 |
Cc: mesa-stable@lists.freedesktop.org |
9 |
(cherry picked from commit 489bf2de237a190b966a412efda89d12d1daacde) |
10 |
--- |
11 |
src/intel/vulkan/anv_pass.c | 18 +++++++++++++++++- |
12 |
1 file changed, 17 insertions(+), 1 deletion(-) |
13 |
|
14 |
diff --git a/src/intel/vulkan/anv_pass.c b/src/intel/vulkan/anv_pass.c |
15 |
index 02f2be60e02..a1c72395831 100644 |
16 |
--- a/src/intel/vulkan/anv_pass.c |
17 |
+++ b/src/intel/vulkan/anv_pass.c |
18 |
@@ -178,12 +178,28 @@ anv_render_pass_compile(struct anv_render_pass *pass) |
19 |
* subpasses and checking to see if any of them don't have an external |
20 |
* dependency. Or, we could just be lazy and add a couple extra flushes. |
21 |
* We choose to be lazy. |
22 |
+ * |
23 |
+ * From the documentation for vkCmdNextSubpass: |
24 |
+ * |
25 |
+ * "Moving to the next subpass automatically performs any multisample |
26 |
+ * resolve operations in the subpass being ended. End-of-subpass |
27 |
+ * multisample resolves are treated as color attachment writes for the |
28 |
+ * purposes of synchronization. This applies to resolve operations for |
29 |
+ * both color and depth/stencil attachments. That is, they are |
30 |
+ * considered to execute in the |
31 |
+ * VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT pipeline stage and |
32 |
+ * their writes are synchronized with |
33 |
+ * VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT." |
34 |
+ * |
35 |
+ * Therefore, the above flags concerning color attachments also apply to |
36 |
+ * color and depth/stencil resolve attachments. |
37 |
*/ |
38 |
if (all_usage & VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT) { |
39 |
pass->subpass_flushes[0] |= |
40 |
ANV_PIPE_TEXTURE_CACHE_INVALIDATE_BIT; |
41 |
} |
42 |
- if (all_usage & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT) { |
43 |
+ if (all_usage & (VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | |
44 |
+ VK_IMAGE_USAGE_TRANSFER_DST_BIT)) { |
45 |
pass->subpass_flushes[pass->subpass_count] |= |
46 |
ANV_PIPE_RENDER_TARGET_CACHE_FLUSH_BIT; |
47 |
} |
48 |
-- |
49 |
2.21.0 |
50 |
|