summaryrefslogtreecommitdiffstats
path: root/src/amd/vulkan/radv_meta.c
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2017-09-26 23:26:20 +0200
committerSamuel Pitoiset <[email protected]>2017-09-27 09:26:44 +0200
commit8860b39d9432216dd40b825fc5750d3601b6cf4e (patch)
tree671c3a14818c9ed08f1712bf6e99ff03e96096fe /src/amd/vulkan/radv_meta.c
parentbd7fd6a0e4e9bfe3f713955c511b6ca6a6120231 (diff)
radv: store the amount of saved constants in the compute state
It's safer and more elegant. 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.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/amd/vulkan/radv_meta.c b/src/amd/vulkan/radv_meta.c
index 2e16c9b9f46..3ddbc2e9af4 100644
--- a/src/amd/vulkan/radv_meta.c
+++ b/src/amd/vulkan/radv_meta.c
@@ -112,23 +112,26 @@ radv_meta_save_compute(struct radv_meta_saved_compute_state *state,
{
state->old_pipeline = cmd_buffer->state.compute_pipeline;
state->old_descriptor_set0 = cmd_buffer->state.descriptors[0];
+ state->push_constant_size = push_constant_size;
- if (push_constant_size)
- memcpy(state->push_constants, cmd_buffer->push_constants, push_constant_size);
+ if (state->push_constant_size) {
+ memcpy(state->push_constants, cmd_buffer->push_constants,
+ state->push_constant_size);
+ }
}
void
radv_meta_restore_compute(const struct radv_meta_saved_compute_state *state,
- struct radv_cmd_buffer *cmd_buffer,
- unsigned push_constant_size)
+ struct radv_cmd_buffer *cmd_buffer)
{
radv_CmdBindPipeline(radv_cmd_buffer_to_handle(cmd_buffer), VK_PIPELINE_BIND_POINT_COMPUTE,
radv_pipeline_to_handle(state->old_pipeline));
cmd_buffer->state.descriptors[0] = state->old_descriptor_set0;
- if (push_constant_size) {
- memcpy(cmd_buffer->push_constants, state->push_constants, push_constant_size);
+ if (state->push_constant_size) {
+ memcpy(cmd_buffer->push_constants, state->push_constants,
+ state->push_constant_size);
cmd_buffer->push_constant_stages |= VK_SHADER_STAGE_COMPUTE_BIT;
}
}