nvk: Re-emit sample locations when rasterization samples changes

We need them for the case where explicit sample locations are not
enabled.  While we're at it, fix the case where rasterization_samples=0.
This can happen when rasterizer discard is enabled.  This fixes MSAA
resolves with NVK+Zink.  In particular, it fixes MSAA for the Unigine
Heaven and Valley benchmark.

This also fixes all of the spec@arb_texture_float@multisample-formats
piglit tests.

Fixes: 41d094c2cc ("nvk: Support dynamic state for enabling sample locations")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10786
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29147>
This commit is contained in:
Faith Ekstrand
2024-05-10 16:32:05 -05:00
committed by Marge Bot
parent bc15c95c7a
commit a160c2a14e

View File

@@ -1724,13 +1724,15 @@ nvk_flush_ms_state(struct nvk_cmd_buffer *cmd)
});
}
if (BITSET_TEST(dyn->dirty, MESA_VK_DYNAMIC_MS_SAMPLE_LOCATIONS) ||
if (BITSET_TEST(dyn->dirty, MESA_VK_DYNAMIC_MS_RASTERIZATION_SAMPLES) ||
BITSET_TEST(dyn->dirty, MESA_VK_DYNAMIC_MS_SAMPLE_LOCATIONS) ||
BITSET_TEST(dyn->dirty, MESA_VK_DYNAMIC_MS_SAMPLE_LOCATIONS_ENABLE)) {
const struct vk_sample_locations_state *sl;
if (dyn->ms.sample_locations_enable) {
sl = dyn->ms.sample_locations;
} else {
sl = vk_standard_sample_locations_state(dyn->ms.rasterization_samples);
const uint32_t samples = MAX2(1, dyn->ms.rasterization_samples);
sl = vk_standard_sample_locations_state(samples);
}
for (uint32_t i = 0; i < sl->per_pixel; i++) {