From ac783acd747523af0be06f6fd36d4e809574f5b8 Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Sun, 8 Aug 2021 12:23:43 -0700 Subject: [PATCH] freedreno: Handle PIPE_FORMAT_NONE buffers Clover creates buffers with format=NONE.. which is not technically incorrect. Just treat this as r8_unorm so we know width0 is the size in bytes. Signed-off-by: Rob Clark Part-of: --- src/gallium/drivers/freedreno/freedreno_resource.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gallium/drivers/freedreno/freedreno_resource.c b/src/gallium/drivers/freedreno/freedreno_resource.c index cc4d15f5d60..b701d96ecec 100644 --- a/src/gallium/drivers/freedreno/freedreno_resource.c +++ b/src/gallium/drivers/freedreno/freedreno_resource.c @@ -1224,6 +1224,10 @@ fd_resource_allocate_and_resolve(struct pipe_screen *pscreen, prsc = &rsc->b.b; + /* Clover creates buffers with PIPE_FORMAT_NONE: */ + if ((prsc->target == PIPE_BUFFER) && (format == PIPE_FORMAT_NONE)) + format = prsc->format = PIPE_FORMAT_R8_UNORM; + DBG("%" PRSC_FMT, PRSC_ARGS(prsc)); if (tmpl->bind & PIPE_BIND_SHARED)