24 class VSG_DECLSPEC DeviceFeatures :
public Inherit<Object, DeviceFeatures>
29 DeviceFeatures(
const DeviceFeatures&) =
delete;
30 DeviceFeatures& operator=(
const DeviceFeatures&) =
delete;
37 template<
typename FeatureStruct, VkStructureType type>
40 if (
auto itr = _features.find(type); itr != _features.end())
return *
reinterpret_cast<FeatureStruct*
>(itr->second.first);
42 FeatureStruct* feature =
new FeatureStruct{};
44 feature->sType = type;
45 feature->pNext =
nullptr;
47 _features[type].first =
reinterpret_cast<FeatureHeader*
>(feature);
48 _features[type].second = [](
FeatureHeader* ptr) {
delete reinterpret_cast<FeatureStruct*
>(ptr); };
56 VkPhysicalDeviceFeatures&
get();
71 VkStructureType sType;
77 std::map<VkStructureType, std::pair<FeatureHeader*, DeleteHandler>> _features;