summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConnor Abbott <cwabbott0@gmail.com>2020-02-07 13:43:48 +0100
committerJonathan Marek <jonathan@marek.ca>2020-02-12 21:31:57 -0500
commitab3db20cb5e8ef489b8331235498cd1806e4c6ea (patch)
treedc7eb47ad9d165f2a10347f5cbf1a1a209ed99ee
parenta5fb515301251b476800a1560f9f8edc8ff325d6 (diff)
tu: Support multisample image clears
We may need shader workarounds for some formats, but for now this seems to work at least as well as the gmem path for clearing multisample attachments. And soon we'll start calling this even on the gmem path, since we leave the final decision of whether to use sysmem or not up till the end, so we can't have it assert or otherwise working tests would assert. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3713>
-rw-r--r--src/freedreno/vulkan/tu_blit.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/freedreno/vulkan/tu_blit.c b/src/freedreno/vulkan/tu_blit.c
index 302a8d4f3f2..9baca8e582f 100644
--- a/src/freedreno/vulkan/tu_blit.c
+++ b/src/freedreno/vulkan/tu_blit.c
@@ -268,7 +268,12 @@ void tu_blit(struct tu_cmd_buffer *cmdbuf, struct tu_cs *cs,
/* unsupported format cleared as UINT32 */
if (blt->dst.fmt == VK_FORMAT_E5B9G9R9_UFLOAT_PACK32)
blt->dst.fmt = VK_FORMAT_R32_UINT;
- assert(blt->dst.samples == 1); /* TODO */
+ /* TODO: multisample image clearing also seems not to work with certain
+ * formats. The blob uses a shader-based clear in these cases.
+ */
+ blt->dst.x *= blt->dst.samples;
+ blt->dst.width *= blt->dst.samples;
+ blt->dst.samples = 1;
blt->src = blt->dst;
break;
default: