From 3efad33bc94e6ab74bcc8aadbf24aede15461c7f Mon Sep 17 00:00:00 2001 From: Mark Lobodzinski Date: Wed, 28 Jun 2017 11:47:22 -0600 Subject: layers: Wire up ranged-enum PV VUIDs Change-Id: I334357b239a6f2ad28fad226306897606814095a --- layers/parameter_validation.cpp | 48 +++++++++++++++++++++++++---------------- 1 file changed, 29 insertions(+), 19 deletions(-) (limited to 'layers/parameter_validation.cpp') diff --git a/layers/parameter_validation.cpp b/layers/parameter_validation.cpp index a8394587..a577de38 100644 --- a/layers/parameter_validation.cpp +++ b/layers/parameter_validation.cpp @@ -2177,7 +2177,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateGraphicsPipelines(VkDevice device, VkPipeli report_data, "vkCreateGraphicsPipelines", ParameterName("pCreateInfos[%i].pDepthStencilState->depthCompareOp", ParameterName::IndexVector{i}), "VkCompareOp", VK_COMPARE_OP_BEGIN_RANGE, VK_COMPARE_OP_END_RANGE, - pCreateInfos[i].pDepthStencilState->depthCompareOp); + pCreateInfos[i].pDepthStencilState->depthCompareOp, VALIDATION_ERROR_0f604001); skip |= validate_bool32( report_data, "vkCreateGraphicsPipelines", @@ -2193,49 +2193,49 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateGraphicsPipelines(VkDevice device, VkPipeli report_data, "vkCreateGraphicsPipelines", ParameterName("pCreateInfos[%i].pDepthStencilState->front.failOp", ParameterName::IndexVector{i}), "VkStencilOp", VK_STENCIL_OP_BEGIN_RANGE, VK_STENCIL_OP_END_RANGE, - pCreateInfos[i].pDepthStencilState->front.failOp); + pCreateInfos[i].pDepthStencilState->front.failOp, VALIDATION_ERROR_13a08601); skip |= validate_ranged_enum( report_data, "vkCreateGraphicsPipelines", ParameterName("pCreateInfos[%i].pDepthStencilState->front.passOp", ParameterName::IndexVector{i}), "VkStencilOp", VK_STENCIL_OP_BEGIN_RANGE, VK_STENCIL_OP_END_RANGE, - pCreateInfos[i].pDepthStencilState->front.passOp); + pCreateInfos[i].pDepthStencilState->front.passOp, VALIDATION_ERROR_13a27801); skip |= validate_ranged_enum( report_data, "vkCreateGraphicsPipelines", ParameterName("pCreateInfos[%i].pDepthStencilState->front.depthFailOp", ParameterName::IndexVector{i}), "VkStencilOp", VK_STENCIL_OP_BEGIN_RANGE, VK_STENCIL_OP_END_RANGE, - pCreateInfos[i].pDepthStencilState->front.depthFailOp); + pCreateInfos[i].pDepthStencilState->front.depthFailOp, VALIDATION_ERROR_13a04201); skip |= validate_ranged_enum( report_data, "vkCreateGraphicsPipelines", ParameterName("pCreateInfos[%i].pDepthStencilState->front.compareOp", ParameterName::IndexVector{i}), "VkCompareOp", VK_COMPARE_OP_BEGIN_RANGE, VK_COMPARE_OP_END_RANGE, - pCreateInfos[i].pDepthStencilState->front.compareOp); + pCreateInfos[i].pDepthStencilState->front.compareOp, VALIDATION_ERROR_0f604001); skip |= validate_ranged_enum( report_data, "vkCreateGraphicsPipelines", ParameterName("pCreateInfos[%i].pDepthStencilState->back.failOp", ParameterName::IndexVector{i}), "VkStencilOp", VK_STENCIL_OP_BEGIN_RANGE, VK_STENCIL_OP_END_RANGE, - pCreateInfos[i].pDepthStencilState->back.failOp); + pCreateInfos[i].pDepthStencilState->back.failOp, VALIDATION_ERROR_13a08601); skip |= validate_ranged_enum( report_data, "vkCreateGraphicsPipelines", ParameterName("pCreateInfos[%i].pDepthStencilState->back.passOp", ParameterName::IndexVector{i}), "VkStencilOp", VK_STENCIL_OP_BEGIN_RANGE, VK_STENCIL_OP_END_RANGE, - pCreateInfos[i].pDepthStencilState->back.passOp); + pCreateInfos[i].pDepthStencilState->back.passOp, VALIDATION_ERROR_13a27801); skip |= validate_ranged_enum( report_data, "vkCreateGraphicsPipelines", ParameterName("pCreateInfos[%i].pDepthStencilState->back.depthFailOp", ParameterName::IndexVector{i}), "VkStencilOp", VK_STENCIL_OP_BEGIN_RANGE, VK_STENCIL_OP_END_RANGE, - pCreateInfos[i].pDepthStencilState->back.depthFailOp); + pCreateInfos[i].pDepthStencilState->back.depthFailOp, VALIDATION_ERROR_13a04201); skip |= validate_ranged_enum( report_data, "vkCreateGraphicsPipelines", ParameterName("pCreateInfos[%i].pDepthStencilState->back.compareOp", ParameterName::IndexVector{i}), "VkCompareOp", VK_COMPARE_OP_BEGIN_RANGE, VK_COMPARE_OP_END_RANGE, - pCreateInfos[i].pDepthStencilState->back.compareOp); + pCreateInfos[i].pDepthStencilState->back.compareOp, VALIDATION_ERROR_0f604001); if (pCreateInfos[i].pDepthStencilState->sType != VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, @@ -2283,42 +2283,48 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateGraphicsPipelines(VkDevice device, VkPipeli ParameterName("pCreateInfos[%i].pColorBlendState->pAttachments[%i].srcColorBlendFactor", ParameterName::IndexVector{i, attachmentIndex}), "VkBlendFactor", VK_BLEND_FACTOR_BEGIN_RANGE, VK_BLEND_FACTOR_END_RANGE, - pCreateInfos[i].pColorBlendState->pAttachments[attachmentIndex].srcColorBlendFactor); + pCreateInfos[i].pColorBlendState->pAttachments[attachmentIndex].srcColorBlendFactor, + VALIDATION_ERROR_0f22cc01); skip |= validate_ranged_enum( report_data, "vkCreateGraphicsPipelines", ParameterName("pCreateInfos[%i].pColorBlendState->pAttachments[%i].dstColorBlendFactor", ParameterName::IndexVector{i, attachmentIndex}), "VkBlendFactor", VK_BLEND_FACTOR_BEGIN_RANGE, VK_BLEND_FACTOR_END_RANGE, - pCreateInfos[i].pColorBlendState->pAttachments[attachmentIndex].dstColorBlendFactor); + pCreateInfos[i].pColorBlendState->pAttachments[attachmentIndex].dstColorBlendFactor, + VALIDATION_ERROR_0f207001); skip |= validate_ranged_enum( report_data, "vkCreateGraphicsPipelines", ParameterName("pCreateInfos[%i].pColorBlendState->pAttachments[%i].colorBlendOp", ParameterName::IndexVector{i, attachmentIndex}), "VkBlendOp", VK_BLEND_OP_BEGIN_RANGE, VK_BLEND_OP_END_RANGE, - pCreateInfos[i].pColorBlendState->pAttachments[attachmentIndex].colorBlendOp); + pCreateInfos[i].pColorBlendState->pAttachments[attachmentIndex].colorBlendOp, + VALIDATION_ERROR_0f202001); skip |= validate_ranged_enum( report_data, "vkCreateGraphicsPipelines", ParameterName("pCreateInfos[%i].pColorBlendState->pAttachments[%i].srcAlphaBlendFactor", ParameterName::IndexVector{i, attachmentIndex}), "VkBlendFactor", VK_BLEND_FACTOR_BEGIN_RANGE, VK_BLEND_FACTOR_END_RANGE, - pCreateInfos[i].pColorBlendState->pAttachments[attachmentIndex].srcAlphaBlendFactor); + pCreateInfos[i].pColorBlendState->pAttachments[attachmentIndex].srcAlphaBlendFactor, + VALIDATION_ERROR_0f22c601); skip |= validate_ranged_enum( report_data, "vkCreateGraphicsPipelines", ParameterName("pCreateInfos[%i].pColorBlendState->pAttachments[%i].dstAlphaBlendFactor", ParameterName::IndexVector{i, attachmentIndex}), "VkBlendFactor", VK_BLEND_FACTOR_BEGIN_RANGE, VK_BLEND_FACTOR_END_RANGE, - pCreateInfos[i].pColorBlendState->pAttachments[attachmentIndex].dstAlphaBlendFactor); + pCreateInfos[i].pColorBlendState->pAttachments[attachmentIndex].dstAlphaBlendFactor, + VALIDATION_ERROR_0f206a01); skip |= validate_ranged_enum( report_data, "vkCreateGraphicsPipelines", ParameterName("pCreateInfos[%i].pColorBlendState->pAttachments[%i].alphaBlendOp", ParameterName::IndexVector{i, attachmentIndex}), "VkBlendOp", VK_BLEND_OP_BEGIN_RANGE, VK_BLEND_OP_END_RANGE, - pCreateInfos[i].pColorBlendState->pAttachments[attachmentIndex].alphaBlendOp); + pCreateInfos[i].pColorBlendState->pAttachments[attachmentIndex].alphaBlendOp, + VALIDATION_ERROR_0f200801); skip |= validate_flags(report_data, "vkCreateGraphicsPipelines", @@ -2343,7 +2349,8 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateGraphicsPipelines(VkDevice device, VkPipeli skip |= validate_ranged_enum( report_data, "vkCreateGraphicsPipelines", ParameterName("pCreateInfos[%i].pColorBlendState->logicOp", ParameterName::IndexVector{i}), "VkLogicOp", - VK_LOGIC_OP_BEGIN_RANGE, VK_LOGIC_OP_END_RANGE, pCreateInfos[i].pColorBlendState->logicOp); + VK_LOGIC_OP_BEGIN_RANGE, VK_LOGIC_OP_END_RANGE, pCreateInfos[i].pColorBlendState->logicOp, + VALIDATION_ERROR_UNDEFINED); } } } @@ -2461,7 +2468,8 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateSampler(VkDevice device, const VkSamplerCre // If compareEnable is VK_TRUE, compareOp must be a valid VkCompareOp value if (pCreateInfo->compareEnable == VK_TRUE) { skip |= validate_ranged_enum(report_data, "vkCreateSampler", "pCreateInfo->compareOp", "VkCompareOp", - VK_COMPARE_OP_BEGIN_RANGE, VK_COMPARE_OP_END_RANGE, pCreateInfo->compareOp); + VK_COMPARE_OP_BEGIN_RANGE, VK_COMPARE_OP_END_RANGE, pCreateInfo->compareOp, + VALIDATION_ERROR_12600870); } // If any of addressModeU, addressModeV or addressModeW are VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER, borderColor must be a @@ -2470,7 +2478,8 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateSampler(VkDevice device, const VkSamplerCre (pCreateInfo->addressModeV == VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER) || (pCreateInfo->addressModeW == VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER)) { skip |= validate_ranged_enum(report_data, "vkCreateSampler", "pCreateInfo->borderColor", "VkBorderColor", - VK_BORDER_COLOR_BEGIN_RANGE, VK_BORDER_COLOR_END_RANGE, pCreateInfo->borderColor); + VK_BORDER_COLOR_BEGIN_RANGE, VK_BORDER_COLOR_END_RANGE, pCreateInfo->borderColor, + VALIDATION_ERROR_1260086c); } // If any of addressModeU, addressModeV or addressModeW are VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE, the @@ -2731,7 +2740,8 @@ VKAPI_ATTR void VKAPI_CALL UpdateDescriptorSets(VkDevice device, uint32_t descri ParameterName("pDescriptorWrites[%i].pImageInfo[%i].imageLayout", ParameterName::IndexVector{i, descriptor_index}), "VkImageLayout", VK_IMAGE_LAYOUT_BEGIN_RANGE, VK_IMAGE_LAYOUT_END_RANGE, - pDescriptorWrites[i].pImageInfo[descriptor_index].imageLayout); + pDescriptorWrites[i].pImageInfo[descriptor_index].imageLayout, + VALIDATION_ERROR_UNDEFINED); } } } else if ((pDescriptorWrites[i].descriptorType == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER) || -- cgit v1.2.3