chromium/third_party/vulkan-validation-layers/src/layers/state_tracker/shader_stage_state.h

/* Copyright (c) 2024 The Khronos Group Inc.
 * Copyright (c) 2024 Valve Corporation
 * Copyright (c) 2024 LunarG, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */

#pragma once
#include <vulkan/vulkan.h>
#include "containers/custom_containers.h"

namespace vku {
struct safe_VkPipelineShaderStageCreateInfo;
struct safe_VkShaderCreateInfoEXT;
struct safe_VkSpecializationInfo;
}  // namespace vku

namespace vvl {
struct ShaderModule;
}  // namespace vvl

namespace spirv {
struct Module;
struct EntryPoint;
class Instruction;
}  // namespace spirv

// This is a wrapper around the Shader as it may come from a Pipeline or Shader Object.
struct ShaderStageState {};

namespace spirv {
struct ResourceInterfaceVariable;
}  // namespace spirv

struct DescriptorRequirement {};

inline bool operator==(const DescriptorRequirement &a, const DescriptorRequirement &b) noexcept {}

inline bool operator<(const DescriptorRequirement &a, const DescriptorRequirement &b) noexcept {}

// < binding index (of descriptor set) : meta data >
BindingVariableMap;

// Capture which slots (set#->bindings) are actually used by the shaders of this pipeline
ActiveSlotMap;

void GetActiveSlots(ActiveSlotMap &active_slots, const std::shared_ptr<const spirv::EntryPoint> &entrypoint);
ActiveSlotMap GetActiveSlots(const std::vector<ShaderStageState> &stage_states);
ActiveSlotMap GetActiveSlots(const std::shared_ptr<const spirv::EntryPoint> &entrypoint);

uint32_t GetMaxActiveSlot(const ActiveSlotMap &active_slots);