From 71ccff011ec16ed932fe8b58504f05d3915b64cb Mon Sep 17 00:00:00 2001 From: Tobin Ehlis Date: Thu, 17 Sep 2015 08:46:18 -0600 Subject: 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. --- layers/draw_state.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'layers/draw_state.cpp') diff --git a/layers/draw_state.cpp b/layers/draw_state.cpp index 83377115..4a894f24 100644 --- a/layers/draw_state.cpp +++ b/layers/draw_state.cpp @@ -505,10 +505,16 @@ static VkBool32 verifyPipelineCreateState(const VkDevice device, const PIPELINE_ 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; } -- cgit v1.2.3