Remove old checks from pipeline.c and verify that they're handled in validation
authorTobin Ehlis <tobin@lunarg.com>
Thu, 17 Sep 2015 14:46:18 +0000 (08:46 -0600)
committerTobin Ehlis <tobin@lunarg.com>
Mon, 21 Sep 2015 17:41:46 +0000 (11:41 -0600)
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
layers/vk_validation_layer_details.md

index 833771158697728a9f85ee07898c9b095dcb6878..4a894f2494df4160d3edbf5e9edc7338fdb9ec5f 100644 (file)
@@ -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;
 }
index 4d91b2c3f4892dabe24f8ddc9f610eb343a51538..683a35434d93b82bd00ee86aa478830bbf26590d 100644 (file)
@@ -98,6 +98,7 @@ Additional work to be done
  4. INT & FLOAT bordercolors. Border color int/float selection must match associated texture format.
  5. Flag error on VkBufferCreateInfo if buffer size is 0
  6. VkImageViewCreateInfo.format must be set
+ 7. For vkCreateGraphicsPipelines, correctly handle array of pCreateInfos and array of pStages within each element of pCreatInfos
 
 ## Image