From b74c683ea7e241d0592138db5f32f260fd95d8a4 Mon Sep 17 00:00:00 2001 From: Mark Lobodzinski Date: Wed, 1 Mar 2017 15:01:45 -0700 Subject: [PATCH] layers: Add alphaToOne device feature validation Change-Id: I1633cf7a8a5ebeed797cdb5373e5eb2533ce6887 --- layers/core_validation.cpp | 9 +++++++++ layers/vk_validation_error_database.txt | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index 5c8b794..e5765aa 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -3253,6 +3253,15 @@ static bool verifyPipelineCreateState(layer_data *dev_data, std::vectorgraphicsPipelineCI.pRasterizationState->rasterizerDiscardEnable == VK_FALSE) { auto subpass_desc = renderPass ? &renderPass->createInfo.pSubpasses[pPipeline->graphicsPipelineCI.subpass] : nullptr; + if ((pPipeline->graphicsPipelineCI.pMultisampleState->alphaToOneEnable == VK_TRUE) && + (!dev_data->enabled_features.alphaToOne)) { + skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, + 0, __LINE__, VALIDATION_ERROR_01464, "DS", + "vkCreateGraphicsPipelines(): the alphaToOne device feature is disabled: the alphaToOneEnable " + "member of the VkPipelineMultisampleStateCreateInfo structure must be set to VK_FALSE.", + validation_error_map[VALIDATION_ERROR_01464]); + } + // If subpass uses a depth/stencil attachment, pDepthStencilState must be a pointer to a valid structure if (subpass_desc && subpass_desc->pDepthStencilAttachment && subpass_desc->pDepthStencilAttachment->attachment != VK_ATTACHMENT_UNUSED) { diff --git a/layers/vk_validation_error_database.txt b/layers/vk_validation_error_database.txt index dfab0df..f9bb9c5 100644 --- a/layers/vk_validation_error_database.txt +++ b/layers/vk_validation_error_database.txt @@ -1449,7 +1449,7 @@ VALIDATION_ERROR_01460~^~N~^~Unknown~^~vkCmdSetViewport~^~For more information r VALIDATION_ERROR_01461~^~N~^~Unknown~^~vkCmdSetViewport~^~For more information refer to Vulkan Spec Section '24. Rasterization' which states 'cullMode must be a valid combination of VkCullModeFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#VkPipelineRasterizationStateCreateInfo)~^~implicit VALIDATION_ERROR_01462~^~N~^~Unknown~^~vkCmdSetViewport~^~For more information refer to Vulkan Spec Section '24. Rasterization' which states 'frontFace must be a valid VkFrontFace value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#VkPipelineRasterizationStateCreateInfo)~^~implicit VALIDATION_ERROR_01463~^~N~^~Unknown~^~vkCmdSetViewport~^~For more information refer to Vulkan Spec Section '24. Rasterization' which states 'If the sample rate shading feature is not enabled, sampleShadingEnable must be VK_FALSE' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#VkPipelineMultisampleStateCreateInfo)~^~ -VALIDATION_ERROR_01464~^~N~^~Unknown~^~vkCmdSetViewport~^~For more information refer to Vulkan Spec Section '24. Rasterization' which states 'If the alpha to one feature is not enabled, alphaToOneEnable must be VK_FALSE' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#VkPipelineMultisampleStateCreateInfo)~^~ +VALIDATION_ERROR_01464~^~Y~^~None~^~vkCmdSetViewport~^~For more information refer to Vulkan Spec Section '24. Rasterization' which states 'If the alpha to one feature is not enabled, alphaToOneEnable must be VK_FALSE' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#VkPipelineMultisampleStateCreateInfo)~^~ VALIDATION_ERROR_01465~^~N~^~Unknown~^~vkCmdSetViewport~^~For more information refer to Vulkan Spec Section '24. Rasterization' which states 'minSampleShading must be in the range [0,1]' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#VkPipelineMultisampleStateCreateInfo)~^~ VALIDATION_ERROR_01466~^~N~^~Unknown~^~vkCmdSetViewport~^~For more information refer to Vulkan Spec Section '24. Rasterization' which states 'sType must be VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#VkPipelineMultisampleStateCreateInfo)~^~implicit, TBD in parameter validation layer. VALIDATION_ERROR_01467~^~N~^~Unknown~^~vkCmdSetViewport~^~For more information refer to Vulkan Spec Section '24. Rasterization' which states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#VkPipelineMultisampleStateCreateInfo)~^~implicit, TBD in parameter validation layer. -- 2.7.4