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:
@@ -468,6 +468,14 @@ pan_blitter_get_blit_shader(struct panfrost_device *dev,
|
|||||||
default: unreachable("Invalid dim\n");
|
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,
|
sig_offset += snprintf(sig + sig_offset, sizeof(sig) - sig_offset,
|
||||||
"%s[%s;%s;%s%s;src_samples=%d,dst_samples=%d]",
|
"%s[%s;%s;%s%s;src_samples=%d,dst_samples=%d]",
|
||||||
first ? "" : ",",
|
first ? "" : ",",
|
||||||
@@ -476,10 +484,6 @@ pan_blitter_get_blit_shader(struct panfrost_device *dev,
|
|||||||
key->surfaces[i].array ? "[]" : "",
|
key->surfaces[i].array ? "[]" : "",
|
||||||
key->surfaces[i].src_samples,
|
key->surfaces[i].src_samples,
|
||||||
key->surfaces[i].dst_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 =
|
nir_builder b =
|
||||||
|
|||||||
Reference in New Issue
Block a user