From bf5d8cfd282396f0ab02bfdcfe1af2be49f35fa2 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Mon, 16 Dec 2019 16:45:28 -0500 Subject: [PATCH] panfrost: Handle empty shaders I didn't realize this was in spec, but it fixes a crash in shaderdb. Signed-off-by: Alyssa Rosenzweig Reviewed-by: Tomeu Vizoso Part-of: --- src/gallium/drivers/panfrost/pan_assemble.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/panfrost/pan_assemble.c b/src/gallium/drivers/panfrost/pan_assemble.c index 87127ba945b..54c5ba79700 100644 --- a/src/gallium/drivers/panfrost/pan_assemble.c +++ b/src/gallium/drivers/panfrost/pan_assemble.c @@ -77,9 +77,14 @@ panfrost_shader_compile( * I bet someone just thought that would be a cute pun. At least, * that's how I'd do it. */ - state->bo = panfrost_bo_create(screen, size, PAN_BO_EXECUTE); - memcpy(state->bo->cpu, dst, size); - meta->shader = state->bo->gpu | program.first_tag; + if (size) { + state->bo = panfrost_bo_create(screen, size, PAN_BO_EXECUTE); + memcpy(state->bo->cpu, dst, size); + meta->shader = state->bo->gpu | program.first_tag; + } else { + /* no shader */ + meta->shader = 0x0; + } util_dynarray_fini(&program.compiled); -- 2.30.2