aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorByumjinConffx <byumjin@conffx.com>2019-08-14 15:13:11 -0700
committerMark Lobodzinski <mark@lunarg.com>2019-08-20 12:18:41 -0600
commitbbc68b1345c0e555ff4c151ab906641db2bc0829 (patch)
tree4b4551c13622b1699fc7a24148bdafaf973dbc96
parent7ec28b499027f643b52ee91b194ebd74d6cda06d (diff)
downloadvulkan-validation-layers-bbc68b1345c0e555ff4c151ab906641db2bc0829.tar.gz
layers: Add fragmentDensityMapAttachment val
Adds VUID-VkRenderPassFragmentDensityMapCreateInfoEXT-fragmentDensityMapAttachment validation codes for FragmentDensityMap.
-rw-r--r--layers/core_validation.cpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp
index e14838631..abbdbd763 100644
--- a/layers/core_validation.cpp
+++ b/layers/core_validation.cpp
@@ -10650,6 +10650,46 @@ bool CoreChecks::PreCallValidateCreateRenderPass(VkDevice device, const VkRender
}
}
}
+ const VkRenderPassFragmentDensityMapCreateInfoEXT *pFragmentDensityMapInfo =
+ lvl_find_in_chain<VkRenderPassFragmentDensityMapCreateInfoEXT>(pCreateInfo->pNext);
+ if (pFragmentDensityMapInfo) {
+ if (pFragmentDensityMapInfo->fragmentDensityMapAttachment.attachment != VK_ATTACHMENT_UNUSED) {
+ if (pFragmentDensityMapInfo->fragmentDensityMapAttachment.attachment >= pCreateInfo->attachmentCount) {
+ skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
+ "VUID-VkRenderPassFragmentDensityMapCreateInfoEXT-fragmentDensityMapAttachment-02547",
+ "fragmentDensityMapAttachment %u must be less than attachmentCount %u of for this render pass.",
+ pFragmentDensityMapInfo->fragmentDensityMapAttachment.attachment, pCreateInfo->attachmentCount);
+ } else {
+ if (!(pFragmentDensityMapInfo->fragmentDensityMapAttachment.layout ==
+ VK_IMAGE_LAYOUT_FRAGMENT_DENSITY_MAP_OPTIMAL_EXT ||
+ pFragmentDensityMapInfo->fragmentDensityMapAttachment.layout == VK_IMAGE_LAYOUT_GENERAL)) {
+ skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
+ "VUID-VkRenderPassFragmentDensityMapCreateInfoEXT-fragmentDensityMapAttachment-02549",
+ "Layout of fragmentDensityMapAttachment %u' must be equal to "
+ "VK_IMAGE_LAYOUT_FRAGMENT_DENSITY_MAP_OPTIMAL_EXT, or VK_IMAGE_LAYOUT_GENERAL.",
+ pFragmentDensityMapInfo->fragmentDensityMapAttachment.attachment);
+ }
+ if (!(pCreateInfo->pAttachments[pFragmentDensityMapInfo->fragmentDensityMapAttachment.attachment].loadOp ==
+ VK_ATTACHMENT_LOAD_OP_LOAD ||
+ pCreateInfo->pAttachments[pFragmentDensityMapInfo->fragmentDensityMapAttachment.attachment].loadOp ==
+ VK_ATTACHMENT_LOAD_OP_DONT_CARE)) {
+ skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
+ "VUID-VkRenderPassFragmentDensityMapCreateInfoEXT-fragmentDensityMapAttachment-02550",
+ "FragmentDensityMapAttachment %u' must reference an attachment with a loadOp "
+ "equal to VK_ATTACHMENT_LOAD_OP_LOAD or VK_ATTACHMENT_LOAD_OP_DONT_CARE.",
+ pFragmentDensityMapInfo->fragmentDensityMapAttachment.attachment);
+ }
+ if (pCreateInfo->pAttachments[pFragmentDensityMapInfo->fragmentDensityMapAttachment.attachment].storeOp !=
+ VK_ATTACHMENT_STORE_OP_DONT_CARE) {
+ skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
+ "VUID-VkRenderPassFragmentDensityMapCreateInfoEXT-fragmentDensityMapAttachment-02551",
+ "FragmentDensityMapAttachment %u' must reference an attachment with a storeOp "
+ "equal to VK_ATTACHMENT_STORE_OP_DONT_CARE.",
+ pFragmentDensityMapInfo->fragmentDensityMapAttachment.attachment);
+ }
+ }
+ }
+ }
if (!skip) {
safe_VkRenderPassCreateInfo2KHR create_info_2;