Skip to content

Commit a4e562e

Browse files
committed
Fixed #278
1 parent 7915eca commit a4e562e

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

‎Source/VK/DeviceVK.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,7 @@ struct DeviceVK final : public DeviceBase {
325325
VkDebugUtilsMessengerEXT m_Messenger = VK_NULL_HANDLE;
326326
VmaAllocator_T* m_Vma = nullptr;
327327
uint32_t m_NumActiveFamilyIndices = 0;
328+
uint32_t m_InstanceVersion = 0;
328329
uint32_t m_MinorVersion = 0;
329330
VkTimeDomainKHR m_CalibratedTimestampCPUTimeDomain = VK_TIME_DOMAIN_DEVICE_KHR;
330331
uint64_t m_NonCoherentAtomSize = 1;

‎Source/VK/DeviceVK.hpp‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,7 @@ void DeviceVK::ProcessDeviceExtensions(Vector<const char*>& desiredDeviceExts, b
563563
APPEND_EXT(m_MinorVersion < 3, VK_KHR_DYNAMIC_RENDERING_EXTENSION_NAME);
564564
APPEND_EXT(m_MinorVersion < 3, VK_KHR_SYNCHRONIZATION_2_EXTENSION_NAME);
565565
APPEND_EXT(m_MinorVersion < 3, VK_KHR_MAINTENANCE_4_EXTENSION_NAME);
566+
APPEND_EXT(m_MinorVersion < 3, VK_KHR_FORMAT_FEATURE_FLAGS_2_EXTENSION_NAME);
566567
APPEND_EXT(m_MinorVersion < 3, VK_KHR_SHADER_INTEGER_DOT_PRODUCT_EXTENSION_NAME);
567568
APPEND_EXT(m_MinorVersion < 3, VK_EXT_IMAGE_ROBUSTNESS_EXTENSION_NAME);
568569
APPEND_EXT(m_MinorVersion < 3, VK_EXT_EXTENDED_DYNAMIC_STATE_EXTENSION_NAME); // TODO: there are 2 and 3 versions...
@@ -774,7 +775,7 @@ Result DeviceVK::Create(const DeviceCreationDesc& desc, const DeviceCreationVKDe
774775
m_VK.GetPhysicalDeviceProperties2(deviceGroups[i].physicalDevices[0], &props);
775776

776777
uint32_t majorVersion = VK_API_VERSION_MAJOR(props.properties.apiVersion);
777-
m_MinorVersion = VK_API_VERSION_MINOR(props.properties.apiVersion);
778+
m_MinorVersion = std::min(VK_API_VERSION_MINOR(props.properties.apiVersion), VK_API_VERSION_MINOR(m_InstanceVersion));
778779

779780
bool isSupported = (majorVersion * 10 + m_MinorVersion) >= 12;
780781
if (desc.adapterDesc) {
@@ -2031,6 +2032,7 @@ Result DeviceVK::CreateInstance(bool enableGraphicsAPIValidation, const Vector<c
20312032

20322033
VkApplicationInfo appInfo = {VK_STRUCTURE_TYPE_APPLICATION_INFO};
20332034
appInfo.apiVersion = std::clamp(instanceVersion, VK_API_VERSION_1_2, VK_API_VERSION_1_4);
2035+
m_InstanceVersion = appInfo.apiVersion;
20342036

20352037
const VkValidationFeatureEnableEXT enabledValidationFeatures[] = {
20362038
VK_VALIDATION_FEATURE_ENABLE_DEBUG_PRINTF_EXT, // TODO: add VK_VALIDATION_FEATURE_ENABLE_SYNCHRONIZATION_VALIDATION_EXT?

0 commit comments

Comments
 (0)