vk/graphics_state: Fix copying MS locations pipeline state

Copying the state below overwrote the ms.sample_locations we set,
so our new_sample_locations was never actually used and we were
accidentally doing a shallow copy. Turnip passes a stack-allocated
old_state, so this resulted in invalid stack pointers.

Fixes: f497cc9d56 ("vk/graphics_state: Add helpers for pre-baking state")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25031>
(cherry picked from commit 1cef1f02b5)
This commit is contained in:
Connor Abbott 2023-08-25 12:47:29 +02:00 committed by Dylan Baker
parent a032a14d3b
commit 0b56095282
2 changed files with 5 additions and 5 deletions

View file

@ -7594,7 +7594,7 @@
"description": "vk/graphics_state: Fix copying MS locations pipeline state",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "f497cc9d56e173c62a87b81b02a284e20eff9345",
"notes": null

View file

@ -1668,10 +1668,6 @@ vk_graphics_pipeline_state_copy(const struct vk_device *device,
*new_sample_locations = *old_state->ms->sample_locations;
}
if (new_ms) {
new_ms->sample_locations = new_sample_locations;
}
#define COPY_STATE_IF_NEEDED(STATE, type, s) \
if (new_##s) { \
*new_##s = *old_state->s; \
@ -1680,6 +1676,10 @@ vk_graphics_pipeline_state_copy(const struct vk_device *device,
FOREACH_STATE_GROUP(COPY_STATE_IF_NEEDED)
if (new_ms) {
new_ms->sample_locations = new_sample_locations;
}
state->shader_stages = old_state->shader_stages;
BITSET_COPY(state->dynamic, old_state->dynamic);