diff options
author | Samuel Pitoiset <[email protected]> | 2017-10-03 15:11:21 +0200 |
---|---|---|
committer | Samuel Pitoiset <[email protected]> | 2017-10-06 09:49:06 +0200 |
commit | c8ea55ddda270687e048f88f440b1a543e4520e2 (patch) | |
tree | 3b042596147eeb51fc52a8af1ee14e2d1498ff0a /src/amd/vulkan/radv_meta_copy.c | |
parent | 213f86e514249dba245c97877b3eae3c2018a599 (diff) |
radv: convert all COMPUTE operations to the RADV_META_SAVE_XXX flags
Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/amd/vulkan/radv_meta_copy.c')
-rw-r--r-- | src/amd/vulkan/radv_meta_copy.c | 55 |
1 files changed, 23 insertions, 32 deletions
diff --git a/src/amd/vulkan/radv_meta_copy.c b/src/amd/vulkan/radv_meta_copy.c index 09bd3ec608a..a42b15a01af 100644 --- a/src/amd/vulkan/radv_meta_copy.c +++ b/src/amd/vulkan/radv_meta_copy.c @@ -100,11 +100,6 @@ blit_surf_for_image_level_layer(struct radv_image *image, }; } -union meta_saved_state { - struct radv_meta_saved_state gfx; - struct radv_meta_saved_compute_state compute; -}; - static void meta_copy_buffer_to_image(struct radv_cmd_buffer *cmd_buffer, struct radv_buffer* buffer, @@ -113,20 +108,18 @@ meta_copy_buffer_to_image(struct radv_cmd_buffer *cmd_buffer, const VkBufferImageCopy* pRegions) { bool cs = cmd_buffer->queue_family_index == RADV_QUEUE_COMPUTE; - union meta_saved_state saved_state; + struct radv_meta_saved_state saved_state; /* The Vulkan 1.0 spec says "dstImage must have a sample count equal to * VK_SAMPLE_COUNT_1_BIT." */ assert(image->info.samples == 1); - if (cs) - radv_meta_save_compute(&saved_state.compute, cmd_buffer, 12); - else - radv_meta_save(&saved_state.gfx, cmd_buffer, - RADV_META_SAVE_GRAPHICS_PIPELINE | - RADV_META_SAVE_CONSTANTS | - RADV_META_SAVE_DESCRIPTORS); + radv_meta_save(&saved_state, cmd_buffer, + (cs ? RADV_META_SAVE_COMPUTE_PIPELINE : + RADV_META_SAVE_GRAPHICS_PIPELINE) | + RADV_META_SAVE_CONSTANTS | + RADV_META_SAVE_DESCRIPTORS); for (unsigned r = 0; r < regionCount; r++) { @@ -205,10 +198,8 @@ meta_copy_buffer_to_image(struct radv_cmd_buffer *cmd_buffer, slice_array++; } } - if (cs) - radv_meta_restore_compute(&saved_state.compute, cmd_buffer); - else - radv_meta_restore(&saved_state.gfx, cmd_buffer); + + radv_meta_restore(&saved_state, cmd_buffer); } void radv_CmdCopyBufferToImage( @@ -234,9 +225,12 @@ meta_copy_image_to_buffer(struct radv_cmd_buffer *cmd_buffer, uint32_t regionCount, const VkBufferImageCopy* pRegions) { - struct radv_meta_saved_compute_state saved_state; + struct radv_meta_saved_state saved_state; - radv_meta_save_compute(&saved_state, cmd_buffer, 12); + radv_meta_save(&saved_state, cmd_buffer, + RADV_META_SAVE_COMPUTE_PIPELINE | + RADV_META_SAVE_CONSTANTS | + RADV_META_SAVE_DESCRIPTORS); for (unsigned r = 0; r < regionCount; r++) { @@ -307,7 +301,8 @@ meta_copy_image_to_buffer(struct radv_cmd_buffer *cmd_buffer, slice_array++; } } - radv_meta_restore_compute(&saved_state, cmd_buffer); + + radv_meta_restore(&saved_state, cmd_buffer); } void radv_CmdCopyImageToBuffer( @@ -334,7 +329,7 @@ meta_copy_image(struct radv_cmd_buffer *cmd_buffer, const VkImageCopy *pRegions) { bool cs = cmd_buffer->queue_family_index == RADV_QUEUE_COMPUTE; - union meta_saved_state saved_state; + struct radv_meta_saved_state saved_state; /* From the Vulkan 1.0 spec: * @@ -342,13 +337,12 @@ meta_copy_image(struct radv_cmd_buffer *cmd_buffer, * images, but both images must have the same number of samples. */ assert(src_image->info.samples == dest_image->info.samples); - if (cs) - radv_meta_save_compute(&saved_state.compute, cmd_buffer, 16); - else - radv_meta_save(&saved_state.gfx, cmd_buffer, - RADV_META_SAVE_GRAPHICS_PIPELINE | - RADV_META_SAVE_CONSTANTS | - RADV_META_SAVE_DESCRIPTORS); + + radv_meta_save(&saved_state, cmd_buffer, + (cs ? RADV_META_SAVE_COMPUTE_PIPELINE : + RADV_META_SAVE_GRAPHICS_PIPELINE) | + RADV_META_SAVE_CONSTANTS | + RADV_META_SAVE_DESCRIPTORS); for (unsigned r = 0; r < regionCount; r++) { assert(pRegions[r].srcSubresource.aspectMask == @@ -419,10 +413,7 @@ meta_copy_image(struct radv_cmd_buffer *cmd_buffer, } } - if (cs) - radv_meta_restore_compute(&saved_state.compute, cmd_buffer); - else - radv_meta_restore(&saved_state.gfx, cmd_buffer); + radv_meta_restore(&saved_state, cmd_buffer); } void radv_CmdCopyImage( |