aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Forbes <chrisforbes@google.com>2016-09-07 11:44:08 +1200
committerChris Forbes <chrisforbes@google.com>2016-09-07 16:58:24 +1200
commit1ba3bf459e699206d13e40697dcb1df93e0b9fd2 (patch)
tree8fdb0910ff626008f68e6b5059d60c2fd47004de
parent8c6b3e2ca5c408def872dbd8bbdb80f76589812c (diff)
downloadusermoji-1ba3bf459e699206d13e40697dcb1df93e0b9fd2.tar.xz
layers: add error to CmdNextSubpass if stepping beyond last subpass
Signed-off-by: Chris Forbes <chrisforbes@google.com>
-rw-r--r--layers/core_validation.cpp8
-rw-r--r--layers/core_validation_error_enums.h1
-rw-r--r--layers/vk_validation_layer_details.md1
3 files changed, 10 insertions, 0 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp
index df2c6c92..e5048e89 100644
--- a/layers/core_validation.cpp
+++ b/layers/core_validation.cpp
@@ -10070,6 +10070,14 @@ VKAPI_ATTR void VKAPI_CALL CmdNextSubpass(VkCommandBuffer commandBuffer, VkSubpa
skip_call |= validatePrimaryCommandBuffer(dev_data, pCB, "vkCmdNextSubpass");
skip_call |= addCmd(dev_data, pCB, CMD_NEXTSUBPASS, "vkCmdNextSubpass()");
skip_call |= outsideRenderPass(dev_data, pCB, "vkCmdNextSubpass");
+
+ auto subpassCount = pCB->activeRenderPass->pCreateInfo->subpassCount;
+ if (pCB->activeSubpass == subpassCount - 1) {
+ skip_call |=
+ log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
+ reinterpret_cast<uint64_t>(commandBuffer), __LINE__, DRAWSTATE_INVALID_SUBPASS_INDEX, "DS",
+ "vkCmdNextSubpass(): Attempted to advance beyond final subpass");
+ }
}
lock.unlock();
diff --git a/layers/core_validation_error_enums.h b/layers/core_validation_error_enums.h
index b90b9d4c..a736a5af 100644
--- a/layers/core_validation_error_enums.h
+++ b/layers/core_validation_error_enums.h
@@ -226,6 +226,7 @@ enum DRAW_STATE_ERROR {
DRAWSTATE_IMAGE_TRANSFER_GRANULARITY, // Violation of queue family's image transfer
// granularity
DRAWSTATE_PUSH_CONSTANTS_ERROR, // Push constants exceed maxPushConstantSize
+ DRAWSTATE_INVALID_SUBPASS_INDEX, // Stepping beyond last subpass, or not reaching it
};
// Shader Checker ERROR codes
diff --git a/layers/vk_validation_layer_details.md b/layers/vk_validation_layer_details.md
index 0d0a9fbf..80ae89a1 100644
--- a/layers/vk_validation_layer_details.md
+++ b/layers/vk_validation_layer_details.md
@@ -111,6 +111,7 @@ The Draw State portion of the core validation layer tracks state leading into Dr
| NA | Enum used for informational messages | NONE | | TODO | None |
| NA | Enum used for errors in the layer itself. This does not indicate an app issue, but instead a bug in the layer. | INTERNAL_ERROR | | TODO | None |
| NA | Enum used when VK_LAYER_LUNARG_core_validation attempts to allocate memory for its own internal use and is unable to. | OUT_OF_MEMORY | | TODO | None |
+| Bad subpass indexing | Must not step beyond last subpass in a renderpass instance, and must reach the last subpass before CmdEndRenderPass. | INVALID_SUBPASS_INDEX | vkCmdNextSubpass | RenderPassExcessiveNextSubpass | NA |
### VK_LAYER_LUNARG_core_validation Draw State Pending Work