From: Alyssa Rosenzweig Date: Mon, 16 Dec 2019 21:45:28 +0000 (-0500) Subject: panfrost: Handle empty shaders X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bf5d8cfd282396f0ab02bfdcfe1af2be49f35fa2;p=mesa.git 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: --- 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);