radv: Remove unused args of radv_image_view_init.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Sun, 25 Jun 2017 20:25:47 +0000 (22:25 +0200)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Sun, 25 Jun 2017 23:24:50 +0000 (01:24 +0200)
Signed-off-by: Bas Nieuwenhuizen <basni@google.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
src/amd/vulkan/radv_image.c
src/amd/vulkan/radv_meta_blit.c
src/amd/vulkan/radv_meta_blit2d.c
src/amd/vulkan/radv_meta_bufimage.c
src/amd/vulkan/radv_meta_clear.c
src/amd/vulkan/radv_meta_decompress.c
src/amd/vulkan/radv_meta_fast_clear.c
src/amd/vulkan/radv_meta_resolve.c
src/amd/vulkan/radv_meta_resolve_cs.c
src/amd/vulkan/radv_meta_resolve_fs.c
src/amd/vulkan/radv_private.h

index 91c7e5ff79fe73c469dc3fa847bfa0af22a4363d..147ebed7341b5513d6ab705616af2ca757a9a352 100644 (file)
@@ -837,9 +837,7 @@ radv_image_create(VkDevice _device,
 void
 radv_image_view_init(struct radv_image_view *iview,
                     struct radv_device *device,
-                    const VkImageViewCreateInfo* pCreateInfo,
-                    struct radv_cmd_buffer *cmd_buffer,
-                    VkImageUsageFlags usage_mask)
+                    const VkImageViewCreateInfo* pCreateInfo)
 {
        RADV_FROM_HANDLE(radv_image, image, pCreateInfo->image);
        const VkImageSubresourceRange *range = &pCreateInfo->subresourceRange;
@@ -1013,7 +1011,7 @@ radv_CreateImageView(VkDevice _device,
        if (view == NULL)
                return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
 
-       radv_image_view_init(view, device, pCreateInfo, NULL, ~0);
+       radv_image_view_init(view, device, pCreateInfo);
 
        *pView = radv_image_view_to_handle(view);
 
index f63fa6795c0c02d0327f6856d7756ea33cee7a10..89ff82ec68d3fb1840152afa8cd73dfeade827b9 100644 (file)
@@ -526,8 +526,7 @@ void radv_CmdBlitImage(
                                                     .baseArrayLayer = src_res->baseArrayLayer,
                                                     .layerCount = 1
                                             },
-                                                    },
-                                    cmd_buffer, VK_IMAGE_USAGE_SAMPLED_BIT);
+                                    });
 
                unsigned dst_start, dst_end;
                if (dest_image->type == VK_IMAGE_TYPE_3D) {
@@ -575,12 +574,6 @@ void radv_CmdBlitImage(
                dest_box.extent.height = abs(dst_y1 - dst_y0);
 
                struct radv_image_view dest_iview;
-               unsigned usage;
-               if (dst_res->aspectMask == VK_IMAGE_ASPECT_COLOR_BIT)
-                       usage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
-               else
-                       usage = VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT;
-
                const unsigned num_layers = dst_end - dst_start;
                for (unsigned i = 0; i < num_layers; i++) {
                        const VkOffset3D dest_offset_0 = {
@@ -620,8 +613,7 @@ void radv_CmdBlitImage(
                                                             .baseArrayLayer = dest_array_slice,
                                                             .layerCount = 1
                                                     },
-                                            },
-                                            cmd_buffer, usage);
+                                            });
                        meta_emit_blit(cmd_buffer,
                                       src_image, &src_iview,
                                       src_offset_0, src_offset_1,
index 7d12d6cb559c2f0e4160336149258729947bdd60..fb14cfbcdda5918a9baddf6ea3717d12eaa0bceb 100644 (file)
@@ -53,7 +53,6 @@ enum blit2d_src_type {
 static void
 create_iview(struct radv_cmd_buffer *cmd_buffer,
              struct radv_meta_blit2d_surf *surf,
-             VkImageUsageFlags usage,
              struct radv_image_view *iview, VkFormat depth_format)
 {
        VkFormat format;
@@ -76,7 +75,7 @@ create_iview(struct radv_cmd_buffer *cmd_buffer,
                                             .baseArrayLayer = surf->layer,
                                             .layerCount = 1
                                     },
-                                            }, cmd_buffer, usage);
+                            });
 }
 
 static void
@@ -139,8 +138,7 @@ blit2d_bind_src(struct radv_cmd_buffer *cmd_buffer,
                                      VK_SHADER_STAGE_FRAGMENT_BIT, 16, 4,
                                      &src_buf->pitch);
        } else {
-               create_iview(cmd_buffer, src_img, VK_IMAGE_USAGE_SAMPLED_BIT, &tmp->iview,
-                            depth_format);
+               create_iview(cmd_buffer, src_img, &tmp->iview, depth_format);
 
                radv_meta_push_descriptor_set(cmd_buffer, VK_PIPELINE_BIND_POINT_GRAPHICS,
                                              device->meta_state.blit2d.p_layouts[src_type],
@@ -179,15 +177,7 @@ blit2d_bind_dst(struct radv_cmd_buffer *cmd_buffer,
                VkFormat depth_format,
                 struct blit2d_dst_temps *tmp)
 {
-       VkImageUsageFlagBits bits;
-
-       if (dst->aspect_mask == VK_IMAGE_ASPECT_COLOR_BIT)
-               bits = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
-       else
-               bits = VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT;
-
-       create_iview(cmd_buffer, dst, bits,
-                    &tmp->iview, depth_format);
+       create_iview(cmd_buffer, dst, &tmp->iview, depth_format);
 
        radv_CreateFramebuffer(radv_device_to_handle(cmd_buffer->device),
                               &(VkFramebufferCreateInfo) {
index 1588d6b6e0680a99754302fcdb0d422b614d8018..91af80c3921b48a1dc047fdcd415e66e8df5532c 100644 (file)
@@ -859,7 +859,6 @@ radv_meta_end_cleari(struct radv_cmd_buffer *cmd_buffer,
 static void
 create_iview(struct radv_cmd_buffer *cmd_buffer,
              struct radv_meta_blit2d_surf *surf,
-             VkImageUsageFlags usage,
              struct radv_image_view *iview)
 {
 
@@ -876,7 +875,7 @@ create_iview(struct radv_cmd_buffer *cmd_buffer,
                                             .baseArrayLayer = surf->layer,
                                             .layerCount = 1
                                     },
-                                            }, cmd_buffer, usage);
+                            });
 }
 
 static void
@@ -962,7 +961,7 @@ radv_meta_image_to_buffer(struct radv_cmd_buffer *cmd_buffer,
        struct radv_device *device = cmd_buffer->device;
        struct itob_temps temps;
 
-       create_iview(cmd_buffer, src, VK_IMAGE_USAGE_SAMPLED_BIT, &temps.src_iview);
+       create_iview(cmd_buffer, src, &temps.src_iview);
        create_bview(cmd_buffer, dst->buffer, dst->offset, dst->format, &temps.dst_bview);
        itob_bind_descriptors(cmd_buffer, &temps);
 
@@ -1048,7 +1047,7 @@ radv_meta_buffer_to_image_cs(struct radv_cmd_buffer *cmd_buffer,
        struct btoi_temps temps;
 
        create_bview(cmd_buffer, src->buffer, src->offset, src->format, &temps.src_bview);
-       create_iview(cmd_buffer, dst, VK_IMAGE_USAGE_STORAGE_BIT, &temps.dst_iview);
+       create_iview(cmd_buffer, dst, &temps.dst_iview);
        btoi_bind_descriptors(cmd_buffer, &temps);
 
        btoi_bind_pipeline(cmd_buffer);
@@ -1138,8 +1137,8 @@ radv_meta_image_to_image_cs(struct radv_cmd_buffer *cmd_buffer,
        struct radv_device *device = cmd_buffer->device;
        struct itoi_temps temps;
 
-       create_iview(cmd_buffer, src, VK_IMAGE_USAGE_SAMPLED_BIT, &temps.src_iview);
-       create_iview(cmd_buffer, dst, VK_IMAGE_USAGE_STORAGE_BIT, &temps.dst_iview);
+       create_iview(cmd_buffer, src, &temps.src_iview);
+       create_iview(cmd_buffer, dst, &temps.dst_iview);
 
        itoi_bind_descriptors(cmd_buffer, &temps);
 
@@ -1210,7 +1209,7 @@ radv_meta_clear_image_cs(struct radv_cmd_buffer *cmd_buffer,
        struct radv_device *device = cmd_buffer->device;
        struct radv_image_view dst_iview;
 
-       create_iview(cmd_buffer, dst, VK_IMAGE_USAGE_STORAGE_BIT, &dst_iview);
+       create_iview(cmd_buffer, dst, &dst_iview);
        cleari_bind_descriptors(cmd_buffer, &dst_iview);
 
        cleari_bind_pipeline(cmd_buffer);
index d7e7c5b2627d7dbf6c2ae3f9939dfafd615a1b8f..06485137fc7baa8b48a60ee29405b9826decb1c2 100644 (file)
@@ -1094,8 +1094,7 @@ radv_clear_image_layer(struct radv_cmd_buffer *cmd_buffer,
                                             .baseArrayLayer = range->baseArrayLayer + layer,
                                             .layerCount = 1
                                     },
-                            },
-                            cmd_buffer, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT);
+                            });
 
        VkFramebuffer fb;
        radv_CreateFramebuffer(device_h,
index 1f1ff9db42304e10a396568b78bea30bd2e46746..5a34863690762b16b6eae2ea64b639a0e273de8d 100644 (file)
@@ -318,8 +318,7 @@ static void radv_process_depth_image_inplace(struct radv_cmd_buffer *cmd_buffer,
                                                     .baseArrayLayer = subresourceRange->baseArrayLayer + layer,
                                                     .layerCount = 1,
                                             },
-                                    },
-                                    cmd_buffer, VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT);
+                                    });
 
 
                VkFramebuffer fb_h;
index c93901e700858c9c675fd01602e52810fe72abfe..94610c469879049fb6916843a1ee572f58a0ec97 100644 (file)
@@ -367,8 +367,7 @@ radv_fast_clear_flush_image_inplace(struct radv_cmd_buffer *cmd_buffer,
                                                     .baseArrayLayer = subresourceRange->baseArrayLayer + layer,
                                                     .layerCount = 1,
                                              },
-                                    },
-                                    cmd_buffer, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT);
+                                    });
 
                VkFramebuffer fb_h;
                radv_CreateFramebuffer(device_h,
index 44e64022a0d6794a0b435383194baae22c4995f1..a0edfb915cdce012223580d9b3c7a4315cc51d75 100644 (file)
@@ -458,8 +458,7 @@ void radv_CmdResolveImage(
                                                             .baseArrayLayer = src_base_layer + layer,
                                                             .layerCount = 1,
                                                     },
-                                                            },
-                                            cmd_buffer, VK_IMAGE_USAGE_SAMPLED_BIT);
+                                            });
 
                        struct radv_image_view dest_iview;
                        radv_image_view_init(&dest_iview, cmd_buffer->device,
@@ -475,8 +474,7 @@ void radv_CmdResolveImage(
                                                             .baseArrayLayer = dest_base_layer + layer,
                                                             .layerCount = 1,
                                                     },
-                                                            },
-                                            cmd_buffer, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT);
+                                             });
 
                        VkFramebuffer fb_h;
                        radv_CreateFramebuffer(device_h,
index 6166e0cb8c3624b65ff20e4766925d41b3cdf3cb..5460fde2d5e69f62869400623187ce2a533f6799 100644 (file)
@@ -394,8 +394,7 @@ void radv_meta_resolve_compute_image(struct radv_cmd_buffer *cmd_buffer,
                                                             .baseArrayLayer = src_base_layer + layer,
                                                             .layerCount = 1,
                                                     },
-                                            },
-                                            cmd_buffer, VK_IMAGE_USAGE_SAMPLED_BIT);
+                                            });
 
                        struct radv_image_view dest_iview;
                        radv_image_view_init(&dest_iview, cmd_buffer->device,
@@ -411,8 +410,7 @@ void radv_meta_resolve_compute_image(struct radv_cmd_buffer *cmd_buffer,
                                                             .baseArrayLayer = dest_base_layer + layer,
                                                             .layerCount = 1,
                                                     },
-                                                            },
-                                            cmd_buffer, VK_IMAGE_USAGE_STORAGE_BIT);
+                                            });
 
                        emit_resolve(cmd_buffer,
                                     &src_iview,
index a405f80be128cfa449e462197f1aa48e92179f5f..1b959477b1fe86075d7111094d7e32b9ec16b237 100644 (file)
@@ -543,8 +543,7 @@ void radv_meta_resolve_fragment_image(struct radv_cmd_buffer *cmd_buffer,
                                                             .baseArrayLayer = src_base_layer + layer,
                                                             .layerCount = 1,
                                                     },
-                                            },
-                                            cmd_buffer, VK_IMAGE_USAGE_SAMPLED_BIT);
+                                            });
 
                        struct radv_image_view dest_iview;
                        radv_image_view_init(&dest_iview, cmd_buffer->device,
@@ -560,8 +559,7 @@ void radv_meta_resolve_fragment_image(struct radv_cmd_buffer *cmd_buffer,
                                                             .baseArrayLayer = dest_base_layer + layer,
                                                             .layerCount = 1,
                                                     },
-                                                            },
-                                            cmd_buffer, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT);
+                                            });
 
 
                        VkFramebuffer fb;
index 630448d3b2a3f8934b2b9277de2c4247146db79e..ac89fc1e8f2a57c7a55a5cdb7fa4eacbc284c941 100644 (file)
@@ -1285,9 +1285,7 @@ VkResult radv_image_create(VkDevice _device,
 
 void radv_image_view_init(struct radv_image_view *view,
                          struct radv_device *device,
-                         const VkImageViewCreateInfo* pCreateInfo,
-                         struct radv_cmd_buffer *cmd_buffer,
-                         VkImageUsageFlags usage_mask);
+                         const VkImageViewCreateInfo* pCreateInfo);
 
 struct radv_buffer_view {
        struct radeon_winsys_bo *bo;