From 1bea1669c599f28a6648991e17353af9edc95011 Mon Sep 17 00:00:00 2001 From: Chad Versace Date: Thu, 12 Nov 2015 11:31:02 -0800 Subject: [PATCH] anv: Use enum isl_format in anv_format This patch begins using isl.h in Anvil. More refactors will follow. Change type of anv_format::surface_format from uint16_t -> enum isl_format. --- src/vulkan/anv_formats.c | 356 +++++++++++++++++++-------------------- src/vulkan/anv_private.h | 4 +- 2 files changed, 179 insertions(+), 181 deletions(-) diff --git a/src/vulkan/anv_formats.c b/src/vulkan/anv_formats.c index 56f4ebda59a..cc3df577201 100644 --- a/src/vulkan/anv_formats.c +++ b/src/vulkan/anv_formats.c @@ -24,188 +24,186 @@ #include "anv_private.h" #include "brw_surface_formats.h" -#define UNSUPPORTED 0xffff - #define fmt(__vk_fmt, __hw_fmt, ...) \ [__vk_fmt] = { .vk_format = __vk_fmt, .name = #__vk_fmt, .surface_format = __hw_fmt, .bw = 1, .bh = 1, .bd = 1, __VA_ARGS__ } static const struct anv_format anv_formats[] = { - fmt(VK_FORMAT_UNDEFINED, RAW, .bs = 1, .num_channels = 1), - fmt(VK_FORMAT_R4G4_UNORM, UNSUPPORTED), - fmt(VK_FORMAT_R4G4_USCALED, UNSUPPORTED), - fmt(VK_FORMAT_R4G4B4A4_UNORM, UNSUPPORTED), - fmt(VK_FORMAT_R4G4B4A4_USCALED, UNSUPPORTED), - fmt(VK_FORMAT_R5G6B5_UNORM, UNSUPPORTED), - fmt(VK_FORMAT_R5G6B5_USCALED, UNSUPPORTED), - fmt(VK_FORMAT_R5G5B5A1_UNORM, UNSUPPORTED), - fmt(VK_FORMAT_R5G5B5A1_USCALED, UNSUPPORTED), - fmt(VK_FORMAT_R8_UNORM, R8_UNORM, .bs = 1, .num_channels = 1), - fmt(VK_FORMAT_R8_SNORM, R8_SNORM, .bs = 1, .num_channels = 1,), - fmt(VK_FORMAT_R8_USCALED, R8_USCALED, .bs = 1, .num_channels = 1), - fmt(VK_FORMAT_R8_SSCALED, R8_SSCALED, .bs = 1, .num_channels = 1), - fmt(VK_FORMAT_R8_UINT, R8_UINT, .bs = 1, .num_channels = 1), - fmt(VK_FORMAT_R8_SINT, R8_SINT, .bs = 1, .num_channels = 1), - fmt(VK_FORMAT_R8_SRGB, UNSUPPORTED), - fmt(VK_FORMAT_R8G8_UNORM, R8G8_UNORM, .bs = 2, .num_channels = 2), - fmt(VK_FORMAT_R8G8_SNORM, R8G8_SNORM, .bs = 2, .num_channels = 2), - fmt(VK_FORMAT_R8G8_USCALED, R8G8_USCALED, .bs = 2, .num_channels = 2), - fmt(VK_FORMAT_R8G8_SSCALED, R8G8_SSCALED, .bs = 2, .num_channels = 2), - fmt(VK_FORMAT_R8G8_UINT, R8G8_UINT, .bs = 2, .num_channels = 2), - fmt(VK_FORMAT_R8G8_SINT, R8G8_SINT, .bs = 2, .num_channels = 2), - fmt(VK_FORMAT_R8G8_SRGB, UNSUPPORTED), /* L8A8_UNORM_SRGB */ - fmt(VK_FORMAT_R8G8B8_UNORM, R8G8B8X8_UNORM, .bs = 3, .num_channels = 3), - fmt(VK_FORMAT_R8G8B8_SNORM, R8G8B8_SNORM, .bs = 3, .num_channels = 3), - fmt(VK_FORMAT_R8G8B8_USCALED, R8G8B8_USCALED, .bs = 3, .num_channels = 3), - fmt(VK_FORMAT_R8G8B8_SSCALED, R8G8B8_SSCALED, .bs = 3, .num_channels = 3), - fmt(VK_FORMAT_R8G8B8_UINT, R8G8B8_UINT, .bs = 3, .num_channels = 3), - fmt(VK_FORMAT_R8G8B8_SINT, R8G8B8_SINT, .bs = 3, .num_channels = 3), - fmt(VK_FORMAT_R8G8B8_SRGB, UNSUPPORTED), /* B8G8R8A8_UNORM_SRGB */ - fmt(VK_FORMAT_R8G8B8A8_UNORM, R8G8B8A8_UNORM, .bs = 4, .num_channels = 4), - fmt(VK_FORMAT_R8G8B8A8_SNORM, R8G8B8A8_SNORM, .bs = 4, .num_channels = 4), - fmt(VK_FORMAT_R8G8B8A8_USCALED, R8G8B8A8_USCALED, .bs = 4, .num_channels = 4), - fmt(VK_FORMAT_R8G8B8A8_SSCALED, R8G8B8A8_SSCALED, .bs = 4, .num_channels = 4), - fmt(VK_FORMAT_R8G8B8A8_UINT, R8G8B8A8_UINT, .bs = 4, .num_channels = 4), - fmt(VK_FORMAT_R8G8B8A8_SINT, R8G8B8A8_SINT, .bs = 4, .num_channels = 4), - fmt(VK_FORMAT_R8G8B8A8_SRGB, R8G8B8A8_UNORM_SRGB, .bs = 4, .num_channels = 4), - fmt(VK_FORMAT_R10G10B10A2_UNORM, R10G10B10A2_UNORM, .bs = 4, .num_channels = 4), - fmt(VK_FORMAT_R10G10B10A2_SNORM, R10G10B10A2_SNORM, .bs = 4, .num_channels = 4), - fmt(VK_FORMAT_R10G10B10A2_USCALED, R10G10B10A2_USCALED, .bs = 4, .num_channels = 4), - fmt(VK_FORMAT_R10G10B10A2_SSCALED, R10G10B10A2_SSCALED, .bs = 4, .num_channels = 4), - fmt(VK_FORMAT_R10G10B10A2_UINT, R10G10B10A2_UINT, .bs = 4, .num_channels = 4), - fmt(VK_FORMAT_R10G10B10A2_SINT, R10G10B10A2_SINT, .bs = 4, .num_channels = 4), - fmt(VK_FORMAT_R16_UNORM, R16_UNORM, .bs = 2, .num_channels = 1), - fmt(VK_FORMAT_R16_SNORM, R16_SNORM, .bs = 2, .num_channels = 1), - fmt(VK_FORMAT_R16_USCALED, R16_USCALED, .bs = 2, .num_channels = 1), - fmt(VK_FORMAT_R16_SSCALED, R16_SSCALED, .bs = 2, .num_channels = 1), - fmt(VK_FORMAT_R16_UINT, R16_UINT, .bs = 2, .num_channels = 1), - fmt(VK_FORMAT_R16_SINT, R16_SINT, .bs = 2, .num_channels = 1), - fmt(VK_FORMAT_R16_SFLOAT, R16_FLOAT, .bs = 2, .num_channels = 1), - fmt(VK_FORMAT_R16G16_UNORM, R16G16_UNORM, .bs = 4, .num_channels = 2), - fmt(VK_FORMAT_R16G16_SNORM, R16G16_SNORM, .bs = 4, .num_channels = 2), - fmt(VK_FORMAT_R16G16_USCALED, R16G16_USCALED, .bs = 4, .num_channels = 2), - fmt(VK_FORMAT_R16G16_SSCALED, R16G16_SSCALED, .bs = 4, .num_channels = 2), - fmt(VK_FORMAT_R16G16_UINT, R16G16_UINT, .bs = 4, .num_channels = 2), - fmt(VK_FORMAT_R16G16_SINT, R16G16_SINT, .bs = 4, .num_channels = 2), - fmt(VK_FORMAT_R16G16_SFLOAT, R16G16_FLOAT, .bs = 4, .num_channels = 2), - fmt(VK_FORMAT_R16G16B16_UNORM, R16G16B16_UNORM, .bs = 6, .num_channels = 3), - fmt(VK_FORMAT_R16G16B16_SNORM, R16G16B16_SNORM, .bs = 6, .num_channels = 3), - fmt(VK_FORMAT_R16G16B16_USCALED, R16G16B16_USCALED, .bs = 6, .num_channels = 3), - fmt(VK_FORMAT_R16G16B16_SSCALED, R16G16B16_SSCALED, .bs = 6, .num_channels = 3), - fmt(VK_FORMAT_R16G16B16_UINT, R16G16B16_UINT, .bs = 6, .num_channels = 3), - fmt(VK_FORMAT_R16G16B16_SINT, R16G16B16_SINT, .bs = 6, .num_channels = 3), - fmt(VK_FORMAT_R16G16B16_SFLOAT, R16G16B16_FLOAT, .bs = 6, .num_channels = 3), - fmt(VK_FORMAT_R16G16B16A16_UNORM, R16G16B16A16_UNORM, .bs = 8, .num_channels = 4), - fmt(VK_FORMAT_R16G16B16A16_SNORM, R16G16B16A16_SNORM, .bs = 8, .num_channels = 4), - fmt(VK_FORMAT_R16G16B16A16_USCALED, R16G16B16A16_USCALED, .bs = 8, .num_channels = 4), - fmt(VK_FORMAT_R16G16B16A16_SSCALED, R16G16B16A16_SSCALED, .bs = 8, .num_channels = 4), - fmt(VK_FORMAT_R16G16B16A16_UINT, R16G16B16A16_UINT, .bs = 8, .num_channels = 4), - fmt(VK_FORMAT_R16G16B16A16_SINT, R16G16B16A16_SINT, .bs = 8, .num_channels = 4), - fmt(VK_FORMAT_R16G16B16A16_SFLOAT, R16G16B16A16_FLOAT, .bs = 8, .num_channels = 4), - fmt(VK_FORMAT_R32_UINT, R32_UINT, .bs = 4, .num_channels = 1,), - fmt(VK_FORMAT_R32_SINT, R32_SINT, .bs = 4, .num_channels = 1,), - fmt(VK_FORMAT_R32_SFLOAT, R32_FLOAT, .bs = 4, .num_channels = 1,), - fmt(VK_FORMAT_R32G32_UINT, R32G32_UINT, .bs = 8, .num_channels = 2,), - fmt(VK_FORMAT_R32G32_SINT, R32G32_SINT, .bs = 8, .num_channels = 2,), - fmt(VK_FORMAT_R32G32_SFLOAT, R32G32_FLOAT, .bs = 8, .num_channels = 2,), - fmt(VK_FORMAT_R32G32B32_UINT, R32G32B32_UINT, .bs = 12, .num_channels = 3,), - fmt(VK_FORMAT_R32G32B32_SINT, R32G32B32_SINT, .bs = 12, .num_channels = 3,), - fmt(VK_FORMAT_R32G32B32_SFLOAT, R32G32B32_FLOAT, .bs = 12, .num_channels = 3,), - fmt(VK_FORMAT_R32G32B32A32_UINT, R32G32B32A32_UINT, .bs = 16, .num_channels = 4,), - fmt(VK_FORMAT_R32G32B32A32_SINT, R32G32B32A32_SINT, .bs = 16, .num_channels = 4,), - fmt(VK_FORMAT_R32G32B32A32_SFLOAT, R32G32B32A32_FLOAT, .bs = 16, .num_channels = 4,), - fmt(VK_FORMAT_R64_SFLOAT, R64_FLOAT, .bs = 8, .num_channels = 1), - fmt(VK_FORMAT_R64G64_SFLOAT, R64G64_FLOAT, .bs = 16, .num_channels = 2), - fmt(VK_FORMAT_R64G64B64_SFLOAT, R64G64B64_FLOAT, .bs = 24, .num_channels = 3), - fmt(VK_FORMAT_R64G64B64A64_SFLOAT, R64G64B64A64_FLOAT, .bs = 32, .num_channels = 4), - fmt(VK_FORMAT_R11G11B10_UFLOAT, R11G11B10_FLOAT, .bs = 4, .num_channels = 3), - fmt(VK_FORMAT_R9G9B9E5_UFLOAT, R9G9B9E5_SHAREDEXP, .bs = 4, .num_channels = 3), - - fmt(VK_FORMAT_D16_UNORM, R16_UNORM, .bs = 2, .num_channels = 1, .depth_format = D16_UNORM), - fmt(VK_FORMAT_D24_UNORM_X8, R24_UNORM_X8_TYPELESS, .bs = 4, .num_channels = 1, .depth_format = D24_UNORM_X8_UINT), - fmt(VK_FORMAT_D32_SFLOAT, R32_FLOAT, .bs = 4, .num_channels = 1, .depth_format = D32_FLOAT), - fmt(VK_FORMAT_S8_UINT, R8_UINT, .bs = 1, .num_channels = 1, .has_stencil = true), - fmt(VK_FORMAT_D16_UNORM_S8_UINT, R16_UNORM, .bs = 2, .num_channels = 2, .depth_format = D16_UNORM, .has_stencil = true), - fmt(VK_FORMAT_D24_UNORM_S8_UINT, R24_UNORM_X8_TYPELESS, .bs = 4, .num_channels = 2, .depth_format = D24_UNORM_X8_UINT, .has_stencil = true), - fmt(VK_FORMAT_D32_SFLOAT_S8_UINT, R32_FLOAT, .bs = 4, .num_channels = 2, .depth_format = D32_FLOAT, .has_stencil = true), - - fmt(VK_FORMAT_BC1_RGB_UNORM, UNSUPPORTED), - fmt(VK_FORMAT_BC1_RGB_SRGB, UNSUPPORTED), - fmt(VK_FORMAT_BC1_RGBA_UNORM, UNSUPPORTED), - fmt(VK_FORMAT_BC1_RGBA_SRGB, UNSUPPORTED), - fmt(VK_FORMAT_BC2_UNORM, UNSUPPORTED), - fmt(VK_FORMAT_BC2_SRGB, UNSUPPORTED), - fmt(VK_FORMAT_BC3_UNORM, UNSUPPORTED), - fmt(VK_FORMAT_BC3_SRGB, UNSUPPORTED), - fmt(VK_FORMAT_BC4_UNORM, UNSUPPORTED), - fmt(VK_FORMAT_BC4_SNORM, UNSUPPORTED), - fmt(VK_FORMAT_BC5_UNORM, UNSUPPORTED), - fmt(VK_FORMAT_BC5_SNORM, UNSUPPORTED), - fmt(VK_FORMAT_BC6H_UFLOAT, UNSUPPORTED), - fmt(VK_FORMAT_BC6H_SFLOAT, UNSUPPORTED), - fmt(VK_FORMAT_BC7_UNORM, UNSUPPORTED), - fmt(VK_FORMAT_BC7_SRGB, UNSUPPORTED), - fmt(VK_FORMAT_ETC2_R8G8B8_UNORM, ETC2_RGB8 , .bs = 8, .bw = 4, .bh = 4), - fmt(VK_FORMAT_ETC2_R8G8B8_SRGB, ETC2_SRGB8 , .bs = 8, .bw = 4, .bh = 4), - fmt(VK_FORMAT_ETC2_R8G8B8A1_UNORM, ETC2_RGB8_PTA , .bs = 8, .bw = 4, .bh = 4), - fmt(VK_FORMAT_ETC2_R8G8B8A1_SRGB, ETC2_SRGB8_PTA , .bs = 8, .bw = 4, .bh = 4), - fmt(VK_FORMAT_ETC2_R8G8B8A8_UNORM, ETC2_EAC_RGBA8 , .bs = 16, .bw = 4, .bh = 4), - fmt(VK_FORMAT_ETC2_R8G8B8A8_SRGB, ETC2_EAC_SRGB8_A8, .bs = 16, .bw = 4, .bh = 4), - fmt(VK_FORMAT_EAC_R11_UNORM, EAC_R11 , .bs = 8, .bw = 4, .bh = 4), - fmt(VK_FORMAT_EAC_R11_SNORM, EAC_SIGNED_R11 , .bs = 8, .bw = 4, .bh = 4), - fmt(VK_FORMAT_EAC_R11G11_UNORM, EAC_RG11 , .bs = 16, .bw = 4, .bh = 4), - fmt(VK_FORMAT_EAC_R11G11_SNORM, EAC_SIGNED_RG11 , .bs = 16, .bw = 4, .bh = 4), - fmt(VK_FORMAT_ASTC_4x4_UNORM, UNSUPPORTED), - fmt(VK_FORMAT_ASTC_4x4_SRGB, UNSUPPORTED), - fmt(VK_FORMAT_ASTC_5x4_UNORM, UNSUPPORTED), - fmt(VK_FORMAT_ASTC_5x4_SRGB, UNSUPPORTED), - fmt(VK_FORMAT_ASTC_5x5_UNORM, UNSUPPORTED), - fmt(VK_FORMAT_ASTC_5x5_SRGB, UNSUPPORTED), - fmt(VK_FORMAT_ASTC_6x5_UNORM, UNSUPPORTED), - fmt(VK_FORMAT_ASTC_6x5_SRGB, UNSUPPORTED), - fmt(VK_FORMAT_ASTC_6x6_UNORM, UNSUPPORTED), - fmt(VK_FORMAT_ASTC_6x6_SRGB, UNSUPPORTED), - fmt(VK_FORMAT_ASTC_8x5_UNORM, UNSUPPORTED), - fmt(VK_FORMAT_ASTC_8x5_SRGB, UNSUPPORTED), - fmt(VK_FORMAT_ASTC_8x6_UNORM, UNSUPPORTED), - fmt(VK_FORMAT_ASTC_8x6_SRGB, UNSUPPORTED), - fmt(VK_FORMAT_ASTC_8x8_UNORM, UNSUPPORTED), - fmt(VK_FORMAT_ASTC_8x8_SRGB, UNSUPPORTED), - fmt(VK_FORMAT_ASTC_10x5_UNORM, UNSUPPORTED), - fmt(VK_FORMAT_ASTC_10x5_SRGB, UNSUPPORTED), - fmt(VK_FORMAT_ASTC_10x6_UNORM, UNSUPPORTED), - fmt(VK_FORMAT_ASTC_10x6_SRGB, UNSUPPORTED), - fmt(VK_FORMAT_ASTC_10x8_UNORM, UNSUPPORTED), - fmt(VK_FORMAT_ASTC_10x8_SRGB, UNSUPPORTED), - fmt(VK_FORMAT_ASTC_10x10_UNORM, UNSUPPORTED), - fmt(VK_FORMAT_ASTC_10x10_SRGB, UNSUPPORTED), - fmt(VK_FORMAT_ASTC_12x10_UNORM, UNSUPPORTED), - fmt(VK_FORMAT_ASTC_12x10_SRGB, UNSUPPORTED), - fmt(VK_FORMAT_ASTC_12x12_UNORM, UNSUPPORTED), - fmt(VK_FORMAT_ASTC_12x12_SRGB, UNSUPPORTED), - fmt(VK_FORMAT_B4G4R4A4_UNORM, B4G4R4A4_UNORM, .bs = 2, .num_channels = 4), - fmt(VK_FORMAT_B5G5R5A1_UNORM, B5G5R5A1_UNORM, .bs = 2, .num_channels = 4), - fmt(VK_FORMAT_B5G6R5_UNORM, B5G6R5_UNORM, .bs = 2, .num_channels = 3), - fmt(VK_FORMAT_B5G6R5_USCALED, UNSUPPORTED), - fmt(VK_FORMAT_B8G8R8_UNORM, UNSUPPORTED), - fmt(VK_FORMAT_B8G8R8_SNORM, UNSUPPORTED), - fmt(VK_FORMAT_B8G8R8_USCALED, UNSUPPORTED), - fmt(VK_FORMAT_B8G8R8_SSCALED, UNSUPPORTED), - fmt(VK_FORMAT_B8G8R8_UINT, UNSUPPORTED), - fmt(VK_FORMAT_B8G8R8_SINT, UNSUPPORTED), - fmt(VK_FORMAT_B8G8R8_SRGB, UNSUPPORTED), - fmt(VK_FORMAT_B8G8R8A8_UNORM, B8G8R8A8_UNORM, .bs = 4, .num_channels = 4), - fmt(VK_FORMAT_B8G8R8A8_SNORM, UNSUPPORTED), - fmt(VK_FORMAT_B8G8R8A8_USCALED, UNSUPPORTED), - fmt(VK_FORMAT_B8G8R8A8_SSCALED, UNSUPPORTED), - fmt(VK_FORMAT_B8G8R8A8_UINT, UNSUPPORTED), - fmt(VK_FORMAT_B8G8R8A8_SINT, UNSUPPORTED), - fmt(VK_FORMAT_B8G8R8A8_SRGB, B8G8R8A8_UNORM_SRGB, .bs = 4, .num_channels = 4), - fmt(VK_FORMAT_B10G10R10A2_UNORM, B10G10R10A2_UNORM, .bs = 4, .num_channels = 4), - fmt(VK_FORMAT_B10G10R10A2_SNORM, B10G10R10A2_SNORM, .bs = 4, .num_channels = 4), - fmt(VK_FORMAT_B10G10R10A2_USCALED, B10G10R10A2_USCALED, .bs = 4, .num_channels = 4), - fmt(VK_FORMAT_B10G10R10A2_SSCALED, B10G10R10A2_SSCALED, .bs = 4, .num_channels = 4), - fmt(VK_FORMAT_B10G10R10A2_UINT, B10G10R10A2_UINT, .bs = 4, .num_channels = 4), - fmt(VK_FORMAT_B10G10R10A2_SINT, B10G10R10A2_SINT, .bs = 4, .num_channels = 4) + fmt(VK_FORMAT_UNDEFINED, ISL_FORMAT_RAW, .bs = 1, .num_channels = 1), + fmt(VK_FORMAT_R4G4_UNORM, ISL_FORMAT_UNSUPPORTED), + fmt(VK_FORMAT_R4G4_USCALED, ISL_FORMAT_UNSUPPORTED), + fmt(VK_FORMAT_R4G4B4A4_UNORM, ISL_FORMAT_UNSUPPORTED), + fmt(VK_FORMAT_R4G4B4A4_USCALED, ISL_FORMAT_UNSUPPORTED), + fmt(VK_FORMAT_R5G6B5_UNORM, ISL_FORMAT_UNSUPPORTED), + fmt(VK_FORMAT_R5G6B5_USCALED, ISL_FORMAT_UNSUPPORTED), + fmt(VK_FORMAT_R5G5B5A1_UNORM, ISL_FORMAT_UNSUPPORTED), + fmt(VK_FORMAT_R5G5B5A1_USCALED, ISL_FORMAT_UNSUPPORTED), + fmt(VK_FORMAT_R8_UNORM, ISL_FORMAT_R8_UNORM, .bs = 1, .num_channels = 1), + fmt(VK_FORMAT_R8_SNORM, ISL_FORMAT_R8_SNORM, .bs = 1, .num_channels = 1,), + fmt(VK_FORMAT_R8_USCALED, ISL_FORMAT_R8_USCALED, .bs = 1, .num_channels = 1), + fmt(VK_FORMAT_R8_SSCALED, ISL_FORMAT_R8_SSCALED, .bs = 1, .num_channels = 1), + fmt(VK_FORMAT_R8_UINT, ISL_FORMAT_R8_UINT, .bs = 1, .num_channels = 1), + fmt(VK_FORMAT_R8_SINT, ISL_FORMAT_R8_SINT, .bs = 1, .num_channels = 1), + fmt(VK_FORMAT_R8_SRGB, ISL_FORMAT_UNSUPPORTED), + fmt(VK_FORMAT_R8G8_UNORM, ISL_FORMAT_R8G8_UNORM, .bs = 2, .num_channels = 2), + fmt(VK_FORMAT_R8G8_SNORM, ISL_FORMAT_R8G8_SNORM, .bs = 2, .num_channels = 2), + fmt(VK_FORMAT_R8G8_USCALED, ISL_FORMAT_R8G8_USCALED, .bs = 2, .num_channels = 2), + fmt(VK_FORMAT_R8G8_SSCALED, ISL_FORMAT_R8G8_SSCALED, .bs = 2, .num_channels = 2), + fmt(VK_FORMAT_R8G8_UINT, ISL_FORMAT_R8G8_UINT, .bs = 2, .num_channels = 2), + fmt(VK_FORMAT_R8G8_SINT, ISL_FORMAT_R8G8_SINT, .bs = 2, .num_channels = 2), + fmt(VK_FORMAT_R8G8_SRGB, ISL_FORMAT_UNSUPPORTED), /* L8A8_UNORM_SRGB */ + fmt(VK_FORMAT_R8G8B8_UNORM, ISL_FORMAT_R8G8B8X8_UNORM, .bs = 3, .num_channels = 3), + fmt(VK_FORMAT_R8G8B8_SNORM, ISL_FORMAT_R8G8B8_SNORM, .bs = 3, .num_channels = 3), + fmt(VK_FORMAT_R8G8B8_USCALED, ISL_FORMAT_R8G8B8_USCALED, .bs = 3, .num_channels = 3), + fmt(VK_FORMAT_R8G8B8_SSCALED, ISL_FORMAT_R8G8B8_SSCALED, .bs = 3, .num_channels = 3), + fmt(VK_FORMAT_R8G8B8_UINT, ISL_FORMAT_R8G8B8_UINT, .bs = 3, .num_channels = 3), + fmt(VK_FORMAT_R8G8B8_SINT, ISL_FORMAT_R8G8B8_SINT, .bs = 3, .num_channels = 3), + fmt(VK_FORMAT_R8G8B8_SRGB, ISL_FORMAT_UNSUPPORTED), /* B8G8R8A8_UNORM_SRGB */ + fmt(VK_FORMAT_R8G8B8A8_UNORM, ISL_FORMAT_R8G8B8A8_UNORM, .bs = 4, .num_channels = 4), + fmt(VK_FORMAT_R8G8B8A8_SNORM, ISL_FORMAT_R8G8B8A8_SNORM, .bs = 4, .num_channels = 4), + fmt(VK_FORMAT_R8G8B8A8_USCALED, ISL_FORMAT_R8G8B8A8_USCALED, .bs = 4, .num_channels = 4), + fmt(VK_FORMAT_R8G8B8A8_SSCALED, ISL_FORMAT_R8G8B8A8_SSCALED, .bs = 4, .num_channels = 4), + fmt(VK_FORMAT_R8G8B8A8_UINT, ISL_FORMAT_R8G8B8A8_UINT, .bs = 4, .num_channels = 4), + fmt(VK_FORMAT_R8G8B8A8_SINT, ISL_FORMAT_R8G8B8A8_SINT, .bs = 4, .num_channels = 4), + fmt(VK_FORMAT_R8G8B8A8_SRGB, ISL_FORMAT_R8G8B8A8_UNORM_SRGB, .bs = 4, .num_channels = 4), + fmt(VK_FORMAT_R10G10B10A2_UNORM, ISL_FORMAT_R10G10B10A2_UNORM, .bs = 4, .num_channels = 4), + fmt(VK_FORMAT_R10G10B10A2_SNORM, ISL_FORMAT_R10G10B10A2_SNORM, .bs = 4, .num_channels = 4), + fmt(VK_FORMAT_R10G10B10A2_USCALED, ISL_FORMAT_R10G10B10A2_USCALED, .bs = 4, .num_channels = 4), + fmt(VK_FORMAT_R10G10B10A2_SSCALED, ISL_FORMAT_R10G10B10A2_SSCALED, .bs = 4, .num_channels = 4), + fmt(VK_FORMAT_R10G10B10A2_UINT, ISL_FORMAT_R10G10B10A2_UINT, .bs = 4, .num_channels = 4), + fmt(VK_FORMAT_R10G10B10A2_SINT, ISL_FORMAT_R10G10B10A2_SINT, .bs = 4, .num_channels = 4), + fmt(VK_FORMAT_R16_UNORM, ISL_FORMAT_R16_UNORM, .bs = 2, .num_channels = 1), + fmt(VK_FORMAT_R16_SNORM, ISL_FORMAT_R16_SNORM, .bs = 2, .num_channels = 1), + fmt(VK_FORMAT_R16_USCALED, ISL_FORMAT_R16_USCALED, .bs = 2, .num_channels = 1), + fmt(VK_FORMAT_R16_SSCALED, ISL_FORMAT_R16_SSCALED, .bs = 2, .num_channels = 1), + fmt(VK_FORMAT_R16_UINT, ISL_FORMAT_R16_UINT, .bs = 2, .num_channels = 1), + fmt(VK_FORMAT_R16_SINT, ISL_FORMAT_R16_SINT, .bs = 2, .num_channels = 1), + fmt(VK_FORMAT_R16_SFLOAT, ISL_FORMAT_R16_FLOAT, .bs = 2, .num_channels = 1), + fmt(VK_FORMAT_R16G16_UNORM, ISL_FORMAT_R16G16_UNORM, .bs = 4, .num_channels = 2), + fmt(VK_FORMAT_R16G16_SNORM, ISL_FORMAT_R16G16_SNORM, .bs = 4, .num_channels = 2), + fmt(VK_FORMAT_R16G16_USCALED, ISL_FORMAT_R16G16_USCALED, .bs = 4, .num_channels = 2), + fmt(VK_FORMAT_R16G16_SSCALED, ISL_FORMAT_R16G16_SSCALED, .bs = 4, .num_channels = 2), + fmt(VK_FORMAT_R16G16_UINT, ISL_FORMAT_R16G16_UINT, .bs = 4, .num_channels = 2), + fmt(VK_FORMAT_R16G16_SINT, ISL_FORMAT_R16G16_SINT, .bs = 4, .num_channels = 2), + fmt(VK_FORMAT_R16G16_SFLOAT, ISL_FORMAT_R16G16_FLOAT, .bs = 4, .num_channels = 2), + fmt(VK_FORMAT_R16G16B16_UNORM, ISL_FORMAT_R16G16B16_UNORM, .bs = 6, .num_channels = 3), + fmt(VK_FORMAT_R16G16B16_SNORM, ISL_FORMAT_R16G16B16_SNORM, .bs = 6, .num_channels = 3), + fmt(VK_FORMAT_R16G16B16_USCALED, ISL_FORMAT_R16G16B16_USCALED, .bs = 6, .num_channels = 3), + fmt(VK_FORMAT_R16G16B16_SSCALED, ISL_FORMAT_R16G16B16_SSCALED, .bs = 6, .num_channels = 3), + fmt(VK_FORMAT_R16G16B16_UINT, ISL_FORMAT_R16G16B16_UINT, .bs = 6, .num_channels = 3), + fmt(VK_FORMAT_R16G16B16_SINT, ISL_FORMAT_R16G16B16_SINT, .bs = 6, .num_channels = 3), + fmt(VK_FORMAT_R16G16B16_SFLOAT, ISL_FORMAT_R16G16B16_FLOAT, .bs = 6, .num_channels = 3), + fmt(VK_FORMAT_R16G16B16A16_UNORM, ISL_FORMAT_R16G16B16A16_UNORM, .bs = 8, .num_channels = 4), + fmt(VK_FORMAT_R16G16B16A16_SNORM, ISL_FORMAT_R16G16B16A16_SNORM, .bs = 8, .num_channels = 4), + fmt(VK_FORMAT_R16G16B16A16_USCALED, ISL_FORMAT_R16G16B16A16_USCALED, .bs = 8, .num_channels = 4), + fmt(VK_FORMAT_R16G16B16A16_SSCALED, ISL_FORMAT_R16G16B16A16_SSCALED, .bs = 8, .num_channels = 4), + fmt(VK_FORMAT_R16G16B16A16_UINT, ISL_FORMAT_R16G16B16A16_UINT, .bs = 8, .num_channels = 4), + fmt(VK_FORMAT_R16G16B16A16_SINT, ISL_FORMAT_R16G16B16A16_SINT, .bs = 8, .num_channels = 4), + fmt(VK_FORMAT_R16G16B16A16_SFLOAT, ISL_FORMAT_R16G16B16A16_FLOAT, .bs = 8, .num_channels = 4), + fmt(VK_FORMAT_R32_UINT, ISL_FORMAT_R32_UINT, .bs = 4, .num_channels = 1,), + fmt(VK_FORMAT_R32_SINT, ISL_FORMAT_R32_SINT, .bs = 4, .num_channels = 1,), + fmt(VK_FORMAT_R32_SFLOAT, ISL_FORMAT_R32_FLOAT, .bs = 4, .num_channels = 1,), + fmt(VK_FORMAT_R32G32_UINT, ISL_FORMAT_R32G32_UINT, .bs = 8, .num_channels = 2,), + fmt(VK_FORMAT_R32G32_SINT, ISL_FORMAT_R32G32_SINT, .bs = 8, .num_channels = 2,), + fmt(VK_FORMAT_R32G32_SFLOAT, ISL_FORMAT_R32G32_FLOAT, .bs = 8, .num_channels = 2,), + fmt(VK_FORMAT_R32G32B32_UINT, ISL_FORMAT_R32G32B32_UINT, .bs = 12, .num_channels = 3,), + fmt(VK_FORMAT_R32G32B32_SINT, ISL_FORMAT_R32G32B32_SINT, .bs = 12, .num_channels = 3,), + fmt(VK_FORMAT_R32G32B32_SFLOAT, ISL_FORMAT_R32G32B32_FLOAT, .bs = 12, .num_channels = 3,), + fmt(VK_FORMAT_R32G32B32A32_UINT, ISL_FORMAT_R32G32B32A32_UINT, .bs = 16, .num_channels = 4,), + fmt(VK_FORMAT_R32G32B32A32_SINT, ISL_FORMAT_R32G32B32A32_SINT, .bs = 16, .num_channels = 4,), + fmt(VK_FORMAT_R32G32B32A32_SFLOAT, ISL_FORMAT_R32G32B32A32_FLOAT, .bs = 16, .num_channels = 4,), + fmt(VK_FORMAT_R64_SFLOAT, ISL_FORMAT_R64_FLOAT, .bs = 8, .num_channels = 1), + fmt(VK_FORMAT_R64G64_SFLOAT, ISL_FORMAT_R64G64_FLOAT, .bs = 16, .num_channels = 2), + fmt(VK_FORMAT_R64G64B64_SFLOAT, ISL_FORMAT_R64G64B64_FLOAT, .bs = 24, .num_channels = 3), + fmt(VK_FORMAT_R64G64B64A64_SFLOAT, ISL_FORMAT_R64G64B64A64_FLOAT, .bs = 32, .num_channels = 4), + fmt(VK_FORMAT_R11G11B10_UFLOAT, ISL_FORMAT_R11G11B10_FLOAT, .bs = 4, .num_channels = 3), + fmt(VK_FORMAT_R9G9B9E5_UFLOAT, ISL_FORMAT_R9G9B9E5_SHAREDEXP, .bs = 4, .num_channels = 3), + + fmt(VK_FORMAT_D16_UNORM, ISL_FORMAT_R16_UNORM, .bs = 2, .num_channels = 1, .depth_format = D16_UNORM), + fmt(VK_FORMAT_D24_UNORM_X8, ISL_FORMAT_R24_UNORM_X8_TYPELESS, .bs = 4, .num_channels = 1, .depth_format = D24_UNORM_X8_UINT), + fmt(VK_FORMAT_D32_SFLOAT, ISL_FORMAT_R32_FLOAT, .bs = 4, .num_channels = 1, .depth_format = D32_FLOAT), + fmt(VK_FORMAT_S8_UINT, ISL_FORMAT_R8_UINT, .bs = 1, .num_channels = 1, .has_stencil = true), + fmt(VK_FORMAT_D16_UNORM_S8_UINT, ISL_FORMAT_R16_UNORM, .bs = 2, .num_channels = 2, .depth_format = D16_UNORM, .has_stencil = true), + fmt(VK_FORMAT_D24_UNORM_S8_UINT, ISL_FORMAT_R24_UNORM_X8_TYPELESS, .bs = 4, .num_channels = 2, .depth_format = D24_UNORM_X8_UINT, .has_stencil = true), + fmt(VK_FORMAT_D32_SFLOAT_S8_UINT, ISL_FORMAT_R32_FLOAT, .bs = 4, .num_channels = 2, .depth_format = D32_FLOAT, .has_stencil = true), + + fmt(VK_FORMAT_BC1_RGB_UNORM, ISL_FORMAT_UNSUPPORTED), + fmt(VK_FORMAT_BC1_RGB_SRGB, ISL_FORMAT_UNSUPPORTED), + fmt(VK_FORMAT_BC1_RGBA_UNORM, ISL_FORMAT_UNSUPPORTED), + fmt(VK_FORMAT_BC1_RGBA_SRGB, ISL_FORMAT_UNSUPPORTED), + fmt(VK_FORMAT_BC2_UNORM, ISL_FORMAT_UNSUPPORTED), + fmt(VK_FORMAT_BC2_SRGB, ISL_FORMAT_UNSUPPORTED), + fmt(VK_FORMAT_BC3_UNORM, ISL_FORMAT_UNSUPPORTED), + fmt(VK_FORMAT_BC3_SRGB, ISL_FORMAT_UNSUPPORTED), + fmt(VK_FORMAT_BC4_UNORM, ISL_FORMAT_UNSUPPORTED), + fmt(VK_FORMAT_BC4_SNORM, ISL_FORMAT_UNSUPPORTED), + fmt(VK_FORMAT_BC5_UNORM, ISL_FORMAT_UNSUPPORTED), + fmt(VK_FORMAT_BC5_SNORM, ISL_FORMAT_UNSUPPORTED), + fmt(VK_FORMAT_BC6H_UFLOAT, ISL_FORMAT_UNSUPPORTED), + fmt(VK_FORMAT_BC6H_SFLOAT, ISL_FORMAT_UNSUPPORTED), + fmt(VK_FORMAT_BC7_UNORM, ISL_FORMAT_UNSUPPORTED), + fmt(VK_FORMAT_BC7_SRGB, ISL_FORMAT_UNSUPPORTED), + fmt(VK_FORMAT_ETC2_R8G8B8_UNORM, ISL_FORMAT_ETC2_RGB8 , .bs = 8, .bw = 4, .bh = 4), + fmt(VK_FORMAT_ETC2_R8G8B8_SRGB, ISL_FORMAT_ETC2_SRGB8 , .bs = 8, .bw = 4, .bh = 4), + fmt(VK_FORMAT_ETC2_R8G8B8A1_UNORM, ISL_FORMAT_ETC2_RGB8_PTA , .bs = 8, .bw = 4, .bh = 4), + fmt(VK_FORMAT_ETC2_R8G8B8A1_SRGB, ISL_FORMAT_ETC2_SRGB8_PTA , .bs = 8, .bw = 4, .bh = 4), + fmt(VK_FORMAT_ETC2_R8G8B8A8_UNORM, ISL_FORMAT_ETC2_EAC_RGBA8 , .bs = 16, .bw = 4, .bh = 4), + fmt(VK_FORMAT_ETC2_R8G8B8A8_SRGB, ISL_FORMAT_ETC2_EAC_SRGB8_A8, .bs = 16, .bw = 4, .bh = 4), + fmt(VK_FORMAT_EAC_R11_UNORM, ISL_FORMAT_EAC_R11 , .bs = 8, .bw = 4, .bh = 4), + fmt(VK_FORMAT_EAC_R11_SNORM, ISL_FORMAT_EAC_SIGNED_R11 , .bs = 8, .bw = 4, .bh = 4), + fmt(VK_FORMAT_EAC_R11G11_UNORM, ISL_FORMAT_EAC_RG11 , .bs = 16, .bw = 4, .bh = 4), + fmt(VK_FORMAT_EAC_R11G11_SNORM, ISL_FORMAT_EAC_SIGNED_RG11 , .bs = 16, .bw = 4, .bh = 4), + fmt(VK_FORMAT_ASTC_4x4_UNORM, ISL_FORMAT_UNSUPPORTED), + fmt(VK_FORMAT_ASTC_4x4_SRGB, ISL_FORMAT_UNSUPPORTED), + fmt(VK_FORMAT_ASTC_5x4_UNORM, ISL_FORMAT_UNSUPPORTED), + fmt(VK_FORMAT_ASTC_5x4_SRGB, ISL_FORMAT_UNSUPPORTED), + fmt(VK_FORMAT_ASTC_5x5_UNORM, ISL_FORMAT_UNSUPPORTED), + fmt(VK_FORMAT_ASTC_5x5_SRGB, ISL_FORMAT_UNSUPPORTED), + fmt(VK_FORMAT_ASTC_6x5_UNORM, ISL_FORMAT_UNSUPPORTED), + fmt(VK_FORMAT_ASTC_6x5_SRGB, ISL_FORMAT_UNSUPPORTED), + fmt(VK_FORMAT_ASTC_6x6_UNORM, ISL_FORMAT_UNSUPPORTED), + fmt(VK_FORMAT_ASTC_6x6_SRGB, ISL_FORMAT_UNSUPPORTED), + fmt(VK_FORMAT_ASTC_8x5_UNORM, ISL_FORMAT_UNSUPPORTED), + fmt(VK_FORMAT_ASTC_8x5_SRGB, ISL_FORMAT_UNSUPPORTED), + fmt(VK_FORMAT_ASTC_8x6_UNORM, ISL_FORMAT_UNSUPPORTED), + fmt(VK_FORMAT_ASTC_8x6_SRGB, ISL_FORMAT_UNSUPPORTED), + fmt(VK_FORMAT_ASTC_8x8_UNORM, ISL_FORMAT_UNSUPPORTED), + fmt(VK_FORMAT_ASTC_8x8_SRGB, ISL_FORMAT_UNSUPPORTED), + fmt(VK_FORMAT_ASTC_10x5_UNORM, ISL_FORMAT_UNSUPPORTED), + fmt(VK_FORMAT_ASTC_10x5_SRGB, ISL_FORMAT_UNSUPPORTED), + fmt(VK_FORMAT_ASTC_10x6_UNORM, ISL_FORMAT_UNSUPPORTED), + fmt(VK_FORMAT_ASTC_10x6_SRGB, ISL_FORMAT_UNSUPPORTED), + fmt(VK_FORMAT_ASTC_10x8_UNORM, ISL_FORMAT_UNSUPPORTED), + fmt(VK_FORMAT_ASTC_10x8_SRGB, ISL_FORMAT_UNSUPPORTED), + fmt(VK_FORMAT_ASTC_10x10_UNORM, ISL_FORMAT_UNSUPPORTED), + fmt(VK_FORMAT_ASTC_10x10_SRGB, ISL_FORMAT_UNSUPPORTED), + fmt(VK_FORMAT_ASTC_12x10_UNORM, ISL_FORMAT_UNSUPPORTED), + fmt(VK_FORMAT_ASTC_12x10_SRGB, ISL_FORMAT_UNSUPPORTED), + fmt(VK_FORMAT_ASTC_12x12_UNORM, ISL_FORMAT_UNSUPPORTED), + fmt(VK_FORMAT_ASTC_12x12_SRGB, ISL_FORMAT_UNSUPPORTED), + fmt(VK_FORMAT_B4G4R4A4_UNORM, ISL_FORMAT_B4G4R4A4_UNORM, .bs = 2, .num_channels = 4), + fmt(VK_FORMAT_B5G5R5A1_UNORM, ISL_FORMAT_B5G5R5A1_UNORM, .bs = 2, .num_channels = 4), + fmt(VK_FORMAT_B5G6R5_UNORM, ISL_FORMAT_B5G6R5_UNORM, .bs = 2, .num_channels = 3), + fmt(VK_FORMAT_B5G6R5_USCALED, ISL_FORMAT_UNSUPPORTED), + fmt(VK_FORMAT_B8G8R8_UNORM, ISL_FORMAT_UNSUPPORTED), + fmt(VK_FORMAT_B8G8R8_SNORM, ISL_FORMAT_UNSUPPORTED), + fmt(VK_FORMAT_B8G8R8_USCALED, ISL_FORMAT_UNSUPPORTED), + fmt(VK_FORMAT_B8G8R8_SSCALED, ISL_FORMAT_UNSUPPORTED), + fmt(VK_FORMAT_B8G8R8_UINT, ISL_FORMAT_UNSUPPORTED), + fmt(VK_FORMAT_B8G8R8_SINT, ISL_FORMAT_UNSUPPORTED), + fmt(VK_FORMAT_B8G8R8_SRGB, ISL_FORMAT_UNSUPPORTED), + fmt(VK_FORMAT_B8G8R8A8_UNORM, ISL_FORMAT_B8G8R8A8_UNORM, .bs = 4, .num_channels = 4), + fmt(VK_FORMAT_B8G8R8A8_SNORM, ISL_FORMAT_UNSUPPORTED), + fmt(VK_FORMAT_B8G8R8A8_USCALED, ISL_FORMAT_UNSUPPORTED), + fmt(VK_FORMAT_B8G8R8A8_SSCALED, ISL_FORMAT_UNSUPPORTED), + fmt(VK_FORMAT_B8G8R8A8_UINT, ISL_FORMAT_UNSUPPORTED), + fmt(VK_FORMAT_B8G8R8A8_SINT, ISL_FORMAT_UNSUPPORTED), + fmt(VK_FORMAT_B8G8R8A8_SRGB, ISL_FORMAT_B8G8R8A8_UNORM_SRGB, .bs = 4, .num_channels = 4), + fmt(VK_FORMAT_B10G10R10A2_UNORM, ISL_FORMAT_B10G10R10A2_UNORM, .bs = 4, .num_channels = 4), + fmt(VK_FORMAT_B10G10R10A2_SNORM, ISL_FORMAT_B10G10R10A2_SNORM, .bs = 4, .num_channels = 4), + fmt(VK_FORMAT_B10G10R10A2_USCALED, ISL_FORMAT_B10G10R10A2_USCALED, .bs = 4, .num_channels = 4), + fmt(VK_FORMAT_B10G10R10A2_SSCALED, ISL_FORMAT_B10G10R10A2_SSCALED, .bs = 4, .num_channels = 4), + fmt(VK_FORMAT_B10G10R10A2_UINT, ISL_FORMAT_B10G10R10A2_UINT, .bs = 4, .num_channels = 4), + fmt(VK_FORMAT_B10G10R10A2_SINT, ISL_FORMAT_B10G10R10A2_SINT, .bs = 4, .num_channels = 4) }; #undef fmt @@ -246,7 +244,7 @@ anv_physical_device_get_format_properties(struct anv_physical_device *physical_d if (physical_device->info->is_haswell) gen += 5; - if (format->surface_format == UNSUPPORTED) + if (format->surface_format == ISL_FORMAT_UNSUPPORTED) goto unsupported; uint32_t linear = 0, tiled = 0; diff --git a/src/vulkan/anv_private.h b/src/vulkan/anv_private.h index a60c679cede..4495499eda1 100644 --- a/src/vulkan/anv_private.h +++ b/src/vulkan/anv_private.h @@ -50,8 +50,8 @@ #include #include "anv_entrypoints.h" - #include "brw_context.h" +#include "isl.h" #ifdef __cplusplus extern "C" { @@ -1208,7 +1208,7 @@ gen8_compute_pipeline_create(VkDevice _device, struct anv_format { const VkFormat vk_format; const char *name; - uint16_t surface_format; /**< RENDER_SURFACE_STATE.SurfaceFormat */ + enum isl_format surface_format; /**< RENDER_SURFACE_STATE.SurfaceFormat */ uint8_t bs; /**< Block size (in bytes) of anv_format::surface_format. */ uint8_t bw; /**< Block width of anv_format::surface_format. */ uint8_t bh; /**< Block height of anv_format::surface_format. */ -- 2.30.2