diff --git a/.pick_status.json b/.pick_status.json index c23f5aa2cdb..00a96fef97d 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -3298,7 +3298,7 @@ "description": "pan/bi: Fix empty shader handling", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "master_sha": null, "because_sha": "bfcdc8f1747eabad57449a309be7160dd27605ac" }, diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c index f4ad2950039..d8be3efb954 100644 --- a/src/panfrost/bifrost/bifrost_compile.c +++ b/src/panfrost/bifrost/bifrost_compile.c @@ -2267,9 +2267,13 @@ bifrost_compile_shader_nir(void *mem_ctx, nir_shader *nir, bifrost_debug & BIFROST_DBG_VERBOSE); } - /* Pad the shader with enough zero bytes to trick the prefetcher */ - memset(util_dynarray_grow(&program->compiled, uint8_t, BIFROST_SHADER_PREFETCH), - 0, BIFROST_SHADER_PREFETCH); + /* Pad the shader with enough zero bytes to trick the prefetcher, + * unless we're compiling an empty shader (in which case we don't pad + * so the size remains 0) */ + if (program->compiled.size) { + memset(util_dynarray_grow(&program->compiled, uint8_t, BIFROST_SHADER_PREFETCH), + 0, BIFROST_SHADER_PREFETCH); + } program->tls_size = ctx->tls_size;