layers: Add stageCount to raytrace pipe validation

Loop over each stage in the raytracing pipeline in core validation and
state tracking instead of only looking at the first entry.

Change-Id: Iadaae3175aa48e70e571f84f4b969095ea5e2772
diff --git a/layers/shader_validation.cpp b/layers/shader_validation.cpp
index 9461b19..b95928c 100644
--- a/layers/shader_validation.cpp
+++ b/layers/shader_validation.cpp
@@ -2973,12 +2973,16 @@
 }
 
 bool CoreChecks::ValidateRayTracingPipelineNV(PIPELINE_STATE *pipeline) const {
-    const auto &stage = pipeline->raytracingPipelineCI.ptr()->pStages[0];
+    bool skip = false;
+    for (uint32_t stage_index = 0; stage_index < pipeline->raytracingPipelineCI.stageCount; stage_index++) {
+        const auto &stage = pipeline->raytracingPipelineCI.ptr()->pStages[stage_index];
 
-    const SHADER_MODULE_STATE *module = GetShaderModuleState(stage.module);
-    const spirv_inst_iter entrypoint = FindEntrypoint(module, stage.pName, stage.stage);
+        const SHADER_MODULE_STATE *module = GetShaderModuleState(stage.module);
+        const spirv_inst_iter entrypoint = FindEntrypoint(module, stage.pName, stage.stage);
 
-    return ValidatePipelineShaderStage(&stage, pipeline, pipeline->stage_state[0], module, entrypoint, false);
+        skip |= ValidatePipelineShaderStage(&stage, pipeline, pipeline->stage_state[stage_index], module, entrypoint, false);
+    }
+    return skip;
 }
 
 uint32_t ValidationCache::MakeShaderHash(VkShaderModuleCreateInfo const *smci) { return XXH32(smci->pCode, smci->codeSize, 0); }