From 120394ac923f186b18679448ea5d9f088728aa2d Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Sat, 16 May 2015 10:28:04 -0700 Subject: [PATCH] vk/meta: Save and restore the old bindings pointer If we don't do this then recursive meta is completely broken. What happens is that the outer meta call may change the bindings pointer and the inner meta call will change it again and, when it exits set it back to the default. However, the outer meta call may be relying on it being left alone so it uses the non-meta descriptor sets instead of its own. --- src/vulkan/meta.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/vulkan/meta.c b/src/vulkan/meta.c index 75d148b73c0..1255761c4d6 100644 --- a/src/vulkan/meta.c +++ b/src/vulkan/meta.c @@ -149,15 +149,17 @@ anv_device_init_meta_clear_state(struct anv_device *device) #define NUM_VB_USED 2 struct anv_saved_state { struct anv_bindings bindings; - struct anv_pipeline *pipeline; + struct anv_bindings *old_bindings; + struct anv_pipeline *old_pipeline; }; static void anv_cmd_buffer_save(struct anv_cmd_buffer *cmd_buffer, struct anv_saved_state *state) { + state->old_bindings = cmd_buffer->bindings; cmd_buffer->bindings = &state->bindings; - state->pipeline = cmd_buffer->pipeline; + state->old_pipeline = cmd_buffer->pipeline; /* Initialize render targets for the meta bindings. */ anv_cmd_buffer_fill_render_targets(cmd_buffer); @@ -167,8 +169,8 @@ static void anv_cmd_buffer_restore(struct anv_cmd_buffer *cmd_buffer, const struct anv_saved_state *state) { - cmd_buffer->bindings = &cmd_buffer->default_bindings; - cmd_buffer->pipeline = state->pipeline; + cmd_buffer->bindings = state->old_bindings; + cmd_buffer->pipeline = state->old_pipeline; cmd_buffer->vb_dirty |= (1 << NUM_VB_USED) - 1; cmd_buffer->dirty |= ANV_CMD_BUFFER_PIPELINE_DIRTY | -- 2.30.2