panfrost: Handle empty shaders

I didn't realize this was in spec, but it fixes a crash in shaderdb.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3125>
This commit is contained in:
Alyssa Rosenzweig 2019-12-16 16:45:28 -05:00 committed by Marge Bot
parent 35418f6770
commit bf5d8cfd28
1 changed files with 8 additions and 3 deletions

View File

@ -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);