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.
This commit is contained in:
Jason Ekstrand
2015-05-16 10:28:04 -07:00
parent 4223de769e
commit 120394ac92
+6 -4
View File
@@ -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 |