Remove old checks from pipeline.c and verify that they're handled in validation
Most checks were already handled in DrawState.
Added additional check for invalid patchControlPoints along with a new test, but test can't run on sample driver b/c TESS shaders not supported by the shader compiler.
For check that VBO vtx & attrib binding counts don't exceed VB array limit, added comment noting that this is a device-specific limit that should be captured in API-defined "maxVertexInputBindings" and added to DeviceLimits.
Also added pending task for ParamChecker to fix how it handles arrays in vkCreateGraphicsPipelines() call. It has a bug in how it handles check that each shader "stage" is within acceptable enum limits.
diff --git a/layers/draw_state.cpp b/layers/draw_state.cpp
index 8337711..4a894f2 100644
--- a/layers/draw_state.cpp
+++ b/layers/draw_state.cpp
@@ -505,10 +505,16 @@
skipCall |= log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) (VkDbgObjectType) 0, 0, 0, DRAWSTATE_INVALID_PIPELINE_CREATE_STATE, "DS",
"Invalid Pipeline CreateInfo State: VK_PRIMITIVE_TOPOLOGY_PATCH must be set as IA topology for tessellation pipelines");
}
- if ((pPipeline->iaStateCI.topology == VK_PRIMITIVE_TOPOLOGY_PATCH) &&
- (~pPipeline->active_shaders & VK_SHADER_STAGE_TESS_CONTROL_BIT)) {
- skipCall |= log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) (VkDbgObjectType) 0, 0, 0, DRAWSTATE_INVALID_PIPELINE_CREATE_STATE, "DS",
+ if (pPipeline->iaStateCI.topology == VK_PRIMITIVE_TOPOLOGY_PATCH) {
+ if (~pPipeline->active_shaders & VK_SHADER_STAGE_TESS_CONTROL_BIT) {
+ skipCall |= log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) (VkDbgObjectType) 0, 0, 0, DRAWSTATE_INVALID_PIPELINE_CREATE_STATE, "DS",
"Invalid Pipeline CreateInfo State: VK_PRIMITIVE_TOPOLOGY_PATCH primitive topology is only valid for tessellation pipelines");
+ }
+ if (!pPipeline->tessStateCI.patchControlPoints || (pPipeline->tessStateCI.patchControlPoints > 32)) {
+ skipCall |= log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) (VkDbgObjectType) 0, 0, 0, DRAWSTATE_INVALID_PIPELINE_CREATE_STATE, "DS",
+ "Invalid Pipeline CreateInfo State: VK_PRIMITIVE_TOPOLOGY_PATCH primitive topology used with patchControlPoints value %u."
+ " patchControlPoints should be >0 and <=32.", pPipeline->tessStateCI.patchControlPoints);
+ }
}
return skipCall;
}