layers: Adjust SC to validate bulk pipeline creation
authorChris Forbes <chrisf@ijw.co.nz>
Fri, 24 Jul 2015 01:53:47 +0000 (13:53 +1200)
committerChris Forbes <chrisf@ijw.co.nz>
Mon, 27 Jul 2015 01:13:21 +0000 (13:13 +1200)
Previously we passed `count` down to the validator and then dropped it
on the floor, ignoring anything other than pipeline 0.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Courtney Goeltzenleuchter <courtney@lunarg.com>
layers/shader_checker.cpp

index 94b3984516f0d7053fcc019fd1f54d0be73a7dbd..a8bfaed081632ade0e74fbb0495d27adb8696c94 100644 (file)
@@ -887,9 +887,8 @@ shader_stage_attribs[VK_SHADER_STAGE_FRAGMENT + 1] = {
 };
 
 
-//TODO handle count > 1
 static bool
-validate_graphics_pipeline(VkDevice dev, uint32_t count, VkGraphicsPipelineCreateInfo const *pCreateInfo)
+validate_graphics_pipeline(VkDevice dev, VkGraphicsPipelineCreateInfo const *pCreateInfo)
 {
     /* We seem to allow pipeline stages to be specified out of order, so collect and identify them
      * before trying to do anything more: */
@@ -969,7 +968,10 @@ vkCreateGraphicsPipelines(VkDevice device,
                          const VkGraphicsPipelineCreateInfo *pCreateInfos,
                          VkPipeline *pPipelines)
 {
-    bool pass = validate_graphics_pipeline(device, count, pCreateInfos);
+    bool pass = true;
+    for (uint32_t i = 0; i < count; i++) {
+        pass = validate_graphics_pipeline(device, &pCreateInfos[i]) && pass;
+    }
 
     if (pass) {
         /* The driver is allowed to crash if passed junk. Only actually create the