summaryrefslogtreecommitdiffstats
path: root/src/amd/vulkan/radv_meta.c
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2017-10-03 14:26:38 +0200
committerSamuel Pitoiset <[email protected]>2017-10-06 09:49:06 +0200
commit8d91f4e45fa2e09a0d80916c00ca1e36025059fc (patch)
tree072a505ff1d5a35a4afaf065ca4aedd1492a32a3 /src/amd/vulkan/radv_meta.c
parent55ee5329328c15458ebee848cc6b4c9407d50f08 (diff)
radv: merge radv_meta_{save,restore}_pass() with RADV_META_SAVE_PASS
Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/amd/vulkan/radv_meta.c')
-rw-r--r--src/amd/vulkan/radv_meta.c40
1 files changed, 17 insertions, 23 deletions
diff --git a/src/amd/vulkan/radv_meta.c b/src/amd/vulkan/radv_meta.c
index 4a45f083f69..33be7d68cca 100644
--- a/src/amd/vulkan/radv_meta.c
+++ b/src/amd/vulkan/radv_meta.c
@@ -61,6 +61,14 @@ radv_meta_save_novertex(struct radv_meta_saved_state *state,
memcpy(state->push_constants, cmd_buffer->push_constants,
MAX_PUSH_CONSTANTS_SIZE);
}
+
+ if (state->flags & RADV_META_SAVE_PASS) {
+ state->pass = cmd_buffer->state.pass;
+ state->subpass = cmd_buffer->state.subpass;
+ state->framebuffer = cmd_buffer->state.framebuffer;
+ state->attachments = cmd_buffer->state.attachments;
+ state->render_area = cmd_buffer->state.render_area;
+ }
}
void
@@ -101,30 +109,16 @@ radv_meta_restore(const struct radv_meta_saved_state *state,
cmd_buffer->push_constant_stages |= VK_SHADER_STAGE_ALL_GRAPHICS |
VK_SHADER_STAGE_COMPUTE_BIT;
}
-}
-
-void
-radv_meta_save_pass(struct radv_meta_saved_pass_state *state,
- const struct radv_cmd_buffer *cmd_buffer)
-{
- state->pass = cmd_buffer->state.pass;
- state->subpass = cmd_buffer->state.subpass;
- state->framebuffer = cmd_buffer->state.framebuffer;
- state->attachments = cmd_buffer->state.attachments;
- state->render_area = cmd_buffer->state.render_area;
-}
-void
-radv_meta_restore_pass(const struct radv_meta_saved_pass_state *state,
- struct radv_cmd_buffer *cmd_buffer)
-{
- cmd_buffer->state.pass = state->pass;
- cmd_buffer->state.subpass = state->subpass;
- cmd_buffer->state.framebuffer = state->framebuffer;
- cmd_buffer->state.attachments = state->attachments;
- cmd_buffer->state.render_area = state->render_area;
- if (state->subpass)
- radv_emit_framebuffer_state(cmd_buffer);
+ if (state->flags & RADV_META_SAVE_PASS) {
+ cmd_buffer->state.pass = state->pass;
+ cmd_buffer->state.subpass = state->subpass;
+ cmd_buffer->state.framebuffer = state->framebuffer;
+ cmd_buffer->state.attachments = state->attachments;
+ cmd_buffer->state.render_area = state->render_area;
+ if (state->subpass)
+ radv_emit_framebuffer_state(cmd_buffer);
+ }
}
void