diff options
-rw-r--r-- | src/amd/vulkan/radv_image.c | 6 | ||||
-rw-r--r-- | src/amd/vulkan/radv_meta_blit.c | 12 | ||||
-rw-r--r-- | src/amd/vulkan/radv_meta_blit2d.c | 16 | ||||
-rw-r--r-- | src/amd/vulkan/radv_meta_bufimage.c | 13 | ||||
-rw-r--r-- | src/amd/vulkan/radv_meta_clear.c | 3 | ||||
-rw-r--r-- | src/amd/vulkan/radv_meta_decompress.c | 3 | ||||
-rw-r--r-- | src/amd/vulkan/radv_meta_fast_clear.c | 3 | ||||
-rw-r--r-- | src/amd/vulkan/radv_meta_resolve.c | 6 | ||||
-rw-r--r-- | src/amd/vulkan/radv_meta_resolve_cs.c | 6 | ||||
-rw-r--r-- | src/amd/vulkan/radv_meta_resolve_fs.c | 6 | ||||
-rw-r--r-- | src/amd/vulkan/radv_private.h | 4 |
11 files changed, 23 insertions, 55 deletions
diff --git a/src/amd/vulkan/radv_image.c b/src/amd/vulkan/radv_image.c index 91c7e5ff79f..147ebed7341 100644 --- a/src/amd/vulkan/radv_image.c +++ b/src/amd/vulkan/radv_image.c @@ -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); diff --git a/src/amd/vulkan/radv_meta_blit.c b/src/amd/vulkan/radv_meta_blit.c index f63fa6795c0..89ff82ec68d 100644 --- a/src/amd/vulkan/radv_meta_blit.c +++ b/src/amd/vulkan/radv_meta_blit.c @@ -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, diff --git a/src/amd/vulkan/radv_meta_blit2d.c b/src/amd/vulkan/radv_meta_blit2d.c index 7d12d6cb559..fb14cfbcdda 100644 --- a/src/amd/vulkan/radv_meta_blit2d.c +++ b/src/amd/vulkan/radv_meta_blit2d.c @@ -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) { diff --git a/src/amd/vulkan/radv_meta_bufimage.c b/src/amd/vulkan/radv_meta_bufimage.c index 1588d6b6e06..91af80c3921 100644 --- a/src/amd/vulkan/radv_meta_bufimage.c +++ b/src/amd/vulkan/radv_meta_bufimage.c @@ -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); diff --git a/src/amd/vulkan/radv_meta_clear.c b/src/amd/vulkan/radv_meta_clear.c index d7e7c5b2627..06485137fc7 100644 --- a/src/amd/vulkan/radv_meta_clear.c +++ b/src/amd/vulkan/radv_meta_clear.c @@ -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, diff --git a/src/amd/vulkan/radv_meta_decompress.c b/src/amd/vulkan/radv_meta_decompress.c index 1f1ff9db423..5a348636907 100644 --- a/src/amd/vulkan/radv_meta_decompress.c +++ b/src/amd/vulkan/radv_meta_decompress.c @@ -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; diff --git a/src/amd/vulkan/radv_meta_fast_clear.c b/src/amd/vulkan/radv_meta_fast_clear.c index c93901e7008..94610c46987 100644 --- a/src/amd/vulkan/radv_meta_fast_clear.c +++ b/src/amd/vulkan/radv_meta_fast_clear.c @@ -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, diff --git a/src/amd/vulkan/radv_meta_resolve.c b/src/amd/vulkan/radv_meta_resolve.c index 44e64022a0d..a0edfb915cd 100644 --- a/src/amd/vulkan/radv_meta_resolve.c +++ b/src/amd/vulkan/radv_meta_resolve.c @@ -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, diff --git a/src/amd/vulkan/radv_meta_resolve_cs.c b/src/amd/vulkan/radv_meta_resolve_cs.c index 6166e0cb8c3..5460fde2d5e 100644 --- a/src/amd/vulkan/radv_meta_resolve_cs.c +++ b/src/amd/vulkan/radv_meta_resolve_cs.c @@ -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, diff --git a/src/amd/vulkan/radv_meta_resolve_fs.c b/src/amd/vulkan/radv_meta_resolve_fs.c index a405f80be12..1b959477b1f 100644 --- a/src/amd/vulkan/radv_meta_resolve_fs.c +++ b/src/amd/vulkan/radv_meta_resolve_fs.c @@ -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; diff --git a/src/amd/vulkan/radv_private.h b/src/amd/vulkan/radv_private.h index 630448d3b2a..ac89fc1e8f2 100644 --- a/src/amd/vulkan/radv_private.h +++ b/src/amd/vulkan/radv_private.h @@ -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; |