Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
break;
}
+ if (desc->layout == VK_FORMAT_LAYOUT_SUBSAMPLED) {
+ switch(format) {
+ /* Don't ask me why this looks inverted. PAL does the same. */
+ case VK_FORMAT_G8B8G8R8_422_UNORM:
+ return V_008F14_IMG_DATA_FORMAT_BG_RG;
+ case VK_FORMAT_B8G8R8G8_422_UNORM:
+ return V_008F14_IMG_DATA_FORMAT_GB_GR;
+ default:
+ goto out_unknown;
+ }
+ }
+
if (desc->layout == VK_FORMAT_LAYOUT_RGTC) {
switch(format) {
case VK_FORMAT_BC4_UNORM_BLOCK:
if (pCreateInfo->tiling == VK_IMAGE_TILING_LINEAR)
return false;
+ if (vk_format_is_subsampled(pCreateInfo->format))
+ return false;
+
/* TODO: Enable DCC for mipmaps and array layers. */
if (pCreateInfo->mipLevels > 1 || pCreateInfo->arrayLayers > 1)
return false;
}
}
+static inline bool
+vk_format_is_subsampled(VkFormat format)
+{
+ const struct vk_format_description *desc = vk_format_description(format);
+
+ assert(desc);
+ if (!desc) {
+ return false;
+ }
+
+ return desc->layout == VK_FORMAT_LAYOUT_SUBSAMPLED;
+}
+
static inline bool
vk_format_has_depth(const struct vk_format_description *desc)
{