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;
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);
.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) {
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 = {
.baseArrayLayer = dest_array_slice,
.layerCount = 1
},
- },
- cmd_buffer, usage);
+ });
meta_emit_blit(cmd_buffer,
src_image, &src_iview,
src_offset_0, src_offset_1,
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;
.baseArrayLayer = surf->layer,
.layerCount = 1
},
- }, cmd_buffer, usage);
+ });
}
static void
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],
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) {
static void
create_iview(struct radv_cmd_buffer *cmd_buffer,
struct radv_meta_blit2d_surf *surf,
- VkImageUsageFlags usage,
struct radv_image_view *iview)
{
.baseArrayLayer = surf->layer,
.layerCount = 1
},
- }, cmd_buffer, usage);
+ });
}
static void
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);
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);
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);
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);
.baseArrayLayer = range->baseArrayLayer + layer,
.layerCount = 1
},
- },
- cmd_buffer, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT);
+ });
VkFramebuffer fb;
radv_CreateFramebuffer(device_h,
.baseArrayLayer = subresourceRange->baseArrayLayer + layer,
.layerCount = 1,
},
- },
- cmd_buffer, VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT);
+ });
VkFramebuffer fb_h;
.baseArrayLayer = subresourceRange->baseArrayLayer + layer,
.layerCount = 1,
},
- },
- cmd_buffer, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT);
+ });
VkFramebuffer fb_h;
radv_CreateFramebuffer(device_h,
.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,
.baseArrayLayer = dest_base_layer + layer,
.layerCount = 1,
},
- },
- cmd_buffer, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT);
+ });
VkFramebuffer fb_h;
radv_CreateFramebuffer(device_h,
.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,
.baseArrayLayer = dest_base_layer + layer,
.layerCount = 1,
},
- },
- cmd_buffer, VK_IMAGE_USAGE_STORAGE_BIT);
+ });
emit_resolve(cmd_buffer,
&src_iview,
.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,
.baseArrayLayer = dest_base_layer + layer,
.layerCount = 1,
},
- },
- cmd_buffer, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT);
+ });
VkFramebuffer fb;
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;