Skip to content

Commit 880e6c2

Browse files
committed
correctly enable maintenance5/graphicsPipelineLibrary features
Signed-off-by: Ali Cheraghi <alichraghi@proton.me>
1 parent 2dd0e43 commit 880e6c2

File tree

2 files changed

+84
-82
lines changed

2 files changed

+84
-82
lines changed

src/nbl/video/CVulkanPhysicalDevice.cpp

Lines changed: 49 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -399,25 +399,51 @@ std::unique_ptr<CVulkanPhysicalDevice> CVulkanPhysicalDevice::create(core::smart
399399

400400
//vulkan12Properties.denormBehaviorIndependence;
401401
//vulkan12Properties.denormBehaviorIndependence;
402-
properties.limits.shaderSignedZeroInfNanPreserveFloat32 = vulkan12Properties.shaderSignedZeroInfNanPreserveFloat32;
403-
properties.limits.shaderDenormPreserveFloat32 = vulkan12Properties.shaderDenormPreserveFloat32;
404-
properties.limits.shaderDenormFlushToZeroFloat32 = vulkan12Properties.shaderDenormFlushToZeroFloat32;
405-
properties.limits.shaderRoundingModeRTEFloat32 = vulkan12Properties.shaderRoundingModeRTEFloat32;
406-
properties.limits.shaderRoundingModeRTZFloat32 = vulkan12Properties.shaderRoundingModeRTZFloat32;
407-
properties.limits.shaderSignedZeroInfNanPreserveFloat16 = vulkan12Properties.shaderSignedZeroInfNanPreserveFloat16;
408-
properties.limits.shaderDenormPreserveFloat16 = vulkan12Properties.shaderDenormPreserveFloat16;
409-
properties.limits.shaderDenormFlushToZeroFloat16 = vulkan12Properties.shaderDenormFlushToZeroFloat16;
410-
properties.limits.shaderRoundingModeRTEFloat16 = vulkan12Properties.shaderRoundingModeRTEFloat16;
411-
properties.limits.shaderRoundingModeRTZFloat16 = vulkan12Properties.shaderRoundingModeRTZFloat16;
412-
properties.limits.shaderSignedZeroInfNanPreserveFloat64 = vulkan12Properties.shaderSignedZeroInfNanPreserveFloat64;
413-
properties.limits.shaderDenormPreserveFloat64 = vulkan12Properties.shaderDenormPreserveFloat64;
414-
properties.limits.shaderDenormFlushToZeroFloat64 = vulkan12Properties.shaderDenormFlushToZeroFloat64;
415-
properties.limits.shaderRoundingModeRTEFloat64 = vulkan12Properties.shaderRoundingModeRTEFloat64;
416-
properties.limits.shaderRoundingModeRTZFloat64 = vulkan12Properties.shaderRoundingModeRTZFloat64;
417402

403+
if (!vulkan12Properties.shaderSignedZeroInfNanPreserveFloat32)
404+
return nullptr;
405+
if (!vulkan12Properties.shaderDenormPreserveFloat32)
406+
return nullptr;
407+
if (!vulkan12Properties.shaderDenormFlushToZeroFloat32)
408+
return nullptr;
409+
if (!vulkan12Properties.shaderRoundingModeRTEFloat32)
410+
return nullptr;
411+
if (!vulkan12Properties.shaderRoundingModeRTZFloat32)
412+
return nullptr;
413+
414+
if (properties.limits.shaderFloat16) {
415+
if (!vulkan12Properties.shaderSignedZeroInfNanPreserveFloat16)
416+
return nullptr;
417+
if (!vulkan12Properties.shaderDenormPreserveFloat16)
418+
return nullptr;
419+
if (!vulkan12Properties.shaderDenormFlushToZeroFloat16)
420+
return nullptr;
421+
if (!vulkan12Properties.shaderRoundingModeRTEFloat16)
422+
return nullptr;
423+
if (!vulkan12Properties.shaderRoundingModeRTZFloat16)
424+
return nullptr;
425+
}
426+
427+
if (properties.limits.shaderFloat64) {
428+
if (!vulkan12Properties.shaderSignedZeroInfNanPreserveFloat64)
429+
return nullptr;
430+
if (!vulkan12Properties.shaderDenormPreserveFloat64)
431+
return nullptr;
432+
if (!vulkan12Properties.shaderDenormFlushToZeroFloat64)
433+
return nullptr;
434+
if (!vulkan12Properties.shaderRoundingModeRTEFloat64)
435+
return nullptr;
436+
if (!vulkan12Properties.shaderRoundingModeRTZFloat64)
437+
return nullptr;
438+
}
418439

419440
// descriptor indexing
420441
properties.limits.maxUpdateAfterBindDescriptorsInAllPools = vulkan12Properties.maxUpdateAfterBindDescriptorsInAllPools;
442+
properties.limits.shaderUniformBufferArrayNonUniformIndexingNative = vulkan12Properties.shaderUniformBufferArrayNonUniformIndexingNative;
443+
properties.limits.shaderSampledImageArrayNonUniformIndexingNative = vulkan12Properties.shaderSampledImageArrayNonUniformIndexingNative;
444+
properties.limits.shaderStorageBufferArrayNonUniformIndexingNative = vulkan12Properties.shaderStorageBufferArrayNonUniformIndexingNative;
445+
properties.limits.shaderStorageImageArrayNonUniformIndexingNative = vulkan12Properties.shaderStorageImageArrayNonUniformIndexingNative;
446+
properties.limits.shaderInputAttachmentArrayNonUniformIndexingNative = vulkan12Properties.shaderInputAttachmentArrayNonUniformIndexingNative;
421447
properties.limits.robustBufferAccessUpdateAfterBind = vulkan12Properties.robustBufferAccessUpdateAfterBind;
422448
properties.limits.quadDivergentImplicitLod = vulkan12Properties.quadDivergentImplicitLod;
423449
properties.limits.maxPerStageDescriptorUpdateAfterBindSamplers = vulkan12Properties.maxPerStageDescriptorUpdateAfterBindSamplers;
@@ -899,43 +925,6 @@ std::unique_ptr<CVulkanPhysicalDevice> CVulkanPhysicalDevice::create(core::smart
899925
properties.limits.shaderFloat16 = vulkan12Features.shaderFloat16;
900926
if (!vulkan12Features.shaderInt8)
901927
return nullptr;
902-
903-
if (!properties.limits.shaderSignedZeroInfNanPreserveFloat32)
904-
return nullptr;
905-
if (!properties.limits.shaderDenormPreserveFloat32)
906-
return nullptr;
907-
if (!properties.limits.shaderDenormFlushToZeroFloat32)
908-
return nullptr;
909-
if (!properties.limits.shaderRoundingModeRTEFloat32)
910-
return nullptr;
911-
if (!properties.limits.shaderRoundingModeRTZFloat32)
912-
return nullptr;
913-
914-
if (vulkan12Features.shaderFloat16) {
915-
if (!properties.limits.shaderSignedZeroInfNanPreserveFloat16)
916-
return nullptr;
917-
if (!properties.limits.shaderDenormPreserveFloat16)
918-
return nullptr;
919-
if (!properties.limits.shaderDenormFlushToZeroFloat16)
920-
return nullptr;
921-
if (!properties.limits.shaderRoundingModeRTEFloat16)
922-
return nullptr;
923-
if (!properties.limits.shaderRoundingModeRTZFloat16)
924-
return nullptr;
925-
}
926-
927-
if (deviceFeatures.features.shaderFloat64) {
928-
if (!properties.limits.shaderSignedZeroInfNanPreserveFloat64)
929-
return nullptr;
930-
if (!properties.limits.shaderDenormPreserveFloat64)
931-
return nullptr;
932-
if (!properties.limits.shaderDenormFlushToZeroFloat64)
933-
return nullptr;
934-
if (!properties.limits.shaderRoundingModeRTEFloat64)
935-
return nullptr;
936-
if (!properties.limits.shaderRoundingModeRTZFloat64)
937-
return nullptr;
938-
}
939928

940929
if (!vulkan12Features.descriptorIndexing)
941930
return nullptr;
@@ -1620,10 +1609,16 @@ core::smart_refctd_ptr<ILogicalDevice> CVulkanPhysicalDevice::createLogicalDevic
16201609
VkPhysicalDeviceMaintenance5FeaturesKHR maintenance5Features = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_FEATURES_KHR, nullptr };
16211610
VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT graphicsPipelineLibraryFeatures = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GRAPHICS_PIPELINE_LIBRARY_FEATURES_EXT, nullptr };
16221611

1612+
enableExtensionIfAvailable(VK_KHR_PIPELINE_LIBRARY_EXTENSION_NAME, nullptr);
1613+
16231614
// Enable maintenance5 and graphics pipeline libraries as backup if available
1624-
if (!enableExtensionIfAvailable(VK_KHR_MAINTENANCE_5_EXTENSION_NAME, &maintenance5Features))
1615+
if (enableExtensionIfAvailable(VK_KHR_MAINTENANCE_5_EXTENSION_NAME, &maintenance5Features))
16251616
{
1626-
enableExtensionIfAvailable(VK_KHR_PIPELINE_LIBRARY_EXTENSION_NAME, nullptr);
1617+
maintenance5Features.maintenance5 = true;
1618+
}
1619+
else
1620+
{
1621+
graphicsPipelineLibraryFeatures.graphicsPipelineLibrary = true;
16271622
enableExtensionIfAvailable(VK_EXT_GRAPHICS_PIPELINE_LIBRARY_EXTENSION_NAME, &graphicsPipelineLibraryFeatures);
16281623
}
16291624

@@ -1873,9 +1868,6 @@ core::smart_refctd_ptr<ILogicalDevice> CVulkanPhysicalDevice::createLogicalDevic
18731868
cooperativeMatrixFeatures.cooperativeMatrixRobustBufferAccess = enabledFeatures.cooperativeMatrixRobustBufferAccess;
18741869
}
18751870

1876-
maintenance5Features.maintenance5 = true;
1877-
graphicsPipelineLibraryFeatures.graphicsPipelineLibrary = maintenance5Features.maintenance5 == 0;
1878-
18791871
// convert a set into a vector
18801872
core::vector<const char*> extensionStrings(extensionsToEnable.size());
18811873
{

src/nbl/video/device_capabilities/device_limits.json

Lines changed: 35 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -903,77 +903,92 @@
903903
{
904904
"type": "bool",
905905
"name": "shaderSignedZeroInfNanPreserveFloat16",
906-
"value": true
906+
"value": false,
907+
"expose": "DISABLE"
907908
},
908909
{
909910
"type": "bool",
910911
"name": "shaderSignedZeroInfNanPreserveFloat32",
911-
"value": true
912+
"value": true,
913+
"expose": "DISABLE"
912914
},
913915
{
914916
"type": "bool",
915917
"name": "shaderSignedZeroInfNanPreserveFloat64",
916-
"value": true
918+
"value": false,
919+
"expose": "DISABLE"
917920
},
918921
{
919922
"type": "bool",
920923
"name": "shaderDenormPreserveFloat16",
921-
"value": true
924+
"value": false,
925+
"expose": "DISABLE"
922926
},
923927
{
924928
"type": "bool",
925929
"name": "shaderDenormPreserveFloat32",
926-
"value": true
930+
"value": true,
931+
"expose": "DISABLE"
927932
},
928933
{
929934
"type": "bool",
930935
"name": "shaderDenormPreserveFloat64",
931-
"value": true
936+
"value": false,
937+
"expose": "DISABLE"
932938
},
933939
{
934940
"type": "bool",
935941
"name": "shaderDenormFlushToZeroFloat16",
936-
"value": true
942+
"value": false,
943+
"expose": "DISABLE"
937944
},
938945
{
939946
"type": "bool",
940947
"name": "shaderDenormFlushToZeroFloat32",
941-
"value": true
948+
"value": true,
949+
"expose": "DISABLE"
942950
},
943951
{
944952
"type": "bool",
945953
"name": "shaderDenormFlushToZeroFloat64",
946-
"value": true
954+
"value": false,
955+
"expose": "DISABLE"
947956
},
948957
{
949958
"type": "bool",
950959
"name": "shaderRoundingModeRTEFloat16",
951-
"value": true
960+
"value": false,
961+
"expose": "DISABLE"
952962
},
953963
{
954964
"type": "bool",
955965
"name": "shaderRoundingModeRTEFloat32",
956-
"value": true
966+
"value": true,
967+
"expose": "DISABLE"
957968
},
958969
{
959970
"type": "bool",
960971
"name": "shaderRoundingModeRTEFloat64",
961-
"value": true
972+
"value": false,
973+
"expose": "DISABLE"
962974
},
963975
{
964976
"type": "bool",
965977
"name": "shaderRoundingModeRTZFloat16",
966-
"value": true
978+
"value": false,
979+
"expose": "DISABLE"
967980
},
968981
{
969982
"type": "bool",
970983
"name": "shaderRoundingModeRTZFloat32",
971-
"value": true
984+
"value": true,
985+
"expose": "DISABLE"
972986
},
973987
{
974988
"type": "bool",
975989
"name": "shaderRoundingModeRTZFloat64",
976-
"value": true
990+
"value": false,
991+
"expose": "DISABLE"
977992
}
978993
]
979994
},
@@ -988,34 +1003,29 @@
9881003
{
9891004
"type": "bool",
9901005
"name": "shaderUniformBufferArrayNonUniformIndexingNative",
991-
"value": true,
992-
"expose": "REQUIRE"
1006+
"value": false
9931007
},
9941008
{
9951009
"type": "bool",
9961010
"name": "shaderSampledImageArrayNonUniformIndexingNative",
997-
"value": true,
998-
"expose": "REQUIRE",
1011+
"value": false,
9991012
"comment": ["promotion candidate"]
10001013
},
10011014
{
10021015
"type": "bool",
10031016
"name": "shaderStorageBufferArrayNonUniformIndexingNative",
1004-
"value": true,
1005-
"expose": "REQUIRE"
1017+
"value": false
10061018
},
10071019
{
10081020
"type": "bool",
10091021
"name": "shaderStorageImageArrayNonUniformIndexingNative",
1010-
"value": true,
1011-
"expose": "REQUIRE",
1022+
"value": false,
10121023
"comment": ["promotion candidate"]
10131024
},
10141025
{
10151026
"type": "bool",
10161027
"name": "shaderInputAttachmentArrayNonUniformIndexingNative",
1017-
"value": true,
1018-
"expose": "REQUIRE",
1028+
"value": false,
10191029
"comment": ["promotion candidate"]
10201030
},
10211031
{

0 commit comments

Comments
 (0)