aboutsummaryrefslogtreecommitdiffstats
path: root/src/amd/vulkan/radv_formats.c
diff options
context:
space:
mode:
authorBas Nieuwenhuizen <[email protected]>2018-07-15 20:09:28 +0200
committerBas Nieuwenhuizen <[email protected]>2019-04-25 19:56:20 +0000
commit09c4a911e5a1aa1970b96b3dbba3585be616559d (patch)
tree6ff49423b1317bb6d05cff5e71757a37fd4d6d0f /src/amd/vulkan/radv_formats.c
parent055f6281d410aa55ac56169973897000d0e0cd42 (diff)
radv: Add logic for subsampled format descriptions.
Reviewed-by: Samuel Pitoiset <[email protected]>
Diffstat (limited to 'src/amd/vulkan/radv_formats.c')
-rw-r--r--src/amd/vulkan/radv_formats.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/amd/vulkan/radv_formats.c b/src/amd/vulkan/radv_formats.c
index 0a3ff9ebbd9..773600b7f5d 100644
--- a/src/amd/vulkan/radv_formats.c
+++ b/src/amd/vulkan/radv_formats.c
@@ -180,6 +180,18 @@ uint32_t radv_translate_tex_dataformat(VkFormat format,
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: