panfrost: add some sanity checks for nr_samples

Make sure that depth and color buffers have the same number of
samples. This *should* be guaranteed by the higher levels, but
in the case of a bug we want to notice quickly (and in fact
such a bug has bitten us, see panfrost/mesa/issue#200).

Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36876>
This commit is contained in:
Eric R. Smith
2025-08-19 16:41:35 -03:00
committed by Marge Bot
parent a9066c801b
commit 37681eef8a
+6 -3
View File
@@ -1020,13 +1020,16 @@ check_fb_attachments(const struct pan_fb_info *fb)
{
#ifndef NDEBUG
for (unsigned i = 0; i < fb->rt_count; i++) {
if (fb->rts[i].view)
if (fb->rts[i].view) {
pan_image_view_check(fb->rts[i].view);
assert(fb->rts[i].view->nr_samples == fb->nr_samples);
}
}
if (fb->zs.view.zs)
if (fb->zs.view.zs) {
pan_image_view_check(fb->zs.view.zs);
assert(fb->zs.view.zs->nr_samples == fb->nr_samples);
}
if (fb->zs.view.s)
pan_image_view_check(fb->zs.view.s);
#endif