}
}
-static bool radv_is_buffer_format_supported(VkFormat format, bool *scaled)
+bool radv_is_buffer_format_supported(VkFormat format, bool *scaled)
{
const struct vk_format_description *desc = vk_format_description(format);
unsigned data_format, num_format;
num_format = radv_translate_buffer_numformat(desc,
vk_format_get_first_non_void_channel(format));
- *scaled = (num_format == V_008F0C_BUF_NUM_FORMAT_SSCALED) || (num_format == V_008F0C_BUF_NUM_FORMAT_USCALED);
+ if (scaled)
+ *scaled = (num_format == V_008F0C_BUF_NUM_FORMAT_SSCALED) || (num_format == V_008F0C_BUF_NUM_FORMAT_USCALED);
return data_format != V_008F0C_BUF_DATA_FORMAT_INVALID &&
num_format != ~0;
}
&pRegions[r].imageSubresource,
pRegions[r].imageSubresource.aspectMask);
+ if (!radv_is_buffer_format_supported(img_bsurf.format, NULL)) {
+ uint32_t queue_mask = radv_image_queue_family_mask(image,
+ cmd_buffer->queue_family_index,
+ cmd_buffer->queue_family_index);
+ MAYBE_UNUSED bool compressed = radv_layout_dcc_compressed(image, layout, queue_mask);
+ if (compressed) {
+ radv_decompress_dcc(cmd_buffer, image, &(VkImageSubresourceRange) {
+ .aspectMask = pRegions[r].imageSubresource.aspectMask,
+ .baseMipLevel = pRegions[r].imageSubresource.mipLevel,
+ .levelCount = 1,
+ .baseArrayLayer = pRegions[r].imageSubresource.baseArrayLayer,
+ .layerCount = pRegions[r].imageSubresource.layerCount,
+ });
+ }
+ img_bsurf.format = vk_format_for_size(vk_format_get_blocksize(img_bsurf.format));
+ img_bsurf.current_layout = VK_IMAGE_LAYOUT_GENERAL;
+ }
+
struct radv_meta_blit2d_buffer buf_bsurf = {
.bs = img_bsurf.bs,
.format = img_bsurf.format,
&pRegions[r].imageSubresource,
pRegions[r].imageSubresource.aspectMask);
+ if (!radv_is_buffer_format_supported(img_info.format, NULL)) {
+ uint32_t queue_mask = radv_image_queue_family_mask(image,
+ cmd_buffer->queue_family_index,
+ cmd_buffer->queue_family_index);
+ MAYBE_UNUSED bool compressed = radv_layout_dcc_compressed(image, layout, queue_mask);
+ if (compressed) {
+ radv_decompress_dcc(cmd_buffer, image, &(VkImageSubresourceRange) {
+ .aspectMask = pRegions[r].imageSubresource.aspectMask,
+ .baseMipLevel = pRegions[r].imageSubresource.mipLevel,
+ .levelCount = 1,
+ .baseArrayLayer = pRegions[r].imageSubresource.baseArrayLayer,
+ .layerCount = pRegions[r].imageSubresource.layerCount,
+ });
+ }
+ img_info.format = vk_format_for_size(vk_format_get_blocksize(img_info.format));
+ img_info.current_layout = VK_IMAGE_LAYOUT_GENERAL;
+ }
+
struct radv_meta_blit2d_buffer buf_info = {
.bs = img_info.bs,
.format = img_info.format,