diff options
author | Alyssa Rosenzweig <[email protected]> | 2019-12-16 16:45:28 -0500 |
---|---|---|
committer | Marge Bot <[email protected]> | 2019-12-17 17:42:57 +0000 |
commit | bf5d8cfd282396f0ab02bfdcfe1af2be49f35fa2 (patch) | |
tree | 2a4cbf0934cb3d4cab03c0225d0973d1ae55b363 | |
parent | 35418f677051b75a9d8b37bafc806303bc3b44ad (diff) |
panfrost: Handle empty shaders
I didn't realize this was in spec, but it fixes a crash in shaderdb.
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Reviewed-by: Tomeu Vizoso <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3125>
-rw-r--r-- | src/gallium/drivers/panfrost/pan_assemble.c | 11 |
1 files 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); |