gallium: handle empty cbuf slots in framebuffer samples helper

If we have cbufs but they are all empty, default
to returning the fb->samples.

Fixes:
dEQP-VK.pipeline.multisample.mixed_count.1_4_unused
on lavapipe

v2:
drop unneeded chunk (Roland)

Cc: 20.3 <mesa-stable>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7499>
This commit is contained in:
Dave Airlie 2020-11-05 05:42:34 +10:00 committed by Marge Bot
parent 46d2f2224f
commit 4b1d23b243

View file

@ -244,7 +244,7 @@ util_framebuffer_get_num_samples(const struct pipe_framebuffer_state *fb)
fb->zsbuf->nr_samples);
}
return 1;
return MAX2(fb->samples, 1);
}