diff --git a/src/dxvk/dxvk_format.cpp b/src/dxvk/dxvk_format.cpp index 096c0b82..acda79c8 100644 --- a/src/dxvk/dxvk_format.cpp +++ b/src/dxvk/dxvk_format.cpp @@ -2,7 +2,7 @@ namespace dxvk { - const std::array g_formatInfos = {{ + const std::array g_formatInfos = {{ // VK_FORMAT_UNDEFINED { }, @@ -550,13 +550,20 @@ namespace dxvk { // VK_FORMAT_A4B4G4R4_UNORM_PACK16_EXT { 2, VK_IMAGE_ASPECT_COLOR_BIT }, + + // VK_FORMAT_G8_B8R8_2PLANE_420_UNORM + { 6, VK_IMAGE_ASPECT_PLANE_0_BIT | VK_IMAGE_ASPECT_PLANE_1_BIT, + DxvkFormatFlag::MultiPlane, VkExtent3D { 1, 1, 1 }, + { DxvkPlaneFormatInfo { 1, { 1, 1 } }, + DxvkPlaneFormatInfo { 2, { 2, 2 } } } }, }}; - const std::array, 3> g_formatGroups = {{ - { VK_FORMAT_UNDEFINED, VK_FORMAT_BC7_SRGB_BLOCK }, - { VK_FORMAT_G8B8G8R8_422_UNORM_KHR, VK_FORMAT_B8G8R8G8_422_UNORM_KHR }, + const std::array, 4> g_formatGroups = {{ + { VK_FORMAT_UNDEFINED, VK_FORMAT_BC7_SRGB_BLOCK }, + { VK_FORMAT_G8B8G8R8_422_UNORM_KHR, VK_FORMAT_B8G8R8G8_422_UNORM_KHR }, { VK_FORMAT_A4R4G4B4_UNORM_PACK16_EXT, VK_FORMAT_A4B4G4R4_UNORM_PACK16_EXT }, + { VK_FORMAT_G8_B8R8_2PLANE_420_UNORM, VK_FORMAT_G8_B8R8_2PLANE_420_UNORM }, }}; diff --git a/src/dxvk/dxvk_format.h b/src/dxvk/dxvk_format.h index 9d5ea37d..21e6a678 100644 --- a/src/dxvk/dxvk_format.h +++ b/src/dxvk/dxvk_format.h @@ -9,10 +9,22 @@ namespace dxvk { SampledUInt = 1, ///< Sampled type is an unsigned integer type SampledSInt = 2, ///< Sampled type is a signed integer type ColorSpaceSrgb = 3, ///< Non-linear SRGB color format + MultiPlane = 4, ///< Multi-plane format }; using DxvkFormatFlags = Flags; + /** + * \brief Planar format info + */ + struct DxvkPlaneFormatInfo { + /// Byte size of a pixel in the current plane + VkDeviceSize elementSize = 0; + /// Number of image pixels covered by a + /// single pixel in the current plane + VkExtent2D blockSize = { 1, 1 }; + }; + /** * \brief Format info structure * @@ -33,6 +45,9 @@ namespace dxvk { /// Size, in pixels, of a compressed block. For /// non-block formats, all these values are 1. VkExtent3D blockSize = { 1, 1, 1 }; + + /// Plane info for multi-planar formats + std::array planes; };