@@ -259,6 +259,9 @@ std::unique_ptr<CVulkanPhysicalDevice> CVulkanPhysicalDevice::create(core::smart
259
259
return nullptr ;
260
260
if (!isExtensionSupported (VK_EXT_ROBUSTNESS_2_EXTENSION_NAME))
261
261
return nullptr ;
262
+ // At least one of these two must be available
263
+ if (!isExtensionSupported (VK_KHR_MAINTENANCE_5_EXTENSION_NAME) && !isExtensionSupported (VK_EXT_GRAPHICS_PIPELINE_LIBRARY_EXTENSION_NAME))
264
+ return nullptr ;
262
265
263
266
// Basic stuff for constructing pNext chains
264
267
VkBaseInStructure* pNextTail;
@@ -307,6 +310,8 @@ std::unique_ptr<CVulkanPhysicalDevice> CVulkanPhysicalDevice::create(core::smart
307
310
VkPhysicalDeviceCooperativeMatrixPropertiesKHR cooperativeMatrixProperties = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_KHR };
308
311
VkPhysicalDeviceShaderSMBuiltinsPropertiesNV shaderSMBuiltinsPropertiesNV = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_PROPERTIES_NV };
309
312
VkPhysicalDeviceShaderCoreProperties2AMD shaderCoreProperties2AMD = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_2_AMD };
313
+ VkPhysicalDeviceMaintenance5PropertiesKHR maintenance5Properties = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_PROPERTIES_KHR };
314
+ VkPhysicalDeviceGraphicsPipelineLibraryPropertiesEXT graphicsPipelineLibraryProperties = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GRAPHICS_PIPELINE_LIBRARY_PROPERTIES_EXT };
310
315
// ! Because Renderdoc is special and instead of ignoring extensions it whitelists them
311
316
if (isExtensionSupported (VK_EXT_EXTERNAL_MEMORY_HOST_EXTENSION_NAME))
312
317
addToPNextChain (&externalMemoryHostProperties);
@@ -333,8 +338,10 @@ std::unique_ptr<CVulkanPhysicalDevice> CVulkanPhysicalDevice::create(core::smart
333
338
addToPNextChain (&cooperativeMatrixProperties);
334
339
if (isExtensionSupported (VK_NV_SHADER_SM_BUILTINS_EXTENSION_NAME))
335
340
addToPNextChain (&shaderSMBuiltinsPropertiesNV);
336
- if (isExtensionSupported (VK_AMD_SHADER_CORE_PROPERTIES_2_EXTENSION_NAME))
337
- addToPNextChain (&shaderCoreProperties2AMD);
341
+ if (isExtensionSupported (VK_KHR_MAINTENANCE_5_EXTENSION_NAME))
342
+ addToPNextChain (&maintenance5Properties);
343
+ if (isExtensionSupported (VK_EXT_GRAPHICS_PIPELINE_LIBRARY_EXTENSION_NAME))
344
+ addToPNextChain (&graphicsPipelineLibraryProperties);
338
345
// call
339
346
finalizePNextChain ();
340
347
vkGetPhysicalDeviceProperties2 (vk_physicalDevice,&deviceProperties2);
@@ -390,44 +397,25 @@ std::unique_ptr<CVulkanPhysicalDevice> CVulkanPhysicalDevice::create(core::smart
390
397
391
398
// vulkan12Properties.denormBehaviorIndependence;
392
399
// vulkan12Properties.denormBehaviorIndependence;
393
- if (!vulkan12Properties.shaderSignedZeroInfNanPreserveFloat16 )
394
- return nullptr ;
395
- if (!vulkan12Properties.shaderSignedZeroInfNanPreserveFloat32 )
396
- return nullptr ;
397
- if (!vulkan12Properties.shaderSignedZeroInfNanPreserveFloat64 )
398
- return nullptr ;
399
- if (!vulkan12Properties.shaderDenormPreserveFloat16 )
400
- return nullptr ;
401
- if (!vulkan12Properties.shaderDenormPreserveFloat32 )
402
- return nullptr ;
403
- if (!vulkan12Properties.shaderDenormPreserveFloat64 )
404
- return nullptr ;
405
- if (!vulkan12Properties.shaderDenormFlushToZeroFloat16 )
406
- return nullptr ;
407
- if (!vulkan12Properties.shaderDenormFlushToZeroFloat32 )
408
- return nullptr ;
409
- if (!vulkan12Properties.shaderDenormFlushToZeroFloat64 )
410
- return nullptr ;
411
- if (!vulkan12Properties.shaderRoundingModeRTEFloat16 )
412
- return nullptr ;
413
- if (!vulkan12Properties.shaderRoundingModeRTEFloat32 )
414
- return nullptr ;
415
- if (!vulkan12Properties.shaderRoundingModeRTEFloat64 )
416
- return nullptr ;
417
- if (!vulkan12Properties.shaderRoundingModeRTZFloat16 )
418
- return nullptr ;
419
- if (!vulkan12Properties.shaderRoundingModeRTZFloat32 )
420
- return nullptr ;
421
- if (!vulkan12Properties.shaderRoundingModeRTZFloat64 )
422
- return nullptr ;
423
-
400
+ properties.limits .shaderSignedZeroInfNanPreserveFloat32 = vulkan12Properties.shaderSignedZeroInfNanPreserveFloat32 ;
401
+ properties.limits .shaderDenormPreserveFloat32 = vulkan12Properties.shaderDenormPreserveFloat32 ;
402
+ properties.limits .shaderDenormFlushToZeroFloat32 = vulkan12Properties.shaderDenormFlushToZeroFloat32 ;
403
+ properties.limits .shaderRoundingModeRTEFloat32 = vulkan12Properties.shaderRoundingModeRTEFloat32 ;
404
+ properties.limits .shaderRoundingModeRTZFloat32 = vulkan12Properties.shaderRoundingModeRTZFloat32 ;
405
+ properties.limits .shaderSignedZeroInfNanPreserveFloat16 = vulkan12Properties.shaderSignedZeroInfNanPreserveFloat16 ;
406
+ properties.limits .shaderDenormPreserveFloat16 = vulkan12Properties.shaderDenormPreserveFloat16 ;
407
+ properties.limits .shaderDenormFlushToZeroFloat16 = vulkan12Properties.shaderDenormFlushToZeroFloat16 ;
408
+ properties.limits .shaderRoundingModeRTEFloat16 = vulkan12Properties.shaderRoundingModeRTEFloat16 ;
409
+ properties.limits .shaderRoundingModeRTZFloat16 = vulkan12Properties.shaderRoundingModeRTZFloat16 ;
410
+ properties.limits .shaderSignedZeroInfNanPreserveFloat64 = vulkan12Properties.shaderSignedZeroInfNanPreserveFloat64 ;
411
+ properties.limits .shaderDenormPreserveFloat64 = vulkan12Properties.shaderDenormPreserveFloat64 ;
412
+ properties.limits .shaderDenormFlushToZeroFloat64 = vulkan12Properties.shaderDenormFlushToZeroFloat64 ;
413
+ properties.limits .shaderRoundingModeRTEFloat64 = vulkan12Properties.shaderRoundingModeRTEFloat64 ;
414
+ properties.limits .shaderRoundingModeRTZFloat64 = vulkan12Properties.shaderRoundingModeRTZFloat64 ;
415
+
416
+
424
417
// descriptor indexing
425
418
properties.limits .maxUpdateAfterBindDescriptorsInAllPools = vulkan12Properties.maxUpdateAfterBindDescriptorsInAllPools ;
426
- properties.limits .shaderUniformBufferArrayNonUniformIndexingNative = vulkan12Properties.shaderUniformBufferArrayNonUniformIndexingNative ;
427
- properties.limits .shaderSampledImageArrayNonUniformIndexingNative = vulkan12Properties.shaderSampledImageArrayNonUniformIndexingNative ;
428
- properties.limits .shaderStorageBufferArrayNonUniformIndexingNative = vulkan12Properties.shaderStorageBufferArrayNonUniformIndexingNative ;
429
- properties.limits .shaderStorageImageArrayNonUniformIndexingNative = vulkan12Properties.shaderStorageImageArrayNonUniformIndexingNative ;
430
- properties.limits .shaderInputAttachmentArrayNonUniformIndexingNative = vulkan12Properties.shaderInputAttachmentArrayNonUniformIndexingNative ;
431
419
properties.limits .robustBufferAccessUpdateAfterBind = vulkan12Properties.robustBufferAccessUpdateAfterBind ;
432
420
properties.limits .quadDivergentImplicitLod = vulkan12Properties.quadDivergentImplicitLod ;
433
421
properties.limits .maxPerStageDescriptorUpdateAfterBindSamplers = vulkan12Properties.maxPerStageDescriptorUpdateAfterBindSamplers ;
@@ -716,7 +704,9 @@ std::unique_ptr<CVulkanPhysicalDevice> CVulkanPhysicalDevice::create(core::smart
716
704
VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesARM rasterizationOrderAttachmentAccessFeatures = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_FEATURES_ARM };
717
705
VkPhysicalDeviceRayTracingPositionFetchFeaturesKHR rayTracingPositionFetchFeatures = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_POSITION_FETCH_FEATURES_KHR };
718
706
VkPhysicalDeviceColorWriteEnableFeaturesEXT colorWriteEnableFeatures = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COLOR_WRITE_ENABLE_FEATURES_EXT };
719
- VkPhysicalDeviceCooperativeMatrixFeaturesKHR cooperativeMatrixFeatures = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_KHR };
707
+ VkPhysicalDeviceCooperativeMatrixFeaturesKHR cooperativeMatrixFeatures = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_KHR };
708
+ VkPhysicalDeviceMaintenance5FeaturesKHR maintenance5Features = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_FEATURES_KHR };
709
+ VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT graphicsPipelineLibraryFeatures = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GRAPHICS_PIPELINE_LIBRARY_FEATURES_EXT };
720
710
721
711
if (isExtensionSupported (VK_EXT_CONDITIONAL_RENDERING_EXTENSION_NAME))
722
712
addToPNextChain (&conditionalRenderingFeatures);
@@ -781,6 +771,10 @@ std::unique_ptr<CVulkanPhysicalDevice> CVulkanPhysicalDevice::create(core::smart
781
771
addToPNextChain (&rayTracingPositionFetchFeatures);
782
772
if (isExtensionSupported (VK_EXT_COLOR_WRITE_ENABLE_EXTENSION_NAME))
783
773
addToPNextChain (&colorWriteEnableFeatures);
774
+ if (isExtensionSupported (VK_KHR_MAINTENANCE_5_EXTENSION_NAME))
775
+ addToPNextChain (&maintenance5Features);
776
+ if (isExtensionSupported (VK_EXT_GRAPHICS_PIPELINE_LIBRARY_EXTENSION_NAME))
777
+ addToPNextChain (&graphicsPipelineLibraryFeatures);
784
778
// call
785
779
finalizePNextChain ();
786
780
vkGetPhysicalDeviceFeatures2 (vk_physicalDevice,&deviceFeatures);
@@ -903,6 +897,43 @@ std::unique_ptr<CVulkanPhysicalDevice> CVulkanPhysicalDevice::create(core::smart
903
897
properties.limits .shaderFloat16 = vulkan12Features.shaderFloat16 ;
904
898
if (!vulkan12Features.shaderInt8 )
905
899
return nullptr ;
900
+
901
+ if (!properties.limits .shaderSignedZeroInfNanPreserveFloat32 )
902
+ return nullptr ;
903
+ if (!properties.limits .shaderDenormPreserveFloat32 )
904
+ return nullptr ;
905
+ if (!properties.limits .shaderDenormFlushToZeroFloat32 )
906
+ return nullptr ;
907
+ if (!properties.limits .shaderRoundingModeRTEFloat32 )
908
+ return nullptr ;
909
+ if (!properties.limits .shaderRoundingModeRTZFloat32 )
910
+ return nullptr ;
911
+
912
+ if (vulkan12Features.shaderFloat16 ) {
913
+ if (!properties.limits .shaderSignedZeroInfNanPreserveFloat16 )
914
+ return nullptr ;
915
+ if (!properties.limits .shaderDenormPreserveFloat16 )
916
+ return nullptr ;
917
+ if (!properties.limits .shaderDenormFlushToZeroFloat16 )
918
+ return nullptr ;
919
+ if (!properties.limits .shaderRoundingModeRTEFloat16 )
920
+ return nullptr ;
921
+ if (!properties.limits .shaderRoundingModeRTZFloat16 )
922
+ return nullptr ;
923
+ }
924
+
925
+ if (deviceFeatures.features .shaderFloat64 ) {
926
+ if (!properties.limits .shaderSignedZeroInfNanPreserveFloat64 )
927
+ return nullptr ;
928
+ if (!properties.limits .shaderDenormPreserveFloat64 )
929
+ return nullptr ;
930
+ if (!properties.limits .shaderDenormFlushToZeroFloat64 )
931
+ return nullptr ;
932
+ if (!properties.limits .shaderRoundingModeRTEFloat64 )
933
+ return nullptr ;
934
+ if (!properties.limits .shaderRoundingModeRTZFloat64 )
935
+ return nullptr ;
936
+ }
906
937
907
938
if (!vulkan12Features.descriptorIndexing )
908
939
return nullptr ;
@@ -1138,7 +1169,6 @@ std::unique_ptr<CVulkanPhysicalDevice> CVulkanPhysicalDevice::create(core::smart
1138
1169
if (isExtensionSupported (VK_KHR_COOPERATIVE_MATRIX_EXTENSION_NAME))
1139
1170
features.cooperativeMatrixRobustBufferAccess = cooperativeMatrixFeatures.cooperativeMatrixRobustBufferAccess ;
1140
1171
1141
-
1142
1172
/* Vulkan Extensions Features as Limits */
1143
1173
if (isExtensionSupported (VK_NV_SHADER_SM_BUILTINS_EXTENSION_NAME))
1144
1174
properties.limits .shaderSMBuiltins = shaderSMBuiltinsFeaturesNV.shaderSMBuiltins ;
@@ -1211,7 +1241,7 @@ std::unique_ptr<CVulkanPhysicalDevice> CVulkanPhysicalDevice::create(core::smart
1211
1241
properties.limits .colorWriteEnable = colorWriteEnableFeatures.colorWriteEnable ;
1212
1242
1213
1243
if (isExtensionSupported (VK_KHR_COOPERATIVE_MATRIX_EXTENSION_NAME))
1214
- properties.limits .cooperativeMatrixRobustBufferAccess = cooperativeMatrixFeatures.cooperativeMatrixRobustBufferAccess ;
1244
+ properties.limits .cooperativeMatrix = cooperativeMatrixFeatures.cooperativeMatrix ;
1215
1245
}
1216
1246
1217
1247
// we compare all limits against the defaults easily!
@@ -1584,6 +1614,16 @@ core::smart_refctd_ptr<ILogicalDevice> CVulkanPhysicalDevice::createLogicalDevic
1584
1614
1585
1615
VkPhysicalDeviceCooperativeMatrixFeaturesKHR cooperativeMatrixFeatures = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_KHR,nullptr };
1586
1616
REQUIRE_EXTENSION_IF (enabledFeatures.cooperativeMatrixRobustBufferAccess ,VK_KHR_COOPERATIVE_MATRIX_EXTENSION_NAME,&cooperativeMatrixFeatures);
1617
+
1618
+ VkPhysicalDeviceMaintenance5FeaturesKHR maintenance5Features = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_FEATURES_KHR, nullptr };
1619
+ VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT graphicsPipelineLibraryFeatures = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GRAPHICS_PIPELINE_LIBRARY_FEATURES_EXT, nullptr };
1620
+
1621
+ // Enable maintenance5 and graphics pipeline libraries as backup if available
1622
+ if (!enableExtensionIfAvailable (VK_KHR_MAINTENANCE_5_EXTENSION_NAME, &maintenance5Features))
1623
+ {
1624
+ enableExtensionIfAvailable (VK_KHR_PIPELINE_LIBRARY_EXTENSION_NAME, nullptr );
1625
+ enableExtensionIfAvailable (VK_EXT_GRAPHICS_PIPELINE_LIBRARY_EXTENSION_NAME, &graphicsPipelineLibraryFeatures);
1626
+ }
1587
1627
1588
1628
#undef REQUIRE_EXTENSION_IF
1589
1629
@@ -1828,10 +1868,12 @@ core::smart_refctd_ptr<ILogicalDevice> CVulkanPhysicalDevice::createLogicalDevic
1828
1868
// colorWriteEnableFeatures [LIMIT SO ENABLE EVERYTHING BY DEFAULT]
1829
1869
1830
1870
if (limits.cooperativeMatrix ) {
1831
- cooperativeMatrixFeatures.cooperativeMatrix = enabledFeatures.cooperativeMatrix ;
1832
1871
cooperativeMatrixFeatures.cooperativeMatrixRobustBufferAccess = enabledFeatures.cooperativeMatrixRobustBufferAccess ;
1833
1872
}
1834
1873
1874
+ maintenance5Features.maintenance5 = true ;
1875
+ graphicsPipelineLibraryFeatures.graphicsPipelineLibrary = maintenance5Features.maintenance5 == 0 ;
1876
+
1835
1877
// convert a set into a vector
1836
1878
core::vector<const char *> extensionStrings (extensionsToEnable.size ());
1837
1879
{
0 commit comments