vk/formats: Rename anv_format::format -> surface_format
authorChad Versace <chad.versace@intel.com>
Fri, 26 Jun 2015 01:18:06 +0000 (18:18 -0700)
committerChad Versace <chad.versace@intel.com>
Fri, 26 Jun 2015 03:10:16 +0000 (20:10 -0700)
I misinterpreted anv_format::format as a VkFormat. Instead, it is
a hardware surface format (RENDER_SURFACE_STATE.SurfaceFormat). Rename
the field to 'surface_format' to make it unambiguous.

src/vulkan/device.c
src/vulkan/formats.c
src/vulkan/image.c
src/vulkan/pipeline.c
src/vulkan/private.h

index c9e66743def94d245bdc738cf799f7570c512385..3c5691f3cb3d3a71f2ac55e4c6499d1a64d7001d 100644 (file)
@@ -1517,7 +1517,7 @@ fill_buffer_surface_state(void *state, VkFormat format,
    struct GEN8_RENDER_SURFACE_STATE surface_state = {
       .SurfaceType = SURFTYPE_BUFFER,
       .SurfaceArray = false,
-      .SurfaceFormat = info->format,
+      .SurfaceFormat = info->surface_format,
       .SurfaceVerticalAlignment = VALIGN4,
       .SurfaceHorizontalAlignment = HALIGN4,
       .TileMode = LINEAR,
index d0ee51360ddee3e756d13d3e9be9aa8b15ac6fe4..d93802b23e1522554990f8362adcd3efdf339f62 100644 (file)
    [__vk_fmt] = { .name = #__vk_fmt, __VA_ARGS__ }
 
 static const struct anv_format anv_formats[] = {
-   fmt(VK_FORMAT_UNDEFINED, .format = RAW, .cpp = 1, .num_channels = 1),
-   fmt(VK_FORMAT_R4G4_UNORM, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_R4G4_USCALED, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_R4G4B4A4_UNORM, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_R4G4B4A4_USCALED, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_R5G6B5_UNORM, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_R5G6B5_USCALED, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_R5G5B5A1_UNORM, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_R5G5B5A1_USCALED, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_R8_UNORM, .format = R8_UNORM, .cpp = 1, .num_channels = 1),
-   fmt(VK_FORMAT_R8_SNORM, .format = R8_SNORM, .cpp = 1, .num_channels = 1,),
-   fmt(VK_FORMAT_R8_USCALED, .format = R8_USCALED, .cpp = 1, .num_channels = 1),
-   fmt(VK_FORMAT_R8_SSCALED, .format = R8_SSCALED, .cpp = 1, .num_channels = 1),
-   fmt(VK_FORMAT_R8_UINT, .format = R8_UINT, .cpp = 1, .num_channels = 1),
-   fmt(VK_FORMAT_R8_SINT, .format = R8_SINT, .cpp = 1, .num_channels = 1),
-   fmt(VK_FORMAT_R8_SRGB, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_R8G8_UNORM, .format = R8G8_UNORM, .cpp = 2, .num_channels = 2),
-   fmt(VK_FORMAT_R8G8_SNORM, .format = R8G8_SNORM, .cpp = 2, .num_channels = 2),
-   fmt(VK_FORMAT_R8G8_USCALED, .format = R8G8_USCALED, .cpp = 2, .num_channels = 2),
-   fmt(VK_FORMAT_R8G8_SSCALED, .format = R8G8_SSCALED, .cpp = 2, .num_channels = 2),
-   fmt(VK_FORMAT_R8G8_UINT, .format = R8G8_UINT, .cpp = 2, .num_channels = 2),
-   fmt(VK_FORMAT_R8G8_SINT, .format = R8G8_SINT, .cpp = 2, .num_channels = 2),
-   fmt(VK_FORMAT_R8G8_SRGB, .format = UNSUPPORTED), /* L8A8_UNORM_SRGB */
-   fmt(VK_FORMAT_R8G8B8_UNORM, .format = R8G8B8X8_UNORM, .cpp = 3, .num_channels = 3),
-   fmt(VK_FORMAT_R8G8B8_SNORM, .format = R8G8B8_SNORM, .cpp = 4),
-   fmt(VK_FORMAT_R8G8B8_USCALED, .format = R8G8B8_USCALED, .cpp = 3, .num_channels = 3),
-   fmt(VK_FORMAT_R8G8B8_SSCALED, .format = R8G8B8_SSCALED, .cpp = 3, .num_channels = 3),
-   fmt(VK_FORMAT_R8G8B8_UINT, .format = R8G8B8_UINT, .cpp = 3, .num_channels = 3),
-   fmt(VK_FORMAT_R8G8B8_SINT, .format = R8G8B8_SINT, .cpp = 3, .num_channels = 3),
-   fmt(VK_FORMAT_R8G8B8_SRGB, .format = UNSUPPORTED), /* B8G8R8A8_UNORM_SRGB */
-   fmt(VK_FORMAT_R8G8B8A8_UNORM, .format = R8G8B8A8_UNORM, .cpp = 4, .num_channels = 4),
-   fmt(VK_FORMAT_R8G8B8A8_SNORM, .format = R8G8B8A8_SNORM, .cpp = 4, .num_channels = 4),
-   fmt(VK_FORMAT_R8G8B8A8_USCALED, .format = R8G8B8A8_USCALED, .cpp = 4, .num_channels = 4),
-   fmt(VK_FORMAT_R8G8B8A8_SSCALED, .format = R8G8B8A8_SSCALED, .cpp = 4, .num_channels = 4),
-   fmt(VK_FORMAT_R8G8B8A8_UINT, .format = R8G8B8A8_UINT, .cpp = 4, .num_channels = 4),
-   fmt(VK_FORMAT_R8G8B8A8_SINT, .format = R8G8B8A8_SINT, .cpp = 4, .num_channels = 4),
-   fmt(VK_FORMAT_R8G8B8A8_SRGB, .format = R8G8B8A8_UNORM_SRGB, .cpp = 4, .num_channels = 4),
-   fmt(VK_FORMAT_R10G10B10A2_UNORM, .format = R10G10B10A2_UNORM, .cpp = 4, .num_channels = 4),
-   fmt(VK_FORMAT_R10G10B10A2_SNORM, .format = R10G10B10A2_SNORM, .cpp = 4, .num_channels = 4),
-   fmt(VK_FORMAT_R10G10B10A2_USCALED, .format = R10G10B10A2_USCALED, .cpp = 4, .num_channels = 4),
-   fmt(VK_FORMAT_R10G10B10A2_SSCALED, .format = R10G10B10A2_SSCALED, .cpp = 4, .num_channels = 4),
-   fmt(VK_FORMAT_R10G10B10A2_UINT, .format = R10G10B10A2_UINT, .cpp = 4, .num_channels = 4),
-   fmt(VK_FORMAT_R10G10B10A2_SINT, .format = R10G10B10A2_SINT, .cpp = 4, .num_channels = 4),
-   fmt(VK_FORMAT_R16_UNORM, .format = R16_UNORM, .cpp = 2, .num_channels = 1),
-   fmt(VK_FORMAT_R16_SNORM, .format = R16_SNORM, .cpp = 2, .num_channels = 1),
-   fmt(VK_FORMAT_R16_USCALED, .format = R16_USCALED, .cpp = 2, .num_channels = 1),
-   fmt(VK_FORMAT_R16_SSCALED, .format = R16_SSCALED, .cpp = 2, .num_channels = 1),
-   fmt(VK_FORMAT_R16_UINT, .format = R16_UINT, .cpp = 2, .num_channels = 1),
-   fmt(VK_FORMAT_R16_SINT, .format = R16_SINT, .cpp = 2, .num_channels = 1),
-   fmt(VK_FORMAT_R16_SFLOAT, .format = R16_FLOAT, .cpp = 2, .num_channels = 1),
-   fmt(VK_FORMAT_R16G16_UNORM, .format = R16G16_UNORM, .cpp = 4, .num_channels = 2),
-   fmt(VK_FORMAT_R16G16_SNORM, .format = R16G16_SNORM, .cpp = 4, .num_channels = 2),
-   fmt(VK_FORMAT_R16G16_USCALED, .format = R16G16_USCALED, .cpp = 4, .num_channels = 2),
-   fmt(VK_FORMAT_R16G16_SSCALED, .format = R16G16_SSCALED, .cpp = 4, .num_channels = 2),
-   fmt(VK_FORMAT_R16G16_UINT, .format = R16G16_UINT, .cpp = 4, .num_channels = 2),
-   fmt(VK_FORMAT_R16G16_SINT, .format = R16G16_SINT, .cpp = 4, .num_channels = 2),
-   fmt(VK_FORMAT_R16G16_SFLOAT, .format = R16G16_FLOAT, .cpp = 4, .num_channels = 2),
-   fmt(VK_FORMAT_R16G16B16_UNORM, .format = R16G16B16_UNORM, .cpp = 6, .num_channels = 3),
-   fmt(VK_FORMAT_R16G16B16_SNORM, .format = R16G16B16_SNORM, .cpp = 6, .num_channels = 3),
-   fmt(VK_FORMAT_R16G16B16_USCALED, .format = R16G16B16_USCALED, .cpp = 6, .num_channels = 3),
-   fmt(VK_FORMAT_R16G16B16_SSCALED, .format = R16G16B16_SSCALED, .cpp = 6, .num_channels = 3),
-   fmt(VK_FORMAT_R16G16B16_UINT, .format = R16G16B16_UINT, .cpp = 6, .num_channels = 3),
-   fmt(VK_FORMAT_R16G16B16_SINT, .format = R16G16B16_SINT, .cpp = 6, .num_channels = 3),
-   fmt(VK_FORMAT_R16G16B16_SFLOAT, .format = R16G16B16_FLOAT, .cpp = 6, .num_channels = 3),
-   fmt(VK_FORMAT_R16G16B16A16_UNORM, .format = R16G16B16A16_UNORM, .cpp = 8, .num_channels = 4),
-   fmt(VK_FORMAT_R16G16B16A16_SNORM, .format = R16G16B16A16_SNORM, .cpp = 8, .num_channels = 4),
-   fmt(VK_FORMAT_R16G16B16A16_USCALED, .format = R16G16B16A16_USCALED, .cpp = 8, .num_channels = 4),
-   fmt(VK_FORMAT_R16G16B16A16_SSCALED, .format = R16G16B16A16_SSCALED, .cpp = 8, .num_channels = 4),
-   fmt(VK_FORMAT_R16G16B16A16_UINT, .format = R16G16B16A16_UINT, .cpp = 8, .num_channels = 4),
-   fmt(VK_FORMAT_R16G16B16A16_SINT, .format = R16G16B16A16_SINT, .cpp = 8, .num_channels = 4),
-   fmt(VK_FORMAT_R16G16B16A16_SFLOAT, .format = R16G16B16A16_FLOAT, .cpp = 8, .num_channels = 4),
-   fmt(VK_FORMAT_R32_UINT, .format = R32_UINT, .cpp = 4, .num_channels = 1,),
-   fmt(VK_FORMAT_R32_SINT, .format = R32_SINT, .cpp = 4, .num_channels = 1,),
-   fmt(VK_FORMAT_R32_SFLOAT, .format = R32_FLOAT, .cpp = 4, .num_channels = 1,),
-   fmt(VK_FORMAT_R32G32_UINT, .format = R32G32_UINT, .cpp = 8, .num_channels = 2,),
-   fmt(VK_FORMAT_R32G32_SINT, .format = R32G32_SINT, .cpp = 8, .num_channels = 2,),
-   fmt(VK_FORMAT_R32G32_SFLOAT, .format = R32G32_FLOAT, .cpp = 8, .num_channels = 2,),
-   fmt(VK_FORMAT_R32G32B32_UINT, .format = R32G32B32_UINT, .cpp = 12, .num_channels = 3,),
-   fmt(VK_FORMAT_R32G32B32_SINT, .format = R32G32B32_SINT, .cpp = 12, .num_channels = 3,),
-   fmt(VK_FORMAT_R32G32B32_SFLOAT, .format = R32G32B32_FLOAT, .cpp = 12, .num_channels = 3,),
-   fmt(VK_FORMAT_R32G32B32A32_UINT, .format = R32G32B32A32_UINT, .cpp = 16, .num_channels = 4,),
-   fmt(VK_FORMAT_R32G32B32A32_SINT, .format = R32G32B32A32_SINT, .cpp = 16, .num_channels = 4,),
-   fmt(VK_FORMAT_R32G32B32A32_SFLOAT, .format = R32G32B32A32_FLOAT, .cpp = 16, .num_channels = 4,),
-   fmt(VK_FORMAT_R64_SFLOAT, .format = R64_FLOAT, .cpp = 8, .num_channels = 1),
-   fmt(VK_FORMAT_R64G64_SFLOAT, .format = R64G64_FLOAT, .cpp = 16, .num_channels = 2),
-   fmt(VK_FORMAT_R64G64B64_SFLOAT, .format = R64G64B64_FLOAT, .cpp = 24, .num_channels = 3),
-   fmt(VK_FORMAT_R64G64B64A64_SFLOAT, .format = R64G64B64A64_FLOAT, .cpp = 32, .num_channels = 4),
-   fmt(VK_FORMAT_R11G11B10_UFLOAT, .format = R11G11B10_FLOAT, .cpp = 4, .num_channels = 3),
-   fmt(VK_FORMAT_R9G9B9E5_UFLOAT, .format = R9G9B9E5_SHAREDEXP, .cpp = 4, .num_channels = 3),
+   fmt(VK_FORMAT_UNDEFINED,               RAW,                    .cpp = 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,               .cpp = 1,   .num_channels = 1),
+   fmt(VK_FORMAT_R8_SNORM,                R8_SNORM,               .cpp = 1,   .num_channels = 1,),
+   fmt(VK_FORMAT_R8_USCALED,              R8_USCALED,             .cpp = 1,   .num_channels = 1),
+   fmt(VK_FORMAT_R8_SSCALED,              R8_SSCALED,             .cpp = 1,   .num_channels = 1),
+   fmt(VK_FORMAT_R8_UINT,                 R8_UINT,                .cpp = 1,   .num_channels = 1),
+   fmt(VK_FORMAT_R8_SINT,                 R8_SINT,                .cpp = 1,   .num_channels = 1),
+   fmt(VK_FORMAT_R8_SRGB,                 UNSUPPORTED),
+   fmt(VK_FORMAT_R8G8_UNORM,              R8G8_UNORM,             .cpp = 2,   .num_channels = 2),
+   fmt(VK_FORMAT_R8G8_SNORM,              R8G8_SNORM,             .cpp = 2,   .num_channels = 2),
+   fmt(VK_FORMAT_R8G8_USCALED,            R8G8_USCALED,           .cpp = 2,   .num_channels = 2),
+   fmt(VK_FORMAT_R8G8_SSCALED,            R8G8_SSCALED,           .cpp = 2,   .num_channels = 2),
+   fmt(VK_FORMAT_R8G8_UINT,               R8G8_UINT,              .cpp = 2,   .num_channels = 2),
+   fmt(VK_FORMAT_R8G8_SINT,               R8G8_SINT,              .cpp = 2,   .num_channels = 2),
+   fmt(VK_FORMAT_R8G8_SRGB,               UNSUPPORTED), /* L8A8_UNORM_SRGB */
+   fmt(VK_FORMAT_R8G8B8_UNORM,            R8G8B8X8_UNORM,         .cpp = 3,   .num_channels = 3),
+   fmt(VK_FORMAT_R8G8B8_SNORM,            R8G8B8_SNORM,           .cpp = 4),
+   fmt(VK_FORMAT_R8G8B8_USCALED,          R8G8B8_USCALED,         .cpp = 3,   .num_channels = 3),
+   fmt(VK_FORMAT_R8G8B8_SSCALED,          R8G8B8_SSCALED,         .cpp = 3,   .num_channels = 3),
+   fmt(VK_FORMAT_R8G8B8_UINT,             R8G8B8_UINT,            .cpp = 3,   .num_channels = 3),
+   fmt(VK_FORMAT_R8G8B8_SINT,             R8G8B8_SINT,            .cpp = 3,   .num_channels = 3),
+   fmt(VK_FORMAT_R8G8B8_SRGB,             UNSUPPORTED), /* B8G8R8A8_UNORM_SRGB */
+   fmt(VK_FORMAT_R8G8B8A8_UNORM,          R8G8B8A8_UNORM,         .cpp = 4,   .num_channels = 4),
+   fmt(VK_FORMAT_R8G8B8A8_SNORM,          R8G8B8A8_SNORM,         .cpp = 4,   .num_channels = 4),
+   fmt(VK_FORMAT_R8G8B8A8_USCALED,        R8G8B8A8_USCALED,       .cpp = 4,   .num_channels = 4),
+   fmt(VK_FORMAT_R8G8B8A8_SSCALED,        R8G8B8A8_SSCALED,       .cpp = 4,   .num_channels = 4),
+   fmt(VK_FORMAT_R8G8B8A8_UINT,           R8G8B8A8_UINT,          .cpp = 4,   .num_channels = 4),
+   fmt(VK_FORMAT_R8G8B8A8_SINT,           R8G8B8A8_SINT,          .cpp = 4,   .num_channels = 4),
+   fmt(VK_FORMAT_R8G8B8A8_SRGB,           R8G8B8A8_UNORM_SRGB,    .cpp = 4,   .num_channels = 4),
+   fmt(VK_FORMAT_R10G10B10A2_UNORM,       R10G10B10A2_UNORM,      .cpp = 4,   .num_channels = 4),
+   fmt(VK_FORMAT_R10G10B10A2_SNORM,       R10G10B10A2_SNORM,      .cpp = 4,   .num_channels = 4),
+   fmt(VK_FORMAT_R10G10B10A2_USCALED,     R10G10B10A2_USCALED,    .cpp = 4,   .num_channels = 4),
+   fmt(VK_FORMAT_R10G10B10A2_SSCALED,     R10G10B10A2_SSCALED,    .cpp = 4,   .num_channels = 4),
+   fmt(VK_FORMAT_R10G10B10A2_UINT,        R10G10B10A2_UINT,       .cpp = 4,   .num_channels = 4),
+   fmt(VK_FORMAT_R10G10B10A2_SINT,        R10G10B10A2_SINT,       .cpp = 4,   .num_channels = 4),
+   fmt(VK_FORMAT_R16_UNORM,               R16_UNORM,              .cpp = 2,   .num_channels = 1),
+   fmt(VK_FORMAT_R16_SNORM,               R16_SNORM,              .cpp = 2,   .num_channels = 1),
+   fmt(VK_FORMAT_R16_USCALED,             R16_USCALED,            .cpp = 2,   .num_channels = 1),
+   fmt(VK_FORMAT_R16_SSCALED,             R16_SSCALED,            .cpp = 2,   .num_channels = 1),
+   fmt(VK_FORMAT_R16_UINT,                R16_UINT,               .cpp = 2,   .num_channels = 1),
+   fmt(VK_FORMAT_R16_SINT,                R16_SINT,               .cpp = 2,   .num_channels = 1),
+   fmt(VK_FORMAT_R16_SFLOAT,              R16_FLOAT,              .cpp = 2,   .num_channels = 1),
+   fmt(VK_FORMAT_R16G16_UNORM,            R16G16_UNORM,           .cpp = 4,   .num_channels = 2),
+   fmt(VK_FORMAT_R16G16_SNORM,            R16G16_SNORM,           .cpp = 4,   .num_channels = 2),
+   fmt(VK_FORMAT_R16G16_USCALED,          R16G16_USCALED,         .cpp = 4,   .num_channels = 2),
+   fmt(VK_FORMAT_R16G16_SSCALED,          R16G16_SSCALED,         .cpp = 4,   .num_channels = 2),
+   fmt(VK_FORMAT_R16G16_UINT,             R16G16_UINT,            .cpp = 4,   .num_channels = 2),
+   fmt(VK_FORMAT_R16G16_SINT,             R16G16_SINT,            .cpp = 4,   .num_channels = 2),
+   fmt(VK_FORMAT_R16G16_SFLOAT,           R16G16_FLOAT,           .cpp = 4,   .num_channels = 2),
+   fmt(VK_FORMAT_R16G16B16_UNORM,         R16G16B16_UNORM,        .cpp = 6,   .num_channels = 3),
+   fmt(VK_FORMAT_R16G16B16_SNORM,         R16G16B16_SNORM,        .cpp = 6,   .num_channels = 3),
+   fmt(VK_FORMAT_R16G16B16_USCALED,       R16G16B16_USCALED,      .cpp = 6,   .num_channels = 3),
+   fmt(VK_FORMAT_R16G16B16_SSCALED,       R16G16B16_SSCALED,      .cpp = 6,   .num_channels = 3),
+   fmt(VK_FORMAT_R16G16B16_UINT,          R16G16B16_UINT,         .cpp = 6,   .num_channels = 3),
+   fmt(VK_FORMAT_R16G16B16_SINT,          R16G16B16_SINT,         .cpp = 6,   .num_channels = 3),
+   fmt(VK_FORMAT_R16G16B16_SFLOAT,        R16G16B16_FLOAT,        .cpp = 6,   .num_channels = 3),
+   fmt(VK_FORMAT_R16G16B16A16_UNORM,      R16G16B16A16_UNORM,     .cpp = 8,   .num_channels = 4),
+   fmt(VK_FORMAT_R16G16B16A16_SNORM,      R16G16B16A16_SNORM,     .cpp = 8,   .num_channels = 4),
+   fmt(VK_FORMAT_R16G16B16A16_USCALED,    R16G16B16A16_USCALED,   .cpp = 8,   .num_channels = 4),
+   fmt(VK_FORMAT_R16G16B16A16_SSCALED,    R16G16B16A16_SSCALED,   .cpp = 8,   .num_channels = 4),
+   fmt(VK_FORMAT_R16G16B16A16_UINT,       R16G16B16A16_UINT,      .cpp = 8,   .num_channels = 4),
+   fmt(VK_FORMAT_R16G16B16A16_SINT,       R16G16B16A16_SINT,      .cpp = 8,   .num_channels = 4),
+   fmt(VK_FORMAT_R16G16B16A16_SFLOAT,     R16G16B16A16_FLOAT,     .cpp = 8,   .num_channels = 4),
+   fmt(VK_FORMAT_R32_UINT,                R32_UINT,               .cpp = 4,   .num_channels = 1,),
+   fmt(VK_FORMAT_R32_SINT,                R32_SINT,               .cpp = 4,   .num_channels = 1,),
+   fmt(VK_FORMAT_R32_SFLOAT,              R32_FLOAT,              .cpp = 4,   .num_channels = 1,),
+   fmt(VK_FORMAT_R32G32_UINT,             R32G32_UINT,            .cpp = 8,   .num_channels = 2,),
+   fmt(VK_FORMAT_R32G32_SINT,             R32G32_SINT,            .cpp = 8,   .num_channels = 2,),
+   fmt(VK_FORMAT_R32G32_SFLOAT,           R32G32_FLOAT,           .cpp = 8,   .num_channels = 2,),
+   fmt(VK_FORMAT_R32G32B32_UINT,          R32G32B32_UINT,         .cpp = 12,  .num_channels = 3,),
+   fmt(VK_FORMAT_R32G32B32_SINT,          R32G32B32_SINT,         .cpp = 12,  .num_channels = 3,),
+   fmt(VK_FORMAT_R32G32B32_SFLOAT,        R32G32B32_FLOAT,        .cpp = 12,  .num_channels = 3,),
+   fmt(VK_FORMAT_R32G32B32A32_UINT,       R32G32B32A32_UINT,      .cpp = 16,  .num_channels = 4,),
+   fmt(VK_FORMAT_R32G32B32A32_SINT,       R32G32B32A32_SINT,      .cpp = 16,  .num_channels = 4,),
+   fmt(VK_FORMAT_R32G32B32A32_SFLOAT,     R32G32B32A32_FLOAT,     .cpp = 16,  .num_channels = 4,),
+   fmt(VK_FORMAT_R64_SFLOAT,              R64_FLOAT,              .cpp = 8,   .num_channels = 1),
+   fmt(VK_FORMAT_R64G64_SFLOAT,           R64G64_FLOAT,           .cpp = 16,  .num_channels = 2),
+   fmt(VK_FORMAT_R64G64B64_SFLOAT,        R64G64B64_FLOAT,        .cpp = 24,  .num_channels = 3),
+   fmt(VK_FORMAT_R64G64B64A64_SFLOAT,     R64G64B64A64_FLOAT,     .cpp = 32,  .num_channels = 4),
+   fmt(VK_FORMAT_R11G11B10_UFLOAT,        R11G11B10_FLOAT,        .cpp = 4,   .num_channels = 3),
+   fmt(VK_FORMAT_R9G9B9E5_UFLOAT,         R9G9B9E5_SHAREDEXP,     .cpp = 4,   .num_channels = 3),
 
    /* For depth/stencil formats, the .format and .cpp fields describe the
     * depth format. The field .has_stencil indicates whether or not there's a
     * stencil buffer.
     */
-   fmt(VK_FORMAT_D16_UNORM, .format = D16_UNORM, .cpp = 2, .num_channels = 1),
-   fmt(VK_FORMAT_D24_UNORM, .format = D24_UNORM_X8_UINT, .cpp = 4, .num_channels = 1),
-   fmt(VK_FORMAT_D32_SFLOAT, .format = D32_FLOAT, .cpp = 4, .num_channels = 1),
-   fmt(VK_FORMAT_S8_UINT, .format = UNSUPPORTED, .cpp = 0, .num_channels = 1, .has_stencil = true),
-   fmt(VK_FORMAT_D16_UNORM_S8_UINT, .format = D16_UNORM, .cpp = 2, .num_channels = 2, .has_stencil = true),
-   fmt(VK_FORMAT_D24_UNORM_S8_UINT, .format = D24_UNORM_X8_UINT, .cpp = 4, .num_channels = 2, .has_stencil = true),
-   fmt(VK_FORMAT_D32_SFLOAT_S8_UINT, .format = D32_FLOAT, .cpp = 4, .num_channels = 2, .has_stencil = true),
+   fmt(VK_FORMAT_D16_UNORM,               D16_UNORM,              .cpp = 2,   .num_channels = 1),
+   fmt(VK_FORMAT_D24_UNORM,               D24_UNORM_X8_UINT,      .cpp = 4,   .num_channels = 1),
+   fmt(VK_FORMAT_D32_SFLOAT,              D32_FLOAT,              .cpp = 4,   .num_channels = 1),
+   fmt(VK_FORMAT_S8_UINT,                 UNSUPPORTED,            .cpp = 0,   .num_channels = 1, .has_stencil = true),
+   fmt(VK_FORMAT_D16_UNORM_S8_UINT,       D16_UNORM,              .cpp = 2,   .num_channels = 2, .has_stencil = true),
+   fmt(VK_FORMAT_D24_UNORM_S8_UINT,       D24_UNORM_X8_UINT,      .cpp = 4,   .num_channels = 2, .has_stencil = true),
+   fmt(VK_FORMAT_D32_SFLOAT_S8_UINT,      D32_FLOAT,              .cpp = 4,   .num_channels = 2, .has_stencil = true),
 
-   fmt(VK_FORMAT_BC1_RGB_UNORM, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_BC1_RGB_SRGB, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_BC1_RGBA_UNORM, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_BC1_RGBA_SRGB, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_BC2_UNORM, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_BC2_SRGB, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_BC3_UNORM, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_BC3_SRGB, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_BC4_UNORM, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_BC4_SNORM, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_BC5_UNORM, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_BC5_SNORM, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_BC6H_UFLOAT, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_BC6H_SFLOAT, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_BC7_UNORM, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_BC7_SRGB, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_ETC2_R8G8B8_UNORM, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_ETC2_R8G8B8_SRGB, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_ETC2_R8G8B8A1_UNORM, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_ETC2_R8G8B8A1_SRGB, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_ETC2_R8G8B8A8_UNORM, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_ETC2_R8G8B8A8_SRGB, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_EAC_R11_UNORM, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_EAC_R11_SNORM, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_EAC_R11G11_UNORM, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_EAC_R11G11_SNORM, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_ASTC_4x4_UNORM, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_ASTC_4x4_SRGB, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_ASTC_5x4_UNORM, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_ASTC_5x4_SRGB, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_ASTC_5x5_UNORM, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_ASTC_5x5_SRGB, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_ASTC_6x5_UNORM, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_ASTC_6x5_SRGB, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_ASTC_6x6_UNORM, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_ASTC_6x6_SRGB, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_ASTC_8x5_UNORM, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_ASTC_8x5_SRGB, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_ASTC_8x6_UNORM, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_ASTC_8x6_SRGB, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_ASTC_8x8_UNORM, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_ASTC_8x8_SRGB, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_ASTC_10x5_UNORM, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_ASTC_10x5_SRGB, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_ASTC_10x6_UNORM, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_ASTC_10x6_SRGB, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_ASTC_10x8_UNORM, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_ASTC_10x8_SRGB, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_ASTC_10x10_UNORM, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_ASTC_10x10_SRGB, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_ASTC_12x10_UNORM, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_ASTC_12x10_SRGB, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_ASTC_12x12_UNORM, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_ASTC_12x12_SRGB, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_B4G4R4A4_UNORM, .format = B4G4R4A4_UNORM, .cpp = 2, .num_channels = 4),
-   fmt(VK_FORMAT_B5G5R5A1_UNORM, .format = B5G5R5A1_UNORM, .cpp = 2, .num_channels = 4),
-   fmt(VK_FORMAT_B5G6R5_UNORM, .format = B5G6R5_UNORM, .cpp = 2, .num_channels = 3),
-   fmt(VK_FORMAT_B5G6R5_USCALED, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_B8G8R8_UNORM, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_B8G8R8_SNORM, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_B8G8R8_USCALED, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_B8G8R8_SSCALED, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_B8G8R8_UINT, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_B8G8R8_SINT, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_B8G8R8_SRGB, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_B8G8R8A8_UNORM, .format = B8G8R8A8_UNORM, .cpp = 4, .num_channels = 4),
-   fmt(VK_FORMAT_B8G8R8A8_SNORM, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_B8G8R8A8_USCALED, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_B8G8R8A8_SSCALED, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_B8G8R8A8_UINT, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_B8G8R8A8_SINT, .format = UNSUPPORTED),
-   fmt(VK_FORMAT_B8G8R8A8_SRGB, .format = B8G8R8A8_UNORM_SRGB, .cpp = 4, .num_channels = 4),
-   fmt(VK_FORMAT_B10G10R10A2_UNORM, .format = B10G10R10A2_UNORM, .cpp = 4, .num_channels = 4),
-   fmt(VK_FORMAT_B10G10R10A2_SNORM, .format = B10G10R10A2_SNORM, .cpp = 4, .num_channels = 4),
-   fmt(VK_FORMAT_B10G10R10A2_USCALED, .format = B10G10R10A2_USCALED, .cpp = 4, .num_channels = 4),
-   fmt(VK_FORMAT_B10G10R10A2_SSCALED, .format = B10G10R10A2_SSCALED, .cpp = 4, .num_channels = 4),
-   fmt(VK_FORMAT_B10G10R10A2_UINT, .format = B10G10R10A2_UINT, .cpp = 4, .num_channels = 4),
-   fmt(VK_FORMAT_B10G10R10A2_SINT, .format = B10G10R10A2_SINT, .cpp = 4, .num_channels = 4)
+   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,       UNSUPPORTED),
+   fmt(VK_FORMAT_ETC2_R8G8B8_SRGB,        UNSUPPORTED),
+   fmt(VK_FORMAT_ETC2_R8G8B8A1_UNORM,     UNSUPPORTED),
+   fmt(VK_FORMAT_ETC2_R8G8B8A1_SRGB,      UNSUPPORTED),
+   fmt(VK_FORMAT_ETC2_R8G8B8A8_UNORM,     UNSUPPORTED),
+   fmt(VK_FORMAT_ETC2_R8G8B8A8_SRGB,      UNSUPPORTED),
+   fmt(VK_FORMAT_EAC_R11_UNORM,           UNSUPPORTED),
+   fmt(VK_FORMAT_EAC_R11_SNORM,           UNSUPPORTED),
+   fmt(VK_FORMAT_EAC_R11G11_UNORM,        UNSUPPORTED),
+   fmt(VK_FORMAT_EAC_R11G11_SNORM,        UNSUPPORTED),
+   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,         .cpp = 2,   .num_channels = 4),
+   fmt(VK_FORMAT_B5G5R5A1_UNORM,          B5G5R5A1_UNORM,         .cpp = 2,   .num_channels = 4),
+   fmt(VK_FORMAT_B5G6R5_UNORM,            B5G6R5_UNORM,           .cpp = 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,         .cpp = 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,    .cpp = 4,   .num_channels = 4),
+   fmt(VK_FORMAT_B10G10R10A2_UNORM,       B10G10R10A2_UNORM,      .cpp = 4,   .num_channels = 4),
+   fmt(VK_FORMAT_B10G10R10A2_SNORM,       B10G10R10A2_SNORM,      .cpp = 4,   .num_channels = 4),
+   fmt(VK_FORMAT_B10G10R10A2_USCALED,     B10G10R10A2_USCALED,    .cpp = 4,   .num_channels = 4),
+   fmt(VK_FORMAT_B10G10R10A2_SSCALED,     B10G10R10A2_SSCALED,    .cpp = 4,   .num_channels = 4),
+   fmt(VK_FORMAT_B10G10R10A2_UINT,        B10G10R10A2_UINT,       .cpp = 4,   .num_channels = 4),
+   fmt(VK_FORMAT_B10G10R10A2_SINT,        B10G10R10A2_SINT,       .cpp = 4,   .num_channels = 4)
 };
 
 const struct anv_format *
@@ -258,10 +258,10 @@ anv_format_get_properties(struct anv_device *device,
    if (device->info.is_haswell)
       gen += 5;
 
-   if (format->format == UNSUPPORTED)
+   if (format->surface_format == UNSUPPORTED)
       goto unsupported;
 
-   info = &surface_formats[format->format];
+   info = &surface_formats[format->surface_format];
    if (!info->exists)
       goto unsupported;
 
index e2f8c4039b4baf9cc25571dc690aee762bc846e3..9f1ee97b950134b503d9cc5914f8f349d96992cf 100644 (file)
@@ -276,7 +276,7 @@ anv_image_view_init(struct anv_surface_view *view,
    case VK_IMAGE_ASPECT_COLOR:
       view->offset = image->offset;
       tile_mode = image->tile_mode;
-      format = info->format;
+      format = info->surface_format;
       break;
    default:
       unreachable("");
@@ -397,7 +397,7 @@ anv_color_attachment_view_init(struct anv_surface_view *view,
    struct GEN8_RENDER_SURFACE_STATE surface_state = {
       .SurfaceType = SURFTYPE_2D,
       .SurfaceArray = false,
-      .SurfaceFormat = format->format,
+      .SurfaceFormat = format->surface_format,
       .SurfaceVerticalAlignment = anv_valign[image->v_align],
       .SurfaceHorizontalAlignment = anv_halign[image->h_align],
       .TileMode = image->tile_mode,
@@ -486,7 +486,7 @@ VkResult anv_CreateDepthStencilView(
 
    view->depth_stride = image->stride;
    view->depth_offset = image->offset;
-   view->depth_format = format->format;
+   view->depth_format = format->surface_format;
 
    view->stencil_stride = image->stencil_stride;
    view->stencil_offset = image->offset + image->stencil_offset;
index ae57d5ea4a228d4dd38b38e80d20df7d5b1a33e6..f574038f83f072bcde9aae1be7f78ee6aa058e46 100644 (file)
@@ -96,7 +96,7 @@ emit_vertex_input(struct anv_pipeline *pipeline, VkPipelineVertexInputCreateInfo
       struct GEN8_VERTEX_ELEMENT_STATE element = {
          .VertexBufferIndex = desc->binding,
          .Valid = true,
-         .SourceElementFormat = format->format,
+         .SourceElementFormat = format->surface_format,
          .EdgeFlagEnable = false,
          .SourceElementOffset = desc->offsetInBytes,
          .Component0Control = VFCOMP_STORE_SRC,
index 0c0fe071704703bb8a19ee25c37bf8718a1604ab..f89e92af2d122b55588d711a4875d606ba133939 100644 (file)
@@ -773,7 +773,7 @@ void anv_compiler_free(struct anv_pipeline *pipeline);
 
 struct anv_format {
    const char *name;
-   uint16_t format;
+   uint16_t surface_format; /**< RENDER_SURFACE_STATE.SurfaceFormat */
    uint8_t cpp;
    uint8_t num_channels;
    bool has_stencil;