bug 12998 part 5: reorder formats
diff --git a/include/vulkan/vulkan.h b/include/vulkan/vulkan.h
index cd057f8..b4e2a3b 100644
--- a/include/vulkan/vulkan.h
+++ b/include/vulkan/vulkan.h
@@ -212,10 +212,14 @@
     VK_FORMAT_R4G4_USCALED,
     VK_FORMAT_R4G4B4A4_UNORM_PACK16,
     VK_FORMAT_R4G4B4A4_USCALED,
+    VK_FORMAT_B4G4R4A4_UNORM_PACK16,
     VK_FORMAT_R5G6B5_UNORM_PACK16,
     VK_FORMAT_R5G6B5_USCALED,
+    VK_FORMAT_B5G6R5_UNORM_PACK16,
+    VK_FORMAT_B5G6R5_USCALED,
     VK_FORMAT_R5G5B5A1_UNORM_PACK16,
     VK_FORMAT_R5G5B5A1_USCALED,
+    VK_FORMAT_B5G5R5A1_UNORM_PACK16,
     VK_FORMAT_R8_UNORM,
     VK_FORMAT_R8_SNORM,
     VK_FORMAT_R8_USCALED,
@@ -237,6 +241,13 @@
     VK_FORMAT_R8G8B8_UINT,
     VK_FORMAT_R8G8B8_SINT,
     VK_FORMAT_R8G8B8_SRGB,
+    VK_FORMAT_B8G8R8_UNORM,
+    VK_FORMAT_B8G8R8_SNORM,
+    VK_FORMAT_B8G8R8_USCALED,
+    VK_FORMAT_B8G8R8_SSCALED,
+    VK_FORMAT_B8G8R8_UINT,
+    VK_FORMAT_B8G8R8_SINT,
+    VK_FORMAT_B8G8R8_SRGB,
     VK_FORMAT_R8G8B8A8_UNORM,
     VK_FORMAT_R8G8B8A8_SNORM,
     VK_FORMAT_R8G8B8A8_USCALED,
@@ -244,6 +255,19 @@
     VK_FORMAT_R8G8B8A8_UINT,
     VK_FORMAT_R8G8B8A8_SINT,
     VK_FORMAT_R8G8B8A8_SRGB,
+    VK_FORMAT_B8G8R8A8_UNORM,
+    VK_FORMAT_B8G8R8A8_SNORM,
+    VK_FORMAT_B8G8R8A8_USCALED,
+    VK_FORMAT_B8G8R8A8_SSCALED,
+    VK_FORMAT_B8G8R8A8_UINT,
+    VK_FORMAT_B8G8R8A8_SINT,
+    VK_FORMAT_B8G8R8A8_SRGB,
+    VK_FORMAT_A2R10G10B10_UNORM_PACK32,
+    VK_FORMAT_A2R10G10B10_SNORM_PACK32,
+    VK_FORMAT_A2R10G10B10_USCALED_PACK32,
+    VK_FORMAT_A2R10G10B10_SSCALED_PACK32,
+    VK_FORMAT_A2R10G10B10_UINT_PACK32,
+    VK_FORMAT_A2R10G10B10_SINT_PACK32,
     VK_FORMAT_A2B10G10R10_UNORM_PACK32,
     VK_FORMAT_A2B10G10R10_SNORM_PACK32,
     VK_FORMAT_A2B10G10R10_USCALED_PACK32,
@@ -357,33 +381,9 @@
     VK_FORMAT_ASTC_12x10_SRGB_BLOCK,
     VK_FORMAT_ASTC_12x12_UNORM_BLOCK,
     VK_FORMAT_ASTC_12x12_SRGB_BLOCK,
-    VK_FORMAT_B4G4R4A4_UNORM_PACK16,
-    VK_FORMAT_B5G5R5A1_UNORM_PACK16,
-    VK_FORMAT_B5G6R5_UNORM_PACK16,
-    VK_FORMAT_B5G6R5_USCALED,
-    VK_FORMAT_B8G8R8_UNORM,
-    VK_FORMAT_B8G8R8_SNORM,
-    VK_FORMAT_B8G8R8_USCALED,
-    VK_FORMAT_B8G8R8_SSCALED,
-    VK_FORMAT_B8G8R8_UINT,
-    VK_FORMAT_B8G8R8_SINT,
-    VK_FORMAT_B8G8R8_SRGB,
-    VK_FORMAT_B8G8R8A8_UNORM,
-    VK_FORMAT_B8G8R8A8_SNORM,
-    VK_FORMAT_B8G8R8A8_USCALED,
-    VK_FORMAT_B8G8R8A8_SSCALED,
-    VK_FORMAT_B8G8R8A8_UINT,
-    VK_FORMAT_B8G8R8A8_SINT,
-    VK_FORMAT_B8G8R8A8_SRGB,
-    VK_FORMAT_A2R10G10B10_UNORM_PACK32,
-    VK_FORMAT_A2R10G10B10_SNORM_PACK32,
-    VK_FORMAT_A2R10G10B10_USCALED_PACK32,
-    VK_FORMAT_A2R10G10B10_SSCALED_PACK32,
-    VK_FORMAT_A2R10G10B10_UINT_PACK32,
-    VK_FORMAT_A2R10G10B10_SINT_PACK32,
     VK_FORMAT_BEGIN_RANGE = VK_FORMAT_UNDEFINED,
-    VK_FORMAT_END_RANGE = VK_FORMAT_A2R10G10B10_SINT_PACK32,
-    VK_FORMAT_RANGE_SIZE = (VK_FORMAT_A2R10G10B10_SINT_PACK32 - VK_FORMAT_UNDEFINED + 1),
+    VK_FORMAT_END_RANGE = VK_FORMAT_ASTC_12x12_SRGB_BLOCK,
+    VK_FORMAT_RANGE_SIZE = (VK_FORMAT_ASTC_12x12_SRGB_BLOCK - VK_FORMAT_UNDEFINED + 1),
     VK_FORMAT_MAX_ENUM = 0x7FFFFFFF
 } VkFormat;
 
diff --git a/layers/vk_layer_utils.cpp b/layers/vk_layer_utils.cpp
index 8a6ea48..f105988 100644
--- a/layers/vk_layer_utils.cpp
+++ b/layers/vk_layer_utils.cpp
@@ -42,10 +42,14 @@
     { 1,  2 }, //    [VK_FORMAT_R4G4_USCALED]
     { 2,  4 }, //    [VK_FORMAT_R4G4B4A4_UNORM_PACK16]
     { 2,  4 }, //    [VK_FORMAT_R4G4B4A4_USCALED]
+    { 2,  4 }, //    [VK_FORMAT_B4G4R4A4_UNORM_PACK16]
     { 2,  3 }, //    [VK_FORMAT_R5G6B5_UNORM_PACK16]
     { 2,  3 }, //    [VK_FORMAT_R5G6B5_USCALED]
+    { 2,  3 }, //    [VK_FORMAT_B5G6R5_UNORM_PACK16]
+    { 2,  3 }, //    [VK_FORMAT_B5G6R5_USCALED]
     { 2,  4 }, //    [VK_FORMAT_R5G5B5A1_UNORM_PACK16]
     { 2,  4 }, //    [VK_FORMAT_R5G5B5A1_USCALED]
+    { 2,  4 }, //    [VK_FORMAT_B5G5R5A1_UNORM_PACK16]
     { 1,  1 }, //    [VK_FORMAT_R8_UNORM]
     { 1,  1 }, //    [VK_FORMAT_R8_SNORM]
     { 1,  1 }, //    [VK_FORMAT_R8_USCALED]
@@ -67,6 +71,13 @@
     { 3,  3 }, //    [VK_FORMAT_R8G8B8_UINT]
     { 3,  3 }, //    [VK_FORMAT_R8G8B8_SINT]
     { 3,  3 }, //    [VK_FORMAT_R8G8B8_SRGB]
+    { 3,  3 }, //    [VK_FORMAT_B8G8R8_UNORM]
+    { 3,  3 }, //    [VK_FORMAT_B8G8R8_SNORM]
+    { 3,  3 }, //    [VK_FORMAT_B8G8R8_USCALED]
+    { 3,  3 }, //    [VK_FORMAT_B8G8R8_SSCALED]
+    { 3,  3 }, //    [VK_FORMAT_B8G8R8_UINT]
+    { 3,  3 }, //    [VK_FORMAT_B8G8R8_SINT]
+    { 3,  3 }, //    [VK_FORMAT_B8G8R8_SRGB]
     { 4,  4 }, //    [VK_FORMAT_R8G8B8A8_UNORM]
     { 4,  4 }, //    [VK_FORMAT_R8G8B8A8_SNORM]
     { 4,  4 }, //    [VK_FORMAT_R8G8B8A8_USCALED]
@@ -74,6 +85,19 @@
     { 4,  4 }, //    [VK_FORMAT_R8G8B8A8_UINT]
     { 4,  4 }, //    [VK_FORMAT_R8G8B8A8_SINT]
     { 4,  4 }, //    [VK_FORMAT_R8G8B8A8_SRGB]
+    { 4,  4 }, //    [VK_FORMAT_B8G8R8A8_UNORM]
+    { 4,  4 }, //    [VK_FORMAT_B8G8R8A8_SNORM]
+    { 4,  4 }, //    [VK_FORMAT_B8G8R8A8_USCALED]
+    { 4,  4 }, //    [VK_FORMAT_B8G8R8A8_SSCALED]
+    { 4,  4 }, //    [VK_FORMAT_B8G8R8A8_UINT]
+    { 4,  4 }, //    [VK_FORMAT_B8G8R8A8_SINT]
+    { 4,  4 }, //    [VK_FORMAT_B8G8R8A8_SRGB]
+    { 4,  4 }, //    [VK_FORMAT_A2R10G10B10_UNORM_PACK32]
+    { 4,  4 }, //    [VK_FORMAT_A2R10G10B10_SNORM_PACK32]
+    { 4,  4 }, //    [VK_FORMAT_A2R10G10B10_USCALED_PACK32]
+    { 4,  4 }, //    [VK_FORMAT_A2R10G10B10_SSCALED_PACK32]
+    { 4,  4 }, //    [VK_FORMAT_A2R10G10B10_UINT_PACK32]
+    { 4,  4 }, //    [VK_FORMAT_A2R10G10B10_SINT_PACK32]
     { 4,  4 }, //    [VK_FORMAT_A2B10G10R10_UNORM_PACK32]
     { 4,  4 }, //    [VK_FORMAT_A2B10G10R10_SNORM_PACK32]
     { 4,  4 }, //    [VK_FORMAT_A2B10G10R10_USCALED_PACK32]
@@ -187,28 +211,6 @@
     { 16, 4 }, //    [VK_FORMAT_ASTC_12x10_SRGB_BLOCK]
     { 16, 4 }, //    [VK_FORMAT_ASTC_12x12_UNORM_BLOCK]
     { 16, 4 }, //    [VK_FORMAT_ASTC_12x12_SRGB_BLOCK]
-    { 2, 3 },  //    [VK_FORMAT_B5G6R5_UNORM_PACK16]
-    { 2, 3 },  //    [VK_FORMAT_B5G6R5_USCALED]
-    { 3, 3 },  //    [VK_FORMAT_B8G8R8_UNORM]
-    { 3, 3 },  //    [VK_FORMAT_B8G8R8_SNORM]
-    { 3, 3 },  //    [VK_FORMAT_B8G8R8_USCALED]
-    { 3, 3 },  //    [VK_FORMAT_B8G8R8_SSCALED]
-    { 3, 3 },  //    [VK_FORMAT_B8G8R8_UINT]
-    { 3, 3 },  //    [VK_FORMAT_B8G8R8_SINT]
-    { 3, 3 },  //    [VK_FORMAT_B8G8R8_SRGB]
-    { 4, 4 },  //    [VK_FORMAT_B8G8R8A8_UNORM]
-    { 4, 4 },  //    [VK_FORMAT_B8G8R8A8_SNORM]
-    { 4, 4 },  //    [VK_FORMAT_B8G8R8A8_USCALED]
-    { 4, 4 },  //    [VK_FORMAT_B8G8R8A8_SSCALED]
-    { 4, 4 },  //    [VK_FORMAT_B8G8R8A8_UINT]
-    { 4, 4 },  //    [VK_FORMAT_B8G8R8A8_SINT]
-    { 4, 4 },  //    [VK_FORMAT_B8G8R8A8_SRGB]
-    { 4, 4 },  //    [VK_FORMAT_A2R10G10B10_UNORM_PACK32]
-    { 4, 4 },  //    [VK_FORMAT_A2R10G10B10_SNORM_PACK32]
-    { 4, 4 },  //    [VK_FORMAT_A2R10G10B10_USCALED_PACK32]
-    { 4, 4 },  //    [VK_FORMAT_A2R10G10B10_SSCALED_PACK32]
-    { 4, 4 },  //    [VK_FORMAT_A2R10G10B10_UINT_PACK32]
-    { 4, 4 },  //    [VK_FORMAT_A2R10G10B10_SINT_PACK32]
 };
 
 // Return true if format is a depth or stencil format
diff --git a/tests/blit_tests.cpp b/tests/blit_tests.cpp
index db2ed90..c467821 100644
--- a/tests/blit_tests.cpp
+++ b/tests/blit_tests.cpp
@@ -314,10 +314,14 @@
         { VK_FORMAT_R4G4_USCALED,          1,  2 },
         { VK_FORMAT_R4G4B4A4_UNORM_PACK16,        2,  4 },
         { VK_FORMAT_R4G4B4A4_USCALED,      2,  4 },
+        { VK_FORMAT_B4G4R4A4_UNORM_PACK16,        2, 4 },
         { VK_FORMAT_R5G6B5_UNORM_PACK16,          2,  3 },
         { VK_FORMAT_R5G6B5_USCALED,        2,  3 },
+        { VK_FORMAT_B5G6R5_UNORM_PACK16,          2, 3 },
+        { VK_FORMAT_B5G6R5_USCALED,        2, 3 },
         { VK_FORMAT_R5G5B5A1_UNORM_PACK16,        2,  4 },
         { VK_FORMAT_R5G5B5A1_USCALED,      2,  4 },
+        { VK_FORMAT_B5G5R5A1_UNORM_PACK16,        2, 4 },
         { VK_FORMAT_R8_UNORM,              1,  1 },
         { VK_FORMAT_R8_SNORM,              1,  1 },
         { VK_FORMAT_R8_USCALED,            1,  1 },
@@ -339,6 +343,13 @@
         { VK_FORMAT_R8G8B8_UINT,           3,  3 },
         { VK_FORMAT_R8G8B8_SINT,           3,  3 },
         { VK_FORMAT_R8G8B8_SRGB,           3,  3 },
+        { VK_FORMAT_B8G8R8_UNORM,          3, 3 },
+        { VK_FORMAT_B8G8R8_SNORM,          3, 3 },
+        { VK_FORMAT_B8G8R8_USCALED,        3, 3 },
+        { VK_FORMAT_B8G8R8_SSCALED,        3, 3 },
+        { VK_FORMAT_B8G8R8_UINT,           3, 3 },
+        { VK_FORMAT_B8G8R8_SINT,           3, 3 },
+        { VK_FORMAT_B8G8R8_SRGB,           3, 3 },
         { VK_FORMAT_R8G8B8A8_UNORM,        4,  4 },
         { VK_FORMAT_R8G8B8A8_SNORM,        4,  4 },
         { VK_FORMAT_R8G8B8A8_USCALED,      4,  4 },
@@ -346,6 +357,19 @@
         { VK_FORMAT_R8G8B8A8_UINT,         4,  4 },
         { VK_FORMAT_R8G8B8A8_SINT,         4,  4 },
         { VK_FORMAT_R8G8B8A8_SRGB,         4,  4 },
+        { VK_FORMAT_B8G8R8A8_UNORM,        4, 4 },
+        { VK_FORMAT_B8G8R8A8_SNORM,        4, 4 },
+        { VK_FORMAT_B8G8R8A8_USCALED,      4, 4 },
+        { VK_FORMAT_B8G8R8A8_SSCALED,      4, 4 },
+        { VK_FORMAT_B8G8R8A8_UINT,         4, 4 },
+        { VK_FORMAT_B8G8R8A8_SINT,         4, 4 },
+        { VK_FORMAT_B8G8R8A8_SRGB,         4, 4 },
+        { VK_FORMAT_A2R10G10B10_UNORM_PACK32,     4, 4 },
+        { VK_FORMAT_A2R10G10B10_SNORM_PACK32,     4, 4 },
+        { VK_FORMAT_A2R10G10B10_USCALED_PACK32,   4, 4 },
+        { VK_FORMAT_A2R10G10B10_SSCALED_PACK32,   4, 4 },
+        { VK_FORMAT_A2R10G10B10_UINT_PACK32,      4, 4 },
+        { VK_FORMAT_A2R10G10B10_SINT_PACK32,      4, 4 },
         { VK_FORMAT_A2B10G10R10_UNORM_PACK32,     4,  4 },
         { VK_FORMAT_A2B10G10R10_SNORM_PACK32,     4,  4 },
         { VK_FORMAT_A2B10G10R10_USCALED_PACK32,   4,  4 },
@@ -460,30 +484,6 @@
         { VK_FORMAT_ASTC_12x10_SRGB_BLOCK,       0, 0 },
         { VK_FORMAT_ASTC_12x12_UNORM_BLOCK,      0, 0 },
         { VK_FORMAT_ASTC_12x12_SRGB_BLOCK,       0, 0 },
-        { VK_FORMAT_B4G4R4A4_UNORM_PACK16,        2, 4 },
-        { VK_FORMAT_B5G5R5A1_UNORM_PACK16,        2, 4 },
-        { VK_FORMAT_B5G6R5_UNORM_PACK16,          2, 3 },
-        { VK_FORMAT_B5G6R5_USCALED,        2, 3 },
-        { VK_FORMAT_B8G8R8_UNORM,          3, 3 },
-        { VK_FORMAT_B8G8R8_SNORM,          3, 3 },
-        { VK_FORMAT_B8G8R8_USCALED,        3, 3 },
-        { VK_FORMAT_B8G8R8_SSCALED,        3, 3 },
-        { VK_FORMAT_B8G8R8_UINT,           3, 3 },
-        { VK_FORMAT_B8G8R8_SINT,           3, 3 },
-        { VK_FORMAT_B8G8R8_SRGB,           3, 3 },
-        { VK_FORMAT_B8G8R8A8_UNORM,        4, 4 },
-        { VK_FORMAT_B8G8R8A8_SNORM,        4, 4 },
-        { VK_FORMAT_B8G8R8A8_USCALED,      4, 4 },
-        { VK_FORMAT_B8G8R8A8_SSCALED,      4, 4 },
-        { VK_FORMAT_B8G8R8A8_UINT,         4, 4 },
-        { VK_FORMAT_B8G8R8A8_SINT,         4, 4 },
-        { VK_FORMAT_B8G8R8A8_SRGB,         4, 4 },
-        { VK_FORMAT_A2R10G10B10_UNORM_PACK32,     4, 4 },
-        { VK_FORMAT_A2R10G10B10_SNORM_PACK32,     4, 4 },
-        { VK_FORMAT_A2R10G10B10_USCALED_PACK32,   4, 4 },
-        { VK_FORMAT_A2R10G10B10_SSCALED_PACK32,   4, 4 },
-        { VK_FORMAT_A2R10G10B10_UINT_PACK32,      4, 4 },
-        { VK_FORMAT_A2R10G10B10_SINT_PACK32,      4, 4 },
     };
     if (format_table_unverified)
     {