#ifndef EMULATOR_INCLUDE_EMULATOR_GRAPHICS_SHADER_RECOMPILER_RESOURCEMATERIALIZATION_H_ #define EMULATOR_INCLUDE_EMULATOR_GRAPHICS_SHADER_RECOMPILER_RESOURCEMATERIALIZATION_H_ #include "graphics/shader/recompiler/ir/passes/SrtWalker.h" namespace Libs::Graphics::ShaderRecompiler::IR { struct ResourceSnapshot { struct IndirectImage { uint32_t resource = 0; uint32_t capacity = 0; std::vector keys; std::vector candidates; std::vector descriptors; }; std::vector buffers; std::vector images; std::vector samplers; std::vector flattened_srt; std::vector user_data; std::vector indirect_images; }; bool ValidateResourceSnapshot(const Program& program, const ResourceSnapshot& snapshot); bool ValidateResourceSpecialization(const Program& program, const ResourceSnapshot& snapshot); // Resolves the immutable dense resource topology against one runtime user-data/SRT snapshot. // On failure the destination is unchanged. bool MaterializeResources(const Program& program, const SrtRuntime& runtime, ResourceSnapshot& snapshot); // Applies runtime descriptor shape/format facts to a copied dense topology before layout and // emission. Invalid specializations are fatal. void SpecializeResources(Program& program, ResourceSnapshot& snapshot); } // namespace Libs::Graphics::ShaderRecompiler::IR #endif /* EMULATOR_INCLUDE_EMULATOR_GRAPHICS_SHADER_RECOMPILER_RESOURCEMATERIALIZATION_H_ */