From 1bf8d6a5a0bb3fa6cba5b2ca0e67a1a2d3bcdf7d Mon Sep 17 00:00:00 2001
From: Tobias Frisch <tfrisch@uni-koblenz.de>
Date: Wed, 13 Jul 2022 15:21:09 +0200
Subject: [PATCH] Added Vulkan 1.3 features support to manager

Signed-off-by: Tobias Frisch <tfrisch@uni-koblenz.de>
---
 include/vkcv/FeatureManager.hpp | 10 ++++++++++
 src/vkcv/FeatureManager.cpp     | 22 ++++++++++++++++++++++
 2 files changed, 32 insertions(+)

diff --git a/include/vkcv/FeatureManager.hpp b/include/vkcv/FeatureManager.hpp
index e15ad767..5ab424b2 100644
--- a/include/vkcv/FeatureManager.hpp
+++ b/include/vkcv/FeatureManager.hpp
@@ -304,6 +304,16 @@ namespace vkcv {
 		[[nodiscard]]
 		bool checkSupport(const vk::PhysicalDeviceRayTracingPipelineFeaturesKHR& features, bool required) const;
 		
+		/**
+         * @brief Checks support of the @p vk::PhysicalDeviceVulkan13Features.
+         *
+         * @param[in] features The features
+         * @param[in] required True, if the @p features are required, else false
+         * @return @p True, if the @p features are supported, else @p false
+         */
+		[[nodiscard]]
+		bool checkSupport(const vk::PhysicalDeviceVulkan13Features& features, bool required) const;
+		
 		/**
 		 * @brief Searches for a base structure of a given structure type.
 		 *
diff --git a/src/vkcv/FeatureManager.cpp b/src/vkcv/FeatureManager.cpp
index bfceeb63..8c8c16a5 100644
--- a/src/vkcv/FeatureManager.cpp
+++ b/src/vkcv/FeatureManager.cpp
@@ -431,6 +431,28 @@ m_physicalDevice.getFeatures2(&query)
 	    return true;
 	}
 	
+	bool FeatureManager::checkSupport(const vk::PhysicalDeviceVulkan13Features &features, bool required) const {
+		vkcv_check_init_features2(vk::PhysicalDeviceVulkan13Features);
+		
+		vkcv_check_feature(robustImageAccess);
+		vkcv_check_feature(inlineUniformBlock);
+		vkcv_check_feature(descriptorBindingInlineUniformBlockUpdateAfterBind);
+		vkcv_check_feature(pipelineCreationCacheControl);
+		vkcv_check_feature(privateData);
+		vkcv_check_feature(shaderDemoteToHelperInvocation);
+		vkcv_check_feature(shaderTerminateInvocation);
+		vkcv_check_feature(subgroupSizeControl);
+		vkcv_check_feature(computeFullSubgroups);
+		vkcv_check_feature(synchronization2);
+		vkcv_check_feature(textureCompressionASTC_HDR);
+		vkcv_check_feature(shaderZeroInitializeWorkgroupMemory);
+		vkcv_check_feature(dynamicRendering);
+		vkcv_check_feature(shaderIntegerDotProduct);
+		vkcv_check_feature(maintenance4);
+		
+		return true;
+	}
+	
 	vk::BaseOutStructure* FeatureManager::findFeatureStructure(vk::StructureType type) const {
 		for (auto& base : m_featuresExtensions) {
 			if (base->sType == type) {
-- 
GitLab