summaryrefslogtreecommitdiffstats
path: root/src/amd/vulkan
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2016-11-30 01:56:11 +0000
committerDave Airlie <[email protected]>2016-12-08 23:05:58 +0000
commit0689b8f4851dcaa447b4a71345557b224af8793a (patch)
tree9280359cf5e191cbbb39f22b7224d979e46a0ea9 /src/amd/vulkan
parentc46c376977275a3327c42ad30ec4df4cb7a4b060 (diff)
radv/meta: clean up buffer->image code.
Removes some unnecessary functions and pull some stuff out of the loop. Reviewed by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/amd/vulkan')
-rw-r--r--src/amd/vulkan/radv_meta_bufimage.c42
1 files changed, 7 insertions, 35 deletions
diff --git a/src/amd/vulkan/radv_meta_bufimage.c b/src/amd/vulkan/radv_meta_bufimage.c
index a2c5fb4d5d7..01e48e43b46 100644
--- a/src/amd/vulkan/radv_meta_bufimage.c
+++ b/src/amd/vulkan/radv_meta_bufimage.c
@@ -300,30 +300,11 @@ create_bview(struct radv_cmd_buffer *cmd_buffer,
struct itob_temps {
struct radv_image_view src_iview;
-
struct radv_buffer_view dst_bview;
VkDescriptorSet set;
};
static void
-itob_bind_src_image(struct radv_cmd_buffer *cmd_buffer,
- struct radv_meta_blit2d_surf *src,
- struct radv_meta_blit2d_rect *rect,
- struct itob_temps *tmp)
-{
- create_iview(cmd_buffer, src, VK_IMAGE_USAGE_SAMPLED_BIT, &tmp->src_iview);
-}
-
-static void
-itob_bind_dst_buffer(struct radv_cmd_buffer *cmd_buffer,
- struct radv_meta_blit2d_buffer *dst,
- struct radv_meta_blit2d_rect *rect,
- struct itob_temps *tmp)
-{
- create_bview(cmd_buffer, dst->buffer, dst->offset, dst->format, &tmp->dst_bview);
-}
-
-static void
itob_bind_descriptors(struct radv_cmd_buffer *cmd_buffer,
struct itob_temps *tmp)
{
@@ -370,12 +351,6 @@ itob_bind_descriptors(struct radv_cmd_buffer *cmd_buffer,
}
static void
-itob_unbind_src_image(struct radv_cmd_buffer *cmd_buffer,
- struct itob_temps *temps)
-{
-}
-
-static void
bind_pipeline(struct radv_cmd_buffer *cmd_buffer)
{
VkPipeline pipeline =
@@ -395,16 +370,15 @@ radv_meta_image_to_buffer(struct radv_cmd_buffer *cmd_buffer,
struct radv_meta_blit2d_rect *rects)
{
struct radv_device *device = cmd_buffer->device;
+ struct itob_temps temps;
- for (unsigned r = 0; r < num_rects; ++r) {
- struct itob_temps temps;
-
- itob_bind_src_image(cmd_buffer, src, &rects[r], &temps);
- itob_bind_dst_buffer(cmd_buffer, dst, &rects[r], &temps);
- itob_bind_descriptors(cmd_buffer, &temps);
+ create_iview(cmd_buffer, src, VK_IMAGE_USAGE_SAMPLED_BIT, &temps.src_iview);
+ create_bview(cmd_buffer, dst->buffer, dst->offset, dst->format, &temps.dst_bview);
+ itob_bind_descriptors(cmd_buffer, &temps);
- bind_pipeline(cmd_buffer);
+ bind_pipeline(cmd_buffer);
+ for (unsigned r = 0; r < num_rects; ++r) {
unsigned push_constants[3] = {
rects[r].src_x,
rects[r].src_y,
@@ -416,8 +390,6 @@ radv_meta_image_to_buffer(struct radv_cmd_buffer *cmd_buffer,
push_constants);
radv_unaligned_dispatch(cmd_buffer, rects[r].width, rects[r].height, 1);
- radv_temp_descriptor_set_destroy(cmd_buffer->device, temps.set);
- itob_unbind_src_image(cmd_buffer, &temps);
}
-
+ radv_temp_descriptor_set_destroy(cmd_buffer->device, temps.set);
}