radv: use CmdPushConstants when restoring constants after meta operations
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 30 May 2019 10:29:39 +0000 (12:29 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 31 May 2019 06:50:13 +0000 (08:50 +0200)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_meta.c

index ec4fc4a6d4bf03fa248edda20496a421ecdbb95d..721c703983054dc120f5f31e9e480c2da8ed8ac0 100644 (file)
@@ -143,13 +143,15 @@ radv_meta_restore(const struct radv_meta_saved_state *state,
        }
 
        if (state->flags & RADV_META_SAVE_CONSTANTS) {
-               memcpy(cmd_buffer->push_constants, state->push_constants,
-                      MAX_PUSH_CONSTANTS_SIZE);
-               cmd_buffer->push_constant_stages |= VK_SHADER_STAGE_COMPUTE_BIT;
+               VkShaderStageFlags stages = VK_SHADER_STAGE_COMPUTE_BIT;
 
-               if (state->flags & RADV_META_SAVE_GRAPHICS_PIPELINE) {
-                       cmd_buffer->push_constant_stages |= VK_SHADER_STAGE_ALL_GRAPHICS;
-               }
+               if (state->flags & RADV_META_SAVE_GRAPHICS_PIPELINE)
+                       stages |= VK_SHADER_STAGE_ALL_GRAPHICS;
+
+               radv_CmdPushConstants(radv_cmd_buffer_to_handle(cmd_buffer),
+                                     VK_NULL_HANDLE, stages, 0,
+                                     MAX_PUSH_CONSTANTS_SIZE,
+                                     state->push_constants);
        }
 
        if (state->flags & RADV_META_SAVE_PASS) {