diff options
author | Jason Ekstrand <[email protected]> | 2015-05-16 10:28:04 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2015-05-16 10:28:04 -0700 |
commit | 120394ac923f186b18679448ea5d9f088728aa2d (patch) | |
tree | 7af53d4f11e1013e832fc9a4d6e067c56d33a0c6 /src | |
parent | 4223de769ea9ced73771f4b0233fe320f4c2212d (diff) |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/vulkan/meta.c | 10 |
1 files 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 | |