aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Forbes <chrisforbes@google.com>2016-09-08 17:55:54 +1200
committerChris Forbes <chrisforbes@google.com>2016-09-13 11:44:30 +1200
commitd75effecdfce7deda2829ba474383e31dd2d1afd (patch)
tree1340422327da61a80729cfeeac3f891d957ea806
parent5dcbc1d600dae780e98ae574d61dbd25cd584678 (diff)
downloadusermoji-d75effecdfce7deda2829ba474383e31dd2d1afd.tar.xz
layers: Require VkGraphicsPipelineCreateInfo::pDepthStencilState
If the subpass uses a depth/stencil attachment and rasterization is not disabled, then this structure must be present. Signed-off-by: Chris Forbes <chrisforbes@google.com>
-rw-r--r--layers/core_validation.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp
index 2124b67a..3b73f274 100644
--- a/layers/core_validation.cpp
+++ b/layers/core_validation.cpp
@@ -3425,6 +3425,20 @@ static bool verifyPipelineCreateState(layer_data *my_data, const VkDevice device
}
}
}
+
+ // If rasterization is not disabled, and subpass uses a depth/stencil
+ // attachment, pDepthStencilState must be a pointer to a valid structure
+ auto subpass_desc = renderPass ? &renderPass->pCreateInfo->pSubpasses[pPipeline->graphicsPipelineCI.subpass] : nullptr;
+ if (subpass_desc && subpass_desc->pDepthStencilAttachment &&
+ subpass_desc->pDepthStencilAttachment->attachment != VK_ATTACHMENT_UNUSED) {
+ if (!pPipeline->graphicsPipelineCI.pDepthStencilState) {
+ skip_call |= log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
+ __LINE__, DRAWSTATE_INVALID_PIPELINE_CREATE_STATE, "DS",
+ "Invalid Pipeline CreateInfo State: "
+ "pDepthStencilState is NULL when rasterization is enabled and subpass uses a "
+ "depth/stencil attachment");
+ }
+ }
}
return skip_call;
}