// // Created by atdunbg on 2026/9/21. // #include #include #include #include #include #include namespace Engine { Material::Material(Device& device, DescriptorManager& descriptorManager, vk::DescriptorSetLayout layout, const std::array& textures) : m_Textures(textures) { m_DescriptorSet = descriptorManager.AllocateDescriptorSet(layout); for (u32 slot = 0; slot < kSlotCount; ++slot) { descriptorManager.UpdateTexture( m_DescriptorSet, slot, m_Textures[slot]->GetSampler(), m_Textures[slot]->GetView()); } } Material::~Material() = default; std::string Material::MakeCacheKey(const std::string paths[kSlotCount]) { std::string key; for (u32 slot = 0; slot < kSlotCount; ++slot) { if (slot) key += '\n'; key += paths[slot]; } return key; } } // namespace Engine