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/include/vulkan.h b/include/vulkan.h
index df7c461..f695663 100644
--- a/include/vulkan.h
+++ b/include/vulkan.h
@@ -1187,7 +1187,6 @@
uint32_t maxImageDimension3D;
uint32_t maxImageDimensionCube;
uint32_t maxImageArrayLayers;
- VkSampleCountFlags sampleCounts;
uint32_t maxTexelBufferElements;
uint32_t maxUniformBufferRange;
uint32_t maxStorageBufferRange;
@@ -1259,15 +1258,16 @@
uint32_t maxFramebufferWidth;
uint32_t maxFramebufferHeight;
uint32_t maxFramebufferLayers;
- uint32_t maxFramebufferColorSamples;
- uint32_t maxFramebufferDepthSamples;
- uint32_t maxFramebufferStencilSamples;
+ VkSampleCountFlags framebufferColorSampleCounts;
+ VkSampleCountFlags framebufferDepthSampleCounts;
+ VkSampleCountFlags framebufferStencilSampleCounts;
+ VkSampleCountFlags framebufferNoAttachmentsSampleCounts;
uint32_t maxColorAttachments;
- uint32_t maxSampledImageColorSamples;
- uint32_t maxSampledImageDepthSamples;
- uint32_t maxSampledImageStencilSamples;
- uint32_t maxSampledImageIntegerSamples;
- uint32_t maxStorageImageSamples;
+ VkSampleCountFlags sampledImageColorSampleCounts;
+ VkSampleCountFlags sampledImageIntegerSampleCounts;
+ VkSampleCountFlags sampledImageDepthSampleCounts;
+ VkSampleCountFlags sampledImageStencilSampleCounts;
+ VkSampleCountFlags storageImageSampleCounts;
uint32_t maxSampleMaskWords;
float timestampPeriod;
uint32_t maxClipDistances;
@@ -1526,7 +1526,7 @@
VkExtent3D extent;
uint32_t mipLevels;
uint32_t arrayLayers;
- uint32_t samples;
+ VkSampleCountFlagBits samples;
VkImageTiling tiling;
VkImageUsageFlags usage;
VkSharingMode sharingMode;
@@ -1699,7 +1699,7 @@
VkStructureType sType;
const void* pNext;
VkPipelineMultisampleStateCreateFlags flags;
- uint32_t rasterizationSamples;
+ VkSampleCountFlagBits rasterizationSamples;
VkBool32 sampleShadingEnable;
float minSampleShading;
const VkSampleMask* pSampleMask;
@@ -1920,7 +1920,7 @@
typedef struct VkAttachmentDescription {
VkAttachmentDescriptionFlags flags;
VkFormat format;
- uint32_t samples;
+ VkSampleCountFlagBits samples;
VkAttachmentLoadOp loadOp;
VkAttachmentStoreOp storeOp;
VkAttachmentLoadOp stencilLoadOp;
@@ -2165,7 +2165,7 @@
typedef void (VKAPI *PFN_vkGetBufferMemoryRequirements)(VkDevice device, VkBuffer buffer, VkMemoryRequirements* pMemoryRequirements);
typedef void (VKAPI *PFN_vkGetImageMemoryRequirements)(VkDevice device, VkImage image, VkMemoryRequirements* pMemoryRequirements);
typedef void (VKAPI *PFN_vkGetImageSparseMemoryRequirements)(VkDevice device, VkImage image, uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements* pSparseMemoryRequirements);
-typedef void (VKAPI *PFN_vkGetPhysicalDeviceSparseImageFormatProperties)(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, uint32_t samples, VkImageUsageFlags usage, VkImageTiling tiling, uint32_t* pPropertyCount, VkSparseImageFormatProperties* pProperties);
+typedef void (VKAPI *PFN_vkGetPhysicalDeviceSparseImageFormatProperties)(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkSampleCountFlagBits samples, VkImageUsageFlags usage, VkImageTiling tiling, uint32_t* pPropertyCount, VkSparseImageFormatProperties* pProperties);
typedef VkResult (VKAPI *PFN_vkQueueBindSparse)(VkQueue queue, uint32_t bindInfoCount, const VkBindSparseInfo* pBindInfo, VkFence fence);
typedef VkResult (VKAPI *PFN_vkCreateFence)(VkDevice device, const VkFenceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkFence* pFence);
typedef void (VKAPI *PFN_vkDestroyFence)(VkDevice device, VkFence fence, const VkAllocationCallbacks* pAllocator);
@@ -2442,7 +2442,7 @@
VkPhysicalDevice physicalDevice,
VkFormat format,
VkImageType type,
- uint32_t samples,
+ VkSampleCountFlagBits samples,
VkImageUsageFlags usage,
VkImageTiling tiling,
uint32_t* pPropertyCount,
diff --git a/layers/device_limits.cpp b/layers/device_limits.cpp
index 89d5885..257a669 100644
--- a/layers/device_limits.cpp
+++ b/layers/device_limits.cpp
@@ -311,7 +311,7 @@
get_my_data_ptr(get_dispatch_key(physicalDevice), layer_data_map)->instance_dispatch_table->GetPhysicalDeviceMemoryProperties(physicalDevice, pMemoryProperties);
}
-VK_LAYER_EXPORT void VKAPI vkGetPhysicalDeviceSparseImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, uint32_t samples, VkImageUsageFlags usage, VkImageTiling tiling, uint32_t* pNumProperties, VkSparseImageFormatProperties* pProperties)
+VK_LAYER_EXPORT void VKAPI vkGetPhysicalDeviceSparseImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkSampleCountFlagBits samples, VkImageUsageFlags usage, VkImageTiling tiling, uint32_t* pNumProperties, VkSparseImageFormatProperties* pProperties)
{
get_my_data_ptr(get_dispatch_key(physicalDevice), layer_data_map)->instance_dispatch_table->GetPhysicalDeviceSparseImageFormatProperties(physicalDevice, format, type, samples, usage, tiling, pNumProperties, pProperties);
}
diff --git a/layers/draw_state.cpp b/layers/draw_state.cpp
index fda3b52..c50a23a 100755
--- a/layers/draw_state.cpp
+++ b/layers/draw_state.cpp
@@ -575,46 +575,46 @@
my_data->pipelineMap.clear();
}
// For given pipeline, return number of MSAA samples, or one if MSAA disabled
-static uint32_t getNumSamples(layer_data* my_data, const VkPipeline pipeline)
+static VkSampleCountFlagBits getNumSamples(layer_data* my_data, const VkPipeline pipeline)
{
PIPELINE_NODE* pPipe = my_data->pipelineMap[pipeline];
if (VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO == pPipe->msStateCI.sType) {
return pPipe->msStateCI.rasterizationSamples;
}
- return 1;
+ return VK_SAMPLE_COUNT_1_BIT;
}
// Validate state related to the PSO
static VkBool32 validatePipelineState(layer_data* my_data, const GLOBAL_CB_NODE* pCB, const VkPipelineBindPoint pipelineBindPoint, const VkPipeline pipeline)
{
if (VK_PIPELINE_BIND_POINT_GRAPHICS == pipelineBindPoint) {
// Verify that any MSAA request in PSO matches sample# in bound FB
- uint32_t psoNumSamples = getNumSamples(my_data, pipeline);
+ VkSampleCountFlagBits psoNumSamples = getNumSamples(my_data, pipeline);
if (pCB->activeRenderPass) {
const VkRenderPassCreateInfo* pRPCI = my_data->renderPassMap[pCB->activeRenderPass];
const VkSubpassDescription* pSD = &pRPCI->pSubpasses[pCB->activeSubpass];
- int subpassNumSamples = 0;
+ VkSampleCountFlagBits subpassNumSamples = (VkSampleCountFlagBits) 0;
uint32_t i;
for (i = 0; i < pSD->colorAttachmentCount; i++) {
- uint32_t samples;
+ VkSampleCountFlagBits samples;
if (pSD->pColorAttachments[i].attachment == VK_ATTACHMENT_UNUSED)
continue;
samples = pRPCI->pAttachments[pSD->pColorAttachments[i].attachment].samples;
- if (subpassNumSamples == 0) {
+ if (subpassNumSamples == (VkSampleCountFlagBits) 0) {
subpassNumSamples = samples;
} else if (subpassNumSamples != samples) {
- subpassNumSamples = -1;
+ subpassNumSamples = (VkSampleCountFlagBits) -1;
break;
}
}
if (pSD->pDepthStencilAttachment && pSD->pDepthStencilAttachment->attachment != VK_ATTACHMENT_UNUSED) {
- const uint32_t samples = pRPCI->pAttachments[pSD->pDepthStencilAttachment->attachment].samples;
- if (subpassNumSamples == 0)
+ const VkSampleCountFlagBits samples = pRPCI->pAttachments[pSD->pDepthStencilAttachment->attachment].samples;
+ if (subpassNumSamples == (VkSampleCountFlagBits) 0)
subpassNumSamples = samples;
else if (subpassNumSamples != samples)
- subpassNumSamples = -1;
+ subpassNumSamples = (VkSampleCountFlagBits) -1;
}
if (psoNumSamples != subpassNumSamples) {
diff --git a/layers/image.cpp b/layers/image.cpp
index b210d64..0380163 100644
--- a/layers/image.cpp
+++ b/layers/image.cpp
@@ -888,12 +888,12 @@
skipCall |= log_msg(device_data->report_data, VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_COMMAND_BUFFER,
(uint64_t)commandBuffer, 0, IMAGE_MISMATCHED_IMAGE_TYPE, "IMAGE", str);
}
- if (srcImageEntry->second.samples <= 1) {
+ if (srcImageEntry->second.samples == VK_SAMPLE_COUNT_1_BIT) {
char const str[] = "vkCmdResolveImage called with source sample count less than 2.";
skipCall |= log_msg(device_data->report_data, VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_COMMAND_BUFFER,
(uint64_t)commandBuffer, 0, IMAGE_INVALID_RESOLVE_SAMPLES, "IMAGE", str);
}
- if (dstImageEntry->second.samples > 1) {
+ if (dstImageEntry->second.samples != VK_SAMPLE_COUNT_1_BIT) {
char const str[] = "vkCmdResolveImage called with dest sample count greater than 1.";
skipCall |= log_msg(device_data->report_data, VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_COMMAND_BUFFER,
(uint64_t)commandBuffer, 0, IMAGE_INVALID_RESOLVE_SAMPLES, "IMAGE", str);
diff --git a/layers/image.h b/layers/image.h
index dcfb81a..7ff98fe 100644
--- a/layers/image.h
+++ b/layers/image.h
@@ -49,10 +49,10 @@
uint32_t mipLevels;
uint32_t arraySize;
VkFormat format;
- uint32_t samples;
+ VkSampleCountFlagBits samples;
VkImageType imageType;
VkExtent3D extent;
- _IMAGE_STATE():mipLevels(0), arraySize(0), format(VK_FORMAT_UNDEFINED), samples(0), imageType(VK_IMAGE_TYPE_RANGE_SIZE), extent{} {};
+ _IMAGE_STATE():mipLevels(0), arraySize(0), format(VK_FORMAT_UNDEFINED), samples(VK_SAMPLE_COUNT_1_BIT), imageType(VK_IMAGE_TYPE_RANGE_SIZE), extent{} {};
_IMAGE_STATE(const VkImageCreateInfo* pCreateInfo):
mipLevels(pCreateInfo->mipLevels),
arraySize(pCreateInfo->arrayLayers),
diff --git a/layers/param_checker.cpp b/layers/param_checker.cpp
index 30d345d..1acb7ba 100644
--- a/layers/param_checker.cpp
+++ b/layers/param_checker.cpp
@@ -2527,7 +2527,7 @@
VkPhysicalDevice physicalDevice,
VkFormat format,
VkImageType type,
- uint32_t samples,
+ VkSampleCountFlagBits samples,
VkImageUsageFlags usage,
VkImageTiling tiling,
uint32_t* pNumProperties,
@@ -2582,7 +2582,7 @@
VkPhysicalDevice physicalDevice,
VkFormat format,
VkImageType type,
- uint32_t samples,
+ VkSampleCountFlagBits samples,
VkImageUsageFlags usage,
VkImageTiling tiling,
uint32_t* pNumProperties,
diff --git a/layers/screenshot.cpp b/layers/screenshot.cpp
index ddd6566..734e719 100644
--- a/layers/screenshot.cpp
+++ b/layers/screenshot.cpp
@@ -158,7 +158,7 @@
{width, height, 1},
1,
1,
- 1,
+ VK_SAMPLE_COUNT_1_BIT,
VK_IMAGE_TILING_LINEAR,
(VK_IMAGE_USAGE_TRANSFER_DST_BIT|VK_IMAGE_USAGE_STORAGE_BIT),
};
diff --git a/loader/loader.c b/loader/loader.c
index 1437e8a..13dd90f 100644
--- a/loader/loader.c
+++ b/loader/loader.c
@@ -2937,7 +2937,7 @@
VkPhysicalDevice physicalDevice,
VkFormat format,
VkImageType type,
- uint32_t samples,
+ VkSampleCountFlagBits samples,
VkImageUsageFlags usage,
VkImageTiling tiling,
uint32_t* pNumProperties,
diff --git a/loader/loader.h b/loader/loader.h
index 829b2d1..f356a79 100644
--- a/loader/loader.h
+++ b/loader/loader.h
@@ -302,7 +302,7 @@
VkPhysicalDevice physicalDevice,
VkFormat format,
VkImageType type,
- uint32_t samples,
+ VkSampleCountFlagBits samples,
VkImageUsageFlags usage,
VkImageTiling tiling,
uint32_t* pNumProperties,
diff --git a/loader/trampoline.c b/loader/trampoline.c
index e86a949..99c5279 100644
--- a/loader/trampoline.c
+++ b/loader/trampoline.c
@@ -483,7 +483,7 @@
disp->GetImageSparseMemoryRequirements(device, image, pSparseMemoryRequirementCount, pSparseMemoryRequirements);
}
-LOADER_EXPORT void VKAPI vkGetPhysicalDeviceSparseImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, uint32_t samples, VkImageUsageFlags usage, VkImageTiling tiling, uint32_t* pPropertyCount, VkSparseImageFormatProperties* pProperties)
+LOADER_EXPORT void VKAPI vkGetPhysicalDeviceSparseImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkSampleCountFlagBits samples, VkImageUsageFlags usage, VkImageTiling tiling, uint32_t* pPropertyCount, VkSparseImageFormatProperties* pProperties)
{
const VkLayerInstanceDispatchTable *disp;
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;
}
diff --git a/vulkan.py b/vulkan.py
index 7779f90..d7d7c2f 100755
--- a/vulkan.py
+++ b/vulkan.py
@@ -381,7 +381,7 @@
[Param("VkPhysicalDevice", "physicalDevice"),
Param("VkFormat", "format"),
Param("VkImageType", "type"),
- Param("uint32_t", "samples"),
+ Param("VkSampleCountFlagBits", "samples"),
Param("VkImageUsageFlags", "usage"),
Param("VkImageTiling", "tiling"),
Param("uint32_t*", "pPropertyCount"),