if (resolve_method == RESOLVE_COMPUTE) {
radv_meta_resolve_compute_image(cmd_buffer,
src_image,
+ src_image->vk_format,
src_image_layout,
dest_image,
+ dest_image->vk_format,
dest_image_layout,
region_count, regions);
return;
if (dest_att.attachment == VK_ATTACHMENT_UNUSED)
continue;
- struct radv_image *dst_img = cmd_buffer->state.framebuffer->attachments[dest_att.attachment].attachment->image;
+ struct radv_image_view *dest_iview = cmd_buffer->state.framebuffer->attachments[dest_att.attachment].attachment;
+ struct radv_image *dst_img = dest_iview->image;
if (radv_image_has_dcc(dst_img)) {
radv_initialize_dcc(cmd_buffer, dst_img, 0xffffffff);
radv_cmd_buffer_set_subpass(cmd_buffer, &resolve_subpass);
- VkResult ret = build_resolve_pipeline(cmd_buffer->device, radv_format_meta_fs_key(dst_img->vk_format));
+ VkResult ret = build_resolve_pipeline(cmd_buffer->device, radv_format_meta_fs_key(dest_iview->vk_format));
if (ret != VK_SUCCESS) {
cmd_buffer->record_result = ret;
continue;
}
emit_resolve(cmd_buffer,
- dst_img->vk_format,
+ dest_iview->vk_format,
&(VkOffset2D) { 0, 0 },
&(VkExtent2D) { fb->width, fb->height });
}
static VkPipeline *
radv_get_resolve_pipeline(struct radv_cmd_buffer *cmd_buffer,
- struct radv_image *src_image)
+ struct radv_image_view *src_iview)
{
struct radv_device *device = cmd_buffer->device;
struct radv_meta_state *state = &device->meta_state;
- uint32_t samples = src_image->info.samples;
+ uint32_t samples = src_iview->image->info.samples;
uint32_t samples_log2 = ffs(samples) - 1;
VkPipeline *pipeline;
- if (vk_format_is_int(src_image->vk_format))
+ if (vk_format_is_int(src_iview->vk_format))
pipeline = &state->resolve_compute.rc[samples_log2].i_pipeline;
- else if (vk_format_is_srgb(src_image->vk_format))
+ else if (vk_format_is_srgb(src_iview->vk_format))
pipeline = &state->resolve_compute.rc[samples_log2].srgb_pipeline;
else
pipeline = &state->resolve_compute.rc[samples_log2].pipeline;
VkResult ret;
ret = create_resolve_pipeline(device, samples,
- vk_format_is_int(src_image->vk_format),
- vk_format_is_srgb(src_image->vk_format),
+ vk_format_is_int(src_iview->vk_format),
+ vk_format_is_srgb(src_iview->vk_format),
pipeline);
if (ret != VK_SUCCESS) {
cmd_buffer->record_result = ret;
}
});
- pipeline = radv_get_resolve_pipeline(cmd_buffer, src_iview->image);
+ pipeline = radv_get_resolve_pipeline(cmd_buffer, src_iview);
radv_CmdBindPipeline(radv_cmd_buffer_to_handle(cmd_buffer),
VK_PIPELINE_BIND_POINT_COMPUTE, *pipeline);
void radv_meta_resolve_compute_image(struct radv_cmd_buffer *cmd_buffer,
struct radv_image *src_image,
+ VkFormat src_format,
VkImageLayout src_image_layout,
struct radv_image *dest_image,
+ VkFormat dest_format,
VkImageLayout dest_image_layout,
uint32_t region_count,
const VkImageResolve *regions)
.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO,
.image = radv_image_to_handle(src_image),
.viewType = radv_meta_get_view_type(src_image),
- .format = src_image->vk_format,
+ .format = src_format,
.subresourceRange = {
.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
.baseMipLevel = region->srcSubresource.mipLevel,
.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO,
.image = radv_image_to_handle(dest_image),
.viewType = radv_meta_get_view_type(dest_image),
- .format = vk_to_non_srgb_format(dest_image->vk_format),
+ .format = vk_to_non_srgb_format(dest_format),
.subresourceRange = {
.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
.baseMipLevel = region->dstSubresource.mipLevel,
radv_meta_resolve_compute_image(cmd_buffer,
src_iview->image,
+ src_iview->vk_format,
src_att.layout,
dst_iview->image,
+ dst_iview->vk_format,
dst_att.layout,
1, ®ion);
}