aboutsummaryrefslogtreecommitdiff
path: root/layers/core_validation.cpp
diff options
context:
space:
mode:
authorTobin Ehlis <tobine@ad.corp.google.com>2016-06-07 06:06:01 -0600
committerTobin Ehlis <tobine@google.com>2016-06-20 14:31:51 -0600
commitd5d2f7606389a2ba9d27e23899c0ded782eb7559 (patch)
tree315b63e5875e43a80ebb4f6e46f6f80828d07005 /layers/core_validation.cpp
parent592ca3638fa62d3db95d2bf69b5c3594068e6477 (diff)
downloadusermoji-d5d2f7606389a2ba9d27e23899c0ded782eb7559.tar.xz
layers: Add PSO render pass compability check
At draw time, the active render pass must be compatible with the render pass that the gfx pipeline was created with.
Diffstat (limited to 'layers/core_validation.cpp')
-rw-r--r--layers/core_validation.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp
index 29703f65..b4d8e510 100644
--- a/layers/core_validation.cpp
+++ b/layers/core_validation.cpp
@@ -2151,7 +2151,7 @@ static bool attachment_references_compatible(const uint32_t index, const VkAttac
}
// For give primary and secondary RenderPass objects, verify that they're compatible
-static bool verify_renderpass_compatibility(layer_data *my_data, const VkRenderPass primaryRP, const VkRenderPass secondaryRP,
+static bool verify_renderpass_compatibility(const layer_data *my_data, const VkRenderPass primaryRP, const VkRenderPass secondaryRP,
string &errorMsg) {
auto primary_render_pass = getRenderPass(my_data, primaryRP);
auto secondary_render_pass = getRenderPass(my_data, secondaryRP);
@@ -2849,6 +2849,21 @@ static bool validatePipelineDrawtimeState(layer_data const *my_data,
reinterpret_cast<const uint64_t &>(pPipeline->pipeline));
}
}
+ // Verify that PSO creation renderPass is compatible with active renderPass
+ if (pCB->activeRenderPass) {
+ std::string err_string;
+ if (!verify_renderpass_compatibility(my_data, pCB->activeRenderPass->renderPass, pPipeline->graphicsPipelineCI.renderPass,
+ err_string)) {
+ // renderPass that PSO was created with must be compatible with active renderPass that PSO is being used with
+ skip_call |=
+ log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT,
+ reinterpret_cast<const uint64_t &>(pPipeline->pipeline), __LINE__, DRAWSTATE_RENDERPASS_INCOMPATIBLE, "DS",
+ "At Draw time the active render pass (0x%" PRIxLEAST64 ") is incompatible w/ gfx pipeline "
+ "(0x%" PRIxLEAST64 ") that was created w/ render pass (0x%" PRIxLEAST64 ") due to: %s",
+ reinterpret_cast<uint64_t &>(pCB->activeRenderPass->renderPass), reinterpret_cast<uint64_t &>(pPipeline),
+ reinterpret_cast<const uint64_t &>(pPipeline->graphicsPipelineCI.renderPass), err_string.c_str());
+ }
+ }
// TODO : Add more checks here
return skip_call;