bug 14537: vkGetPhysicalDeviceImageFormatProperties doesn't express all limitations (WIP)

Use VkSampleCountFlagBits exclusively.  Note that it can be casted to integer.

https://cvs.khronos.org/bugzilla/show_bug.cgi?id=14537
diff --git a/tests/image_tests.cpp b/tests/image_tests.cpp
index e24d60e..f8f2175 100644
--- a/tests/image_tests.cpp
+++ b/tests/image_tests.cpp
@@ -161,7 +161,7 @@
     //        VkExtent3D                            extent;
     //        uint32_t                                mipLevels;
     //        uint32_t                                arraySize;
-    //        uint32_t                                samples;
+    //        VkSampleCountFlagBits                   samples;
     //        VkImageTiling                        tiling;
     //        VkFlags                               usage;                      // VkImageUsageFlags
     //        VkFlags                               flags;                      // VkImageCreateFlags
@@ -177,7 +177,7 @@
     imageCreateInfo.extent.height = h;
     imageCreateInfo.extent.depth = 1;
     imageCreateInfo.mipLevels = mipCount;
-    imageCreateInfo.samples = 1;
+    imageCreateInfo.samples = VK_SAMPLE_COUNT_1_BIT;
     if ((image_fmt.linearTilingFeatures & VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT) &&
         (image_fmt.linearTilingFeatures & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT))
     {
diff --git a/tests/init.cpp b/tests/init.cpp
index ece7eb9..e10fc16 100644
--- a/tests/init.cpp
+++ b/tests/init.cpp
@@ -323,7 +323,7 @@
 //        VkExtent3D                            extent;
 //        uint32_t                                mipLevels;
 //        uint32_t                                arraySize;
-//        uint32_t                                samples;
+//        VkSampleCountFlagBits                   samples;
 //        VkImageTiling                        tiling;
 //        VkFlags                               usage;                      // VkImageUsageFlags
 //        VkFlags                               flags;                      // VkImageCreateFlags
@@ -339,7 +339,7 @@
     imageCreateInfo.extent.height = h;
     imageCreateInfo.extent.depth = 1;
     imageCreateInfo.mipLevels = mipCount;
-    imageCreateInfo.samples = 1;
+    imageCreateInfo.samples = VK_SAMPLE_COUNT_1_BIT;
     if (image_fmt.linearTilingFeatures & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT) {
         imageCreateInfo.tiling = VK_IMAGE_TILING_LINEAR;
     }
diff --git a/tests/layer_validation_tests.cpp b/tests/layer_validation_tests.cpp
index 079981e..ffcfa8c 100644
--- a/tests/layer_validation_tests.cpp
+++ b/tests/layer_validation_tests.cpp
@@ -561,7 +561,7 @@
         image_create_info.extent.depth = 1;
         image_create_info.mipLevels = 1;
         image_create_info.arrayLayers = 1;
-        image_create_info.samples = 1;
+        image_create_info.samples = VK_SAMPLE_COUNT_1_BIT;
         image_create_info.tiling = VK_IMAGE_TILING_LINEAR;
         image_create_info.usage = VK_IMAGE_USAGE_SAMPLED_BIT;
         image_create_info.flags = 0;
@@ -636,7 +636,7 @@
 //        .extent          = { tex_width, tex_height, 1 },
 //        .mipLevels       = 1,
 //        .arraySize       = 1,
-//        .samples         = 1,
+//        .samples         = VK_SAMPLE_COUNT_1_BIT,
 //        .tiling          = VK_IMAGE_TILING_LINEAR,
 //        .usage           = VK_IMAGE_USAGE_SAMPLED_BIT,
 //        .flags           = 0,
@@ -708,7 +708,7 @@
         image_create_info.extent.depth = 1;
         image_create_info.mipLevels = 1;
         image_create_info.arrayLayers = 1;
-        image_create_info.samples = 1;
+        image_create_info.samples = VK_SAMPLE_COUNT_1_BIT;
         image_create_info.tiling = VK_IMAGE_TILING_LINEAR;
         image_create_info.usage = VK_IMAGE_USAGE_SAMPLED_BIT;
         image_create_info.flags = 0;
@@ -843,7 +843,7 @@
         .extent = e3d,
         .mipLevels = 1,
         .arraySize = 1,
-        .samples = 1,
+        .samples = VK_SAMPLE_COUNT_1_BIT,
         .tiling = VK_IMAGE_TILING_LINEAR,
         .usage = 0, // Not setting VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT
         .flags = 0,
@@ -977,7 +977,7 @@
         image_create_info.extent.depth = 1;
         image_create_info.mipLevels = 1;
         image_create_info.arrayLayers = 1;
-        image_create_info.samples = 1;
+        image_create_info.samples = VK_SAMPLE_COUNT_1_BIT;
         image_create_info.tiling = VK_IMAGE_TILING_LINEAR;
         image_create_info.usage = VK_IMAGE_USAGE_SAMPLED_BIT;
         image_create_info.flags = 0;
@@ -1048,7 +1048,7 @@
         image_create_info.extent.depth = 1;
         image_create_info.mipLevels = 1;
         image_create_info.arrayLayers = 1;
-        image_create_info.samples = 1;
+        image_create_info.samples = VK_SAMPLE_COUNT_1_BIT;
         image_create_info.tiling = VK_IMAGE_TILING_LINEAR;
         image_create_info.usage = VK_IMAGE_USAGE_SAMPLED_BIT;
         image_create_info.flags = 0;
@@ -1405,7 +1405,7 @@
     VkPipelineMultisampleStateCreateInfo pipe_ms_state_ci = {};
         pipe_ms_state_ci.sType = VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO;
         pipe_ms_state_ci.pNext = NULL;
-        pipe_ms_state_ci.rasterizationSamples = 1;
+        pipe_ms_state_ci.rasterizationSamples = VK_SAMPLE_COUNT_1_BIT;
         pipe_ms_state_ci.sampleShadingEnable = 0;
         pipe_ms_state_ci.minSampleShading = 1.0;
         pipe_ms_state_ci.pSampleMask = NULL;
@@ -2671,7 +2671,7 @@
     image_create_info.extent.depth          = 1;
     image_create_info.mipLevels             = 1;
     image_create_info.arrayLayers             = 1;
-    image_create_info.samples               = 1;
+    image_create_info.samples               = VK_SAMPLE_COUNT_1_BIT;
     image_create_info.tiling                = VK_IMAGE_TILING_LINEAR;
     image_create_info.usage                 = VK_IMAGE_USAGE_SAMPLED_BIT;
 
@@ -3596,7 +3596,7 @@
     VkPipelineMultisampleStateCreateInfo pipe_ms_state_ci = {};
         pipe_ms_state_ci.sType = VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO;
         pipe_ms_state_ci.pNext = NULL;
-        pipe_ms_state_ci.rasterizationSamples = 4;
+        pipe_ms_state_ci.rasterizationSamples = VK_SAMPLE_COUNT_4_BIT;
         pipe_ms_state_ci.sampleShadingEnable = 0;
         pipe_ms_state_ci.minSampleShading = 1.0;
         pipe_ms_state_ci.pSampleMask = NULL;
@@ -3688,7 +3688,7 @@
     VkPipelineMultisampleStateCreateInfo pipe_ms_state_ci = {};
         pipe_ms_state_ci.sType = VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO;
         pipe_ms_state_ci.pNext = NULL;
-        pipe_ms_state_ci.rasterizationSamples = 4;
+        pipe_ms_state_ci.rasterizationSamples = VK_SAMPLE_COUNT_4_BIT;
         pipe_ms_state_ci.sampleShadingEnable = 0;
         pipe_ms_state_ci.minSampleShading = 1.0;
         pipe_ms_state_ci.pSampleMask = NULL;
@@ -3794,7 +3794,7 @@
     VkPipelineMultisampleStateCreateInfo pipe_ms_state_ci = {};
         pipe_ms_state_ci.sType = VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO;
         pipe_ms_state_ci.pNext = NULL;
-        pipe_ms_state_ci.rasterizationSamples = 1;
+        pipe_ms_state_ci.rasterizationSamples = VK_SAMPLE_COUNT_1_BIT;
         pipe_ms_state_ci.sampleShadingEnable = 0;
         pipe_ms_state_ci.minSampleShading = 1.0;
         pipe_ms_state_ci.pSampleMask = NULL;
@@ -4590,7 +4590,7 @@
     image_create_info.extent.depth  = 1;
     image_create_info.mipLevels     = 1;
     image_create_info.arrayLayers     = 1;
-    image_create_info.samples       = 1;
+    image_create_info.samples       = VK_SAMPLE_COUNT_1_BIT;
     image_create_info.tiling        = VK_IMAGE_TILING_LINEAR;
     image_create_info.usage         = VK_IMAGE_USAGE_SAMPLED_BIT;
     image_create_info.flags         = 0;
@@ -4629,7 +4629,7 @@
     image_create_info.extent.depth  = 1;
     image_create_info.mipLevels     = 1;
     image_create_info.arrayLayers     = 1;
-    image_create_info.samples       = 1;
+    image_create_info.samples       = VK_SAMPLE_COUNT_1_BIT;
     image_create_info.tiling        = VK_IMAGE_TILING_LINEAR;
     image_create_info.usage         = VK_IMAGE_USAGE_SAMPLED_BIT;
     image_create_info.flags         = 0;
@@ -4640,7 +4640,7 @@
     image_create_info.extent.height = 8192;
     image_create_info.extent.depth  = 16;
     image_create_info.arrayLayers     = 4;
-    image_create_info.samples       = 2;
+    image_create_info.samples       = VK_SAMPLE_COUNT_2_BIT;
     image_create_info.format        = VK_FORMAT_R8G8B8A8_UNORM;
     vkCreateImage(m_device->device(), &image_create_info, NULL, &image);
 
@@ -4745,7 +4745,7 @@
         image_create_info.extent.depth = 1;
         image_create_info.mipLevels = 1;
         image_create_info.arrayLayers = 1;
-        image_create_info.samples = 1;
+        image_create_info.samples = VK_SAMPLE_COUNT_1_BIT;
         image_create_info.tiling = VK_IMAGE_TILING_LINEAR;
         image_create_info.usage = VK_IMAGE_USAGE_SAMPLED_BIT;
         image_create_info.flags = 0;
@@ -4797,7 +4797,7 @@
         image_create_info.extent.height = tex_height;
         image_create_info.extent.depth = 1;
         image_create_info.mipLevels = 1;
-        image_create_info.samples = 1;
+        image_create_info.samples = VK_SAMPLE_COUNT_1_BIT;
         image_create_info.tiling = VK_IMAGE_TILING_LINEAR;
         image_create_info.usage = VK_IMAGE_USAGE_SAMPLED_BIT;
         image_create_info.flags = 0;
@@ -4851,7 +4851,7 @@
         image_create_info.extent.depth = 1;
         image_create_info.mipLevels = 1;
         image_create_info.arrayLayers = 1;
-        image_create_info.samples = 1;
+        image_create_info.samples = VK_SAMPLE_COUNT_1_BIT;
         image_create_info.tiling = VK_IMAGE_TILING_LINEAR;
         image_create_info.usage = VK_IMAGE_USAGE_TRANSFER_SRC_BIT;
         image_create_info.flags = 0;
@@ -4956,7 +4956,7 @@
         image_create_info.extent.depth = 1;
         image_create_info.mipLevels = 1;
         image_create_info.arrayLayers = 1;
-        image_create_info.samples = 1;
+        image_create_info.samples = VK_SAMPLE_COUNT_1_BIT;
         image_create_info.tiling = VK_IMAGE_TILING_LINEAR;
         image_create_info.usage = VK_IMAGE_USAGE_TRANSFER_SRC_BIT;
         image_create_info.flags = 0;
@@ -5056,7 +5056,7 @@
         image_create_info.extent.depth = 1;
         image_create_info.mipLevels = 1;
         image_create_info.arrayLayers = 1;
-        image_create_info.samples = 1;
+        image_create_info.samples = VK_SAMPLE_COUNT_1_BIT;
         image_create_info.tiling = VK_IMAGE_TILING_LINEAR;
         image_create_info.usage = VK_IMAGE_USAGE_TRANSFER_SRC_BIT;
         image_create_info.flags = 0;
@@ -5159,7 +5159,7 @@
         image_create_info.extent.depth = 1;
         image_create_info.mipLevels = 1;
         image_create_info.arrayLayers = 1;
-        image_create_info.samples = 2;
+        image_create_info.samples = VK_SAMPLE_COUNT_2_BIT;
         image_create_info.tiling = VK_IMAGE_TILING_LINEAR;
         // Note: Some implementations expect color attachment usage for any multisample surface
         image_create_info.usage = VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
@@ -5264,7 +5264,7 @@
         image_create_info.extent.depth = 1;
         image_create_info.mipLevels = 1;
         image_create_info.arrayLayers = 1;
-        image_create_info.samples = 2;
+        image_create_info.samples = VK_SAMPLE_COUNT_2_BIT;
         image_create_info.tiling = VK_IMAGE_TILING_LINEAR;
         // Note: Some implementations expect color attachment usage for any multisample surface
         image_create_info.usage = VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
@@ -5277,7 +5277,7 @@
         image_create_info.format = VK_FORMAT_R32_SFLOAT;
         // Note: Some implementations expect color attachment usage for any multisample surface
         image_create_info.usage = VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
-        image_create_info.samples = 1;
+        image_create_info.samples = VK_SAMPLE_COUNT_1_BIT;
 
     err = vkCreateImage(m_device->device(), &image_create_info, NULL, &dstImage);
     ASSERT_VK_SUCCESS(err);
@@ -5371,7 +5371,7 @@
         image_create_info.extent.depth = 1;
         image_create_info.mipLevels = 1;
         image_create_info.arrayLayers = 1;
-        image_create_info.samples = 2;
+        image_create_info.samples = VK_SAMPLE_COUNT_2_BIT;
         image_create_info.tiling = VK_IMAGE_TILING_LINEAR;
         // Note: Some implementations expect color attachment usage for any multisample surface
         image_create_info.usage = VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
@@ -5383,7 +5383,7 @@
         image_create_info.imageType = VK_IMAGE_TYPE_1D;
         // Note: Some implementations expect color attachment usage for any multisample surface
         image_create_info.usage = VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
-        image_create_info.samples = 1;
+        image_create_info.samples = VK_SAMPLE_COUNT_1_BIT;
 
     err = vkCreateImage(m_device->device(), &image_create_info, NULL, &dstImage);
     ASSERT_VK_SUCCESS(err);
@@ -5521,7 +5521,7 @@
         image_create_info.extent.depth = 1;
         image_create_info.mipLevels = 1;
         image_create_info.arrayLayers = 1;
-        image_create_info.samples = 1;
+        image_create_info.samples = VK_SAMPLE_COUNT_1_BIT;
         image_create_info.tiling = VK_IMAGE_TILING_OPTIMAL;
         image_create_info.usage = VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT;
         image_create_info.flags = 0;
diff --git a/tests/vkrenderframework.cpp b/tests/vkrenderframework.cpp
index 1d003c9..849b32f 100644
--- a/tests/vkrenderframework.cpp
+++ b/tests/vkrenderframework.cpp
@@ -277,7 +277,7 @@
 
     VkAttachmentDescription att = {};
     att.format = m_render_target_fmt;
-    att.samples = 1;
+    att.samples = VK_SAMPLE_COUNT_1_BIT;
     att.loadOp = (m_clear_via_load_op) ? VK_ATTACHMENT_LOAD_OP_CLEAR : VK_ATTACHMENT_LOAD_OP_LOAD;
     att.storeOp = VK_ATTACHMENT_STORE_OP_STORE;
     att.stencilLoadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE;
@@ -1143,7 +1143,7 @@
     m_ms_state.pSampleMask = NULL;
     m_ms_state.alphaToCoverageEnable = VK_FALSE;
     m_ms_state.alphaToOneEnable = VK_FALSE;
-    m_ms_state.rasterizationSamples = 1;
+    m_ms_state.rasterizationSamples = VK_SAMPLE_COUNT_1_BIT;
     m_ms_state.minSampleShading = 0;
     m_ms_state.sampleShadingEnable = 0;
 
@@ -1662,7 +1662,7 @@
     image_info.extent.depth = 1;
     image_info.mipLevels = 1;
     image_info.arrayLayers = 1;
-    image_info.samples = 1;
+    image_info.samples = VK_SAMPLE_COUNT_1_BIT;
     image_info.tiling = VK_IMAGE_TILING_OPTIMAL;
     image_info.usage = VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT;
     image_info.flags = 0;
diff --git a/tests/vktestbinding.cpp b/tests/vktestbinding.cpp
index eb0dae3..9b0b0f8 100644
--- a/tests/vktestbinding.cpp
+++ b/tests/vktestbinding.cpp
@@ -609,7 +609,7 @@
 bool Image::transparent() const
 {
     return (create_info_.tiling == VK_IMAGE_TILING_LINEAR &&
-            create_info_.samples == 1 &&
+            create_info_.samples == VK_SAMPLE_COUNT_1_BIT &&
             !(create_info_.usage & (VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT |
                                     VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT)));
 }
diff --git a/tests/vktestbinding.h b/tests/vktestbinding.h
index 926de6c..a9df345 100644
--- a/tests/vktestbinding.h
+++ b/tests/vktestbinding.h
@@ -663,7 +663,7 @@
     info.extent.depth = 1;
     info.mipLevels = 1;
     info.arrayLayers = 1;
-    info.samples = 1;
+    info.samples = VK_SAMPLE_COUNT_1_BIT;
     return info;
 }