panfrost: Skip blit shader labelling if the buffer has no space

Fixes stack corruption in dEQP-GLES31.functional.draw_buffers_indexed.
random.max_implementation_draw_buffers.10

Fixes: 8ba2f9f698 ("panfrost: Create a blitter library to replace the existing preload helpers")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10792>
This commit is contained in:
Icecream95 2021-05-14 09:11:00 +12:00 committed by Marge Bot
parent 938e52a6e8
commit 4da88060d0

View file

@ -468,6 +468,14 @@ pan_blitter_get_blit_shader(struct panfrost_device *dev,
default: unreachable("Invalid dim\n");
}
coord_comps = MAX2(coord_comps,
(key->surfaces[i].dim ? : 3) +
(key->surfaces[i].array ? 1 : 0));
first = false;
if (sig_offset >= sizeof(sig))
continue;
sig_offset += snprintf(sig + sig_offset, sizeof(sig) - sig_offset,
"%s[%s;%s;%s%s;src_samples=%d,dst_samples=%d]",
first ? "" : ",",
@ -476,10 +484,6 @@ pan_blitter_get_blit_shader(struct panfrost_device *dev,
key->surfaces[i].array ? "[]" : "",
key->surfaces[i].src_samples,
key->surfaces[i].dst_samples);
first = false;
coord_comps = MAX2(coord_comps,
(key->surfaces[i].dim ? : 3) +
(key->surfaces[i].array ? 1 : 0));
}
nir_builder b =